LLVM  16.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]
Collaboration diagram for llvm::JSONScopedPrinter:
Collaboration 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, uint64_t Value) override
 
void printNumber (StringRef Label, uint32_t Value) override
 
void printNumber (StringRef Label, uint16_t Value) override
 
void printNumber (StringRef Label, uint8_t Value) override
 
void printNumber (StringRef Label, int64_t Value) override
 
void printNumber (StringRef Label, int32_t Value) override
 
void printNumber (StringRef Label, int16_t Value) override
 
void printNumber (StringRef Label, int8_t 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={})
 
template<typename T >
void printFlags (StringRef Label, T Value)
 
template<typename T >
void printNumber (StringRef Label, StringRef Str, T Value)
 
template<typename... T>
void printVersion (StringRef Label, T... Version)
 
template<typename T >
void printList (StringRef Label, const ArrayRef< T > 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)
 
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 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  ScopedPrinterKind { ScopedPrinterKind::Base, ScopedPrinterKind::JSON }
 

Detailed Description

Definition at line 524 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 38 of file ScopedPrinter.cpp.

Member Function Documentation

◆ arrayBegin() [1/2]

void llvm::JSONScopedPrinter::arrayBegin ( )
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 663 of file ScopedPrinter.h.

◆ arrayBegin() [2/2]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 667 of file ScopedPrinter.h.

◆ arrayEnd()

void llvm::JSONScopedPrinter::arrayEnd ( )
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 671 of file ScopedPrinter.h.

◆ classof()

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

Definition at line 553 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 653 of file ScopedPrinter.h.

◆ objectBegin() [2/2]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 657 of file ScopedPrinter.h.

◆ objectEnd()

void llvm::JSONScopedPrinter::objectEnd ( )
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 661 of file ScopedPrinter.h.

◆ printBoolean()

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 595 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 639 of file ScopedPrinter.h.

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

◆ printList() [2/11]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 599 of file ScopedPrinter.h.

References List.

◆ printList() [3/11]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 631 of file ScopedPrinter.h.

References List.

◆ printList() [4/11]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 627 of file ScopedPrinter.h.

References List.

◆ printList() [5/11]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 623 of file ScopedPrinter.h.

References List.

◆ printList() [6/11]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 635 of file ScopedPrinter.h.

References List.

◆ printList() [7/11]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 603 of file ScopedPrinter.h.

References List.

◆ printList() [8/11]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 615 of file ScopedPrinter.h.

References List.

◆ printList() [9/11]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 611 of file ScopedPrinter.h.

References List.

◆ printList() [10/11]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 607 of file ScopedPrinter.h.

References List.

◆ printList() [11/11]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 619 of file ScopedPrinter.h.

References List.

◆ printNumber() [1/9]

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

◆ printNumber() [2/9]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 581 of file ScopedPrinter.h.

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

◆ printNumber() [3/9]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 577 of file ScopedPrinter.h.

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

◆ printNumber() [4/9]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 573 of file ScopedPrinter.h.

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

◆ printNumber() [5/9]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 585 of file ScopedPrinter.h.

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

◆ printNumber() [6/9]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 565 of file ScopedPrinter.h.

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

◆ printNumber() [7/9]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 561 of file ScopedPrinter.h.

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

◆ printNumber() [8/9]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 557 of file ScopedPrinter.h.

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

◆ printNumber() [9/9]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 569 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 649 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 647 of file ScopedPrinter.h.

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


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