LLVM  15.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 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 515 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 45 of file ScopedPrinter.cpp.

Member Function Documentation

◆ arrayBegin() [1/2]

void llvm::JSONScopedPrinter::arrayBegin ( )
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 654 of file ScopedPrinter.h.

◆ arrayBegin() [2/2]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 658 of file ScopedPrinter.h.

◆ arrayEnd()

void llvm::JSONScopedPrinter::arrayEnd ( )
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 662 of file ScopedPrinter.h.

◆ classof()

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

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

◆ objectBegin() [2/2]

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 648 of file ScopedPrinter.h.

◆ objectEnd()

void llvm::JSONScopedPrinter::objectEnd ( )
inlineoverridevirtual

Reimplemented from llvm::ScopedPrinter.

Definition at line 652 of file ScopedPrinter.h.

◆ printBoolean()

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

Reimplemented from llvm::ScopedPrinter.

Definition at line 586 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 630 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 590 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 622 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 618 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 614 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 626 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 594 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 606 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 602 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 598 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 610 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 572 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 568 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 564 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 576 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 556 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 552 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 548 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 560 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 640 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 638 of file ScopedPrinter.h.

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


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