LLVM 20.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
llvm::JSONScopedPrinter Class Reference

#include "llvm/Support/ScopedPrinter.h"

Inheritance diagram for llvm::JSONScopedPrinter:
Inheritance graph
[legend]

Public Member Functions

 JSONScopedPrinter (raw_ostream &OS, bool PrettyPrint=false, std::unique_ptr< DelimitedScope > &&OuterScope=std::unique_ptr< DelimitedScope >{})
 
void printNumber (StringRef Label, char Value) override
 
void printNumber (StringRef Label, signed char Value) override
 
void printNumber (StringRef Label, unsigned char Value) override
 
void printNumber (StringRef Label, short Value) override
 
void printNumber (StringRef Label, unsigned short Value) override
 
void printNumber (StringRef Label, int Value) override
 
void printNumber (StringRef Label, unsigned int Value) override
 
void printNumber (StringRef Label, long Value) override
 
void printNumber (StringRef Label, unsigned long Value) override
 
void printNumber (StringRef Label, long long Value) override
 
void printNumber (StringRef Label, unsigned long long Value) override
 
void printNumber (StringRef Label, float Value) override
 
void printNumber (StringRef Label, double Value) override
 
void printNumber (StringRef Label, const APSInt &Value) override
 
void printBoolean (StringRef Label, bool Value) override
 
void printList (StringRef Label, const ArrayRef< bool > List) override
 
void printList (StringRef Label, const ArrayRef< std::string > List) override
 
void printList (StringRef Label, const ArrayRef< uint64_t > List) override
 
void printList (StringRef Label, const ArrayRef< uint32_t > List) override
 
void printList (StringRef Label, const ArrayRef< uint16_t > List) override
 
void printList (StringRef Label, const ArrayRef< uint8_t > List) override
 
void printList (StringRef Label, const ArrayRef< int64_t > List) override
 
void printList (StringRef Label, const ArrayRef< int32_t > List) override
 
void printList (StringRef Label, const ArrayRef< int16_t > List) override
 
void printList (StringRef Label, const ArrayRef< int8_t > List) override
 
void printList (StringRef Label, const ArrayRef< APSInt > List) override
 
void printString (StringRef Value) override
 
void printString (StringRef Label, StringRef Value) override
 
void objectBegin () override
 
void objectBegin (StringRef Label) override
 
void objectEnd () override
 
void arrayBegin () override
 
void arrayBegin (StringRef Label) override
 
void arrayEnd () override
 
- Public Member Functions inherited from llvm::ScopedPrinter
 ScopedPrinter (raw_ostream &OS, ScopedPrinterKind Kind=ScopedPrinterKind::Base)
 
ScopedPrinterKind getKind () const
 
virtual ~ScopedPrinter ()=default
 
void flush ()
 
void indent (int Levels=1)
 
void unindent (int Levels=1)
 
void resetIndent ()
 
int getIndentLevel ()
 
void setPrefix (StringRef P)
 
void printIndent ()
 
template<typename T >
HexNumber hex (T Value)
 
template<typename T , typename TEnum >
void printEnum (StringRef Label, T Value, ArrayRef< EnumEntry< TEnum > > EnumValues)
 
template<typename T , typename TFlag >
void printFlags (StringRef Label, T Value, ArrayRef< EnumEntry< TFlag > > Flags, TFlag EnumMask1={}, TFlag EnumMask2={}, TFlag EnumMask3={}, ArrayRef< FlagEntry > ExtraFlags={})
 
template<typename T >
void printFlags (StringRef Label, T Value)
 
virtual void printNumber (StringRef Label, char Value)
 
virtual void printNumber (StringRef Label, signed char Value)
 
virtual void printNumber (StringRef Label, unsigned char Value)
 
virtual void printNumber (StringRef Label, short Value)
 
virtual void printNumber (StringRef Label, unsigned short Value)
 
virtual void printNumber (StringRef Label, int Value)
 
virtual void printNumber (StringRef Label, unsigned int Value)
 
virtual void printNumber (StringRef Label, long Value)
 
virtual void printNumber (StringRef Label, unsigned long Value)
 
virtual void printNumber (StringRef Label, long long Value)
 
virtual void printNumber (StringRef Label, unsigned long long Value)
 
virtual void printNumber (StringRef Label, const APSInt &Value)
 
virtual void printNumber (StringRef Label, float Value)
 
virtual void printNumber (StringRef Label, double Value)
 
template<typename T >
void printNumber (StringRef Label, StringRef Str, T Value)
 
virtual void printBoolean (StringRef Label, bool Value)
 
template<typename... T>
void printVersion (StringRef Label, T... Version)
 
template<typename T >
void printList (StringRef Label, const ArrayRef< T > List)
 
virtual void printList (StringRef Label, const ArrayRef< bool > List)
 
virtual void printList (StringRef Label, const ArrayRef< std::string > List)
 
virtual void printList (StringRef Label, const ArrayRef< uint64_t > List)
 
virtual void printList (StringRef Label, const ArrayRef< uint32_t > List)
 
virtual void printList (StringRef Label, const ArrayRef< uint16_t > List)
 
virtual void printList (StringRef Label, const ArrayRef< uint8_t > List)
 
virtual void printList (StringRef Label, const ArrayRef< int64_t > List)
 
virtual void printList (StringRef Label, const ArrayRef< int32_t > List)
 
virtual void printList (StringRef Label, const ArrayRef< int16_t > List)
 
virtual void printList (StringRef Label, const ArrayRef< int8_t > List)
 
virtual void printList (StringRef Label, const ArrayRef< APSInt > List)
 
template<typename T , typename U >
void printList (StringRef Label, const T &List, const U &Printer)
 
template<typename T >
void printHexList (StringRef Label, const T &List)
 
template<typename T >
void printHex (StringRef Label, T Value)
 
template<typename T >
void printHex (StringRef Label, StringRef Str, T Value)
 
template<typename T >
void printSymbolOffset (StringRef Label, StringRef Symbol, T Value)
 
virtual void printString (StringRef Value)
 
virtual void printString (StringRef Label, StringRef Value)
 
void printStringEscaped (StringRef Label, StringRef Value)
 
void printBinary (StringRef Label, StringRef Str, ArrayRef< uint8_t > Value)
 
void printBinary (StringRef Label, StringRef Str, ArrayRef< char > Value)
 
void printBinary (StringRef Label, ArrayRef< uint8_t > Value)
 
void printBinary (StringRef Label, ArrayRef< char > Value)
 
void printBinary (StringRef Label, StringRef Value)
 
void printBinaryBlock (StringRef Label, ArrayRef< uint8_t > Value, uint32_t StartOffset)
 
void printBinaryBlock (StringRef Label, ArrayRef< uint8_t > Value)
 
void printBinaryBlock (StringRef Label, StringRef Value)
 
template<typename T >
void printObject (StringRef Label, const T &Value)
 
virtual void objectBegin ()
 
virtual void objectBegin (StringRef Label)
 
virtual void objectEnd ()
 
virtual void arrayBegin ()
 
virtual void arrayBegin (StringRef Label)
 
virtual void arrayEnd ()
 
virtual raw_ostreamstartLine ()
 
virtual raw_ostreamgetOStream ()
 

Static Public Member Functions

static bool classof (const ScopedPrinter *SP)
 
- Static Public Member Functions inherited from llvm::ScopedPrinter
static bool classof (const ScopedPrinter *SP)
 

Additional Inherited Members

- Public Types inherited from llvm::ScopedPrinter
enum class  ScopedPrinterKind { Base , JSON }
 

Detailed Description

Definition at line 544 of file ScopedPrinter.h.

Constructor & Destructor Documentation

◆ JSONScopedPrinter()

llvm::JSONScopedPrinter::JSONScopedPrinter ( raw_ostream OS,
bool  PrettyPrint = false,
std::unique_ptr< DelimitedScope > &&  OuterScope = std::unique_ptr<DelimitedScope>{} 
)

Definition at line 39 of file ScopedPrinter.cpp.

Member Function Documentation

◆ arrayBegin() [1/2]

void llvm::JSONScopedPrinter::arrayBegin ( )
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 703 of file ScopedPrinter.h.

◆ arrayBegin() [2/2]

void llvm::JSONScopedPrinter::arrayBegin ( StringRef  Label)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 707 of file ScopedPrinter.h.

◆ arrayEnd()

void llvm::JSONScopedPrinter::arrayEnd ( )
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 711 of file ScopedPrinter.h.

◆ classof()

static bool llvm::JSONScopedPrinter::classof ( const ScopedPrinter SP)
inlinestatic

Definition at line 573 of file ScopedPrinter.h.

References llvm::ScopedPrinter::getKind(), and llvm::ScopedPrinter::JSON.

◆ objectBegin() [1/2]

void llvm::JSONScopedPrinter::objectBegin ( )
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 693 of file ScopedPrinter.h.

◆ objectBegin() [2/2]

void llvm::JSONScopedPrinter::objectBegin ( StringRef  Label)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 697 of file ScopedPrinter.h.

◆ objectEnd()

void llvm::JSONScopedPrinter::objectEnd ( )
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 701 of file ScopedPrinter.h.

◆ printBoolean()

void llvm::JSONScopedPrinter::printBoolean ( StringRef  Label,
bool  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 635 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printList() [1/11]

void llvm::JSONScopedPrinter::printList ( StringRef  Label,
const ArrayRef< APSInt List 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 679 of file ScopedPrinter.h.

References llvm::json::OStream::attributeArray(), and llvm::List.

◆ printList() [2/11]

void llvm::JSONScopedPrinter::printList ( StringRef  Label,
const ArrayRef< bool List 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 639 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [3/11]

void llvm::JSONScopedPrinter::printList ( StringRef  Label,
const ArrayRef< int16_t >  List 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 671 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [4/11]

void llvm::JSONScopedPrinter::printList ( StringRef  Label,
const ArrayRef< int32_t >  List 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 667 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [5/11]

void llvm::JSONScopedPrinter::printList ( StringRef  Label,
const ArrayRef< int64_t >  List 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 663 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [6/11]

void llvm::JSONScopedPrinter::printList ( StringRef  Label,
const ArrayRef< int8_t >  List 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 675 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [7/11]

void llvm::JSONScopedPrinter::printList ( StringRef  Label,
const ArrayRef< std::string >  List 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 643 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [8/11]

void llvm::JSONScopedPrinter::printList ( StringRef  Label,
const ArrayRef< uint16_t List 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 655 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [9/11]

void llvm::JSONScopedPrinter::printList ( StringRef  Label,
const ArrayRef< uint32_t List 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 651 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [10/11]

void llvm::JSONScopedPrinter::printList ( StringRef  Label,
const ArrayRef< uint64_t List 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 647 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [11/11]

void llvm::JSONScopedPrinter::printList ( StringRef  Label,
const ArrayRef< uint8_t List 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 659 of file ScopedPrinter.h.

References llvm::List.

◆ printNumber() [1/14]

void llvm::JSONScopedPrinter::printNumber ( StringRef  Label,
char  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 577 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printNumber() [2/14]

void llvm::JSONScopedPrinter::printNumber ( StringRef  Label,
const APSInt Value 
)
inlineoverridevirtual

◆ printNumber() [3/14]

void llvm::JSONScopedPrinter::printNumber ( StringRef  Label,
double  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 625 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printNumber() [4/14]

void llvm::JSONScopedPrinter::printNumber ( StringRef  Label,
float  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 621 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printNumber() [5/14]

void llvm::JSONScopedPrinter::printNumber ( StringRef  Label,
int  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 597 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printNumber() [6/14]

void llvm::JSONScopedPrinter::printNumber ( StringRef  Label,
long long  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 613 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printNumber() [7/14]

void llvm::JSONScopedPrinter::printNumber ( StringRef  Label,
long  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 605 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printNumber() [8/14]

void llvm::JSONScopedPrinter::printNumber ( StringRef  Label,
short  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 589 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printNumber() [9/14]

void llvm::JSONScopedPrinter::printNumber ( StringRef  Label,
signed char  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 581 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printNumber() [10/14]

void llvm::JSONScopedPrinter::printNumber ( StringRef  Label,
unsigned char  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 585 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printNumber() [11/14]

void llvm::JSONScopedPrinter::printNumber ( StringRef  Label,
unsigned int  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 601 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printNumber() [12/14]

void llvm::JSONScopedPrinter::printNumber ( StringRef  Label,
unsigned long long  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 617 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printNumber() [13/14]

void llvm::JSONScopedPrinter::printNumber ( StringRef  Label,
unsigned long  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 609 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printNumber() [14/14]

void llvm::JSONScopedPrinter::printNumber ( StringRef  Label,
unsigned short  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 593 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printString() [1/2]

void llvm::JSONScopedPrinter::printString ( StringRef  Label,
StringRef  Value 
)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 689 of file ScopedPrinter.h.

References llvm::json::OStream::attribute().

◆ printString() [2/2]

void llvm::JSONScopedPrinter::printString ( StringRef  Value)
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 687 of file ScopedPrinter.h.

References llvm::json::OStream::value().


The documentation for this class was generated from the following files: