LLVM  14.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::ScopedPrinter Class Reference

#include "llvm/Support/ScopedPrinter.h"

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

Public Types

enum  ScopedPrinterKind { ScopedPrinterKind::Base, ScopedPrinterKind::JSON }
 

Public Member Functions

 ScopedPrinter (raw_ostream &OS, ScopedPrinterKind Kind=ScopedPrinterKind::Base)
 
ScopedPrinterKind getKind () const
 
virtual ~ScopedPrinter ()
 
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)
 
virtual void printNumber (StringRef Label, uint64_t Value)
 
virtual void printNumber (StringRef Label, uint32_t Value)
 
virtual void printNumber (StringRef Label, uint16_t Value)
 
virtual void printNumber (StringRef Label, uint8_t Value)
 
virtual void printNumber (StringRef Label, int64_t Value)
 
virtual void printNumber (StringRef Label, int32_t Value)
 
virtual void printNumber (StringRef Label, int16_t Value)
 
virtual void printNumber (StringRef Label, int8_t Value)
 
virtual void printNumber (StringRef Label, const APSInt &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 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)
 

Detailed Description

Definition at line 102 of file ScopedPrinter.h.

Member Enumeration Documentation

◆ ScopedPrinterKind

Enumerator
Base 
JSON 

Definition at line 104 of file ScopedPrinter.h.

Constructor & Destructor Documentation

◆ ScopedPrinter()

llvm::ScopedPrinter::ScopedPrinter ( raw_ostream OS,
ScopedPrinterKind  Kind = ScopedPrinterKind::Base 
)
inline

Definition at line 109 of file ScopedPrinter.h.

◆ ~ScopedPrinter()

virtual llvm::ScopedPrinter::~ScopedPrinter ( )
inlinevirtual

Definition at line 119 of file ScopedPrinter.h.

Member Function Documentation

◆ arrayBegin() [1/2]

virtual void llvm::ScopedPrinter::arrayBegin ( )
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 400 of file ScopedPrinter.h.

Referenced by llvm::ListScope::ListScope(), and llvm::ListScope::setPrinter().

◆ arrayBegin() [2/2]

virtual void llvm::ScopedPrinter::arrayBegin ( StringRef  Label)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 402 of file ScopedPrinter.h.

◆ arrayEnd()

virtual void llvm::ScopedPrinter::arrayEnd ( )
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 404 of file ScopedPrinter.h.

Referenced by llvm::ListScope::~ListScope().

◆ classof()

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

Definition at line 115 of file ScopedPrinter.h.

References Base, and getKind().

◆ flush()

void llvm::ScopedPrinter::flush ( )
inline

Definition at line 121 of file ScopedPrinter.h.

References llvm::raw_ostream::flush().

◆ getIndentLevel()

int llvm::ScopedPrinter::getIndentLevel ( )
inline

Definition at line 131 of file ScopedPrinter.h.

◆ getKind()

ScopedPrinterKind llvm::ScopedPrinter::getKind ( ) const
inline

Definition at line 113 of file ScopedPrinter.h.

Referenced by classof(), and llvm::JSONScopedPrinter::classof().

◆ getOStream()

virtual raw_ostream& llvm::ScopedPrinter::getOStream ( )
inlinevirtual

◆ hex()

template<typename T >
HexNumber llvm::ScopedPrinter::hex ( T  Value)
inline

Definition at line 141 of file ScopedPrinter.h.

Referenced by printFlags(), printHex(), and printSymbolOffset().

◆ indent()

void llvm::ScopedPrinter::indent ( int  Levels = 1)
inline

◆ objectBegin() [1/2]

virtual void llvm::ScopedPrinter::objectBegin ( )
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 394 of file ScopedPrinter.h.

Referenced by llvm::DictScope::DictScope(), and llvm::DictScope::setPrinter().

◆ objectBegin() [2/2]

virtual void llvm::ScopedPrinter::objectBegin ( StringRef  Label)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 396 of file ScopedPrinter.h.

◆ objectEnd()

virtual void llvm::ScopedPrinter::objectEnd ( )
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 398 of file ScopedPrinter.h.

Referenced by llvm::DictScope::~DictScope().

◆ printBinary() [1/5]

void llvm::ScopedPrinter::printBinary ( StringRef  Label,
ArrayRef< char >  Value 
)
inline

Definition at line 363 of file ScopedPrinter.h.

References llvm::makeArrayRef().

◆ printBinary() [2/5]

void llvm::ScopedPrinter::printBinary ( StringRef  Label,
ArrayRef< uint8_t >  Value 
)
inline

Definition at line 359 of file ScopedPrinter.h.

◆ printBinary() [3/5]

void llvm::ScopedPrinter::printBinary ( StringRef  Label,
StringRef  Str,
ArrayRef< char >  Value 
)
inline

Definition at line 353 of file ScopedPrinter.h.

References llvm::makeArrayRef().

◆ printBinary() [4/5]

void llvm::ScopedPrinter::printBinary ( StringRef  Label,
StringRef  Str,
ArrayRef< uint8_t >  Value 
)
inline

Definition at line 349 of file ScopedPrinter.h.

◆ printBinary() [5/5]

void llvm::ScopedPrinter::printBinary ( StringRef  Label,
StringRef  Value 
)
inline

Definition at line 369 of file ScopedPrinter.h.

References llvm::makeArrayRef().

◆ printBinaryBlock() [1/3]

void llvm::ScopedPrinter::printBinaryBlock ( StringRef  Label,
ArrayRef< uint8_t >  Value 
)
inline

Definition at line 380 of file ScopedPrinter.h.

◆ printBinaryBlock() [2/3]

void llvm::ScopedPrinter::printBinaryBlock ( StringRef  Label,
ArrayRef< uint8_t >  Value,
uint32_t  StartOffset 
)
inline

◆ printBinaryBlock() [3/3]

void llvm::ScopedPrinter::printBinaryBlock ( StringRef  Label,
StringRef  Value 
)
inline

Definition at line 384 of file ScopedPrinter.h.

References llvm::makeArrayRef().

◆ printBoolean()

virtual void llvm::ScopedPrinter::printBoolean ( StringRef  Label,
bool  Value 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 244 of file ScopedPrinter.h.

References startLine().

◆ printEnum()

template<typename T , typename TEnum >
void llvm::ScopedPrinter::printEnum ( StringRef  Label,
T  Value,
ArrayRef< EnumEntry< TEnum >>  EnumValues 
)
inline

◆ printFlags() [1/2]

template<typename T >
void llvm::ScopedPrinter::printFlags ( StringRef  Label,
T  Value 
)
inline

Definition at line 190 of file ScopedPrinter.h.

References llvm::SmallVectorImpl< T >::emplace_back(), and hex().

◆ printFlags() [2/2]

template<typename T , typename TFlag >
void llvm::ScopedPrinter::printFlags ( StringRef  Label,
T  Value,
ArrayRef< EnumEntry< TFlag >>  Flags,
TFlag  EnumMask1 = {},
TFlag  EnumMask2 = {},
TFlag  EnumMask3 = {} 
)
inline

Definition at line 163 of file ScopedPrinter.h.

◆ printHex() [1/2]

template<typename T >
void llvm::ScopedPrinter::printHex ( StringRef  Label,
StringRef  Str,
T  Value 
)
inline

Definition at line 334 of file ScopedPrinter.h.

References hex().

◆ printHex() [2/2]

template<typename T >
void llvm::ScopedPrinter::printHex ( StringRef  Label,
T  Value 
)
inline

Definition at line 330 of file ScopedPrinter.h.

References hex().

Referenced by printEnum(), and llvm::codeview::TypeDumpVisitor::visitUnknownMember().

◆ printHexList()

template<typename T >
void llvm::ScopedPrinter::printHexList ( StringRef  Label,
const T List 
)
inline

Definition at line 323 of file ScopedPrinter.h.

References llvm::SmallVectorImpl< T >::emplace_back(), and List.

◆ printIndent()

void llvm::ScopedPrinter::printIndent ( )
inline

Definition at line 135 of file ScopedPrinter.h.

References i.

Referenced by startLine().

◆ printList() [1/13]

virtual void llvm::ScopedPrinter::printList ( StringRef  Label,
const ArrayRef< APSInt List 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 308 of file ScopedPrinter.h.

References List.

◆ printList() [2/13]

virtual void llvm::ScopedPrinter::printList ( StringRef  Label,
const ArrayRef< bool >  List 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 262 of file ScopedPrinter.h.

References List.

◆ printList() [3/13]

virtual void llvm::ScopedPrinter::printList ( StringRef  Label,
const ArrayRef< int16_t >  List 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 297 of file ScopedPrinter.h.

References List.

◆ printList() [4/13]

virtual void llvm::ScopedPrinter::printList ( StringRef  Label,
const ArrayRef< int32_t >  List 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 293 of file ScopedPrinter.h.

References List.

◆ printList() [5/13]

virtual void llvm::ScopedPrinter::printList ( StringRef  Label,
const ArrayRef< int64_t >  List 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 289 of file ScopedPrinter.h.

References List.

◆ printList() [6/13]

virtual void llvm::ScopedPrinter::printList ( StringRef  Label,
const ArrayRef< int8_t >  List 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 301 of file ScopedPrinter.h.

References llvm::SmallVectorImpl< T >::emplace_back(), and List.

◆ printList() [7/13]

virtual void llvm::ScopedPrinter::printList ( StringRef  Label,
const ArrayRef< std::string >  List 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 266 of file ScopedPrinter.h.

References List.

◆ printList() [8/13]

template<typename T >
void llvm::ScopedPrinter::printList ( StringRef  Label,
const ArrayRef< T List 
)
inline

◆ printList() [9/13]

virtual void llvm::ScopedPrinter::printList ( StringRef  Label,
const ArrayRef< uint16_t List 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 278 of file ScopedPrinter.h.

References List.

◆ printList() [10/13]

virtual void llvm::ScopedPrinter::printList ( StringRef  Label,
const ArrayRef< uint32_t List 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 274 of file ScopedPrinter.h.

References List.

◆ printList() [11/13]

virtual void llvm::ScopedPrinter::printList ( StringRef  Label,
const ArrayRef< uint64_t List 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 270 of file ScopedPrinter.h.

References List.

◆ printList() [12/13]

virtual void llvm::ScopedPrinter::printList ( StringRef  Label,
const ArrayRef< uint8_t >  List 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 282 of file ScopedPrinter.h.

References llvm::SmallVectorImpl< T >::emplace_back(), and List.

◆ printList() [13/13]

template<typename T , typename U >
void llvm::ScopedPrinter::printList ( StringRef  Label,
const T List,
const U &  Printer 
)
inline

Definition at line 313 of file ScopedPrinter.h.

References List, llvm::AArch64CC::LS, Printer, and startLine().

◆ printNumber() [1/10]

virtual void llvm::ScopedPrinter::printNumber ( StringRef  Label,
const APSInt Value 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 235 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [2/10]

virtual void llvm::ScopedPrinter::printNumber ( StringRef  Label,
int16_t  Value 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 227 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [3/10]

virtual void llvm::ScopedPrinter::printNumber ( StringRef  Label,
int32_t  Value 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 223 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [4/10]

virtual void llvm::ScopedPrinter::printNumber ( StringRef  Label,
int64_t  Value 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 219 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [5/10]

virtual void llvm::ScopedPrinter::printNumber ( StringRef  Label,
int8_t  Value 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 231 of file ScopedPrinter.h.

References int, and startLine().

◆ printNumber() [6/10]

template<typename T >
void llvm::ScopedPrinter::printNumber ( StringRef  Label,
StringRef  Str,
T  Value 
)
inline

Definition at line 240 of file ScopedPrinter.h.

References llvm::to_string().

◆ printNumber() [7/10]

virtual void llvm::ScopedPrinter::printNumber ( StringRef  Label,
uint16_t  Value 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 211 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [8/10]

virtual void llvm::ScopedPrinter::printNumber ( StringRef  Label,
uint32_t  Value 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 207 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [9/10]

virtual void llvm::ScopedPrinter::printNumber ( StringRef  Label,
uint64_t  Value 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 203 of file ScopedPrinter.h.

References startLine().

Referenced by llvm::codeview::TypeDumpVisitor::visitUnknownType().

◆ printNumber() [10/10]

virtual void llvm::ScopedPrinter::printNumber ( StringRef  Label,
uint8_t  Value 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 215 of file ScopedPrinter.h.

References startLine().

◆ printObject()

template<typename T >
void llvm::ScopedPrinter::printObject ( StringRef  Label,
const T Value 
)
inline

Definition at line 390 of file ScopedPrinter.h.

References printString(), and llvm::to_string().

◆ printString() [1/2]

virtual void llvm::ScopedPrinter::printString ( StringRef  Label,
StringRef  Value 
)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 345 of file ScopedPrinter.h.

References startLine().

◆ printString() [2/2]

virtual void llvm::ScopedPrinter::printString ( StringRef  Value)
inlinevirtual

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 343 of file ScopedPrinter.h.

References startLine().

Referenced by printObject().

◆ printSymbolOffset()

template<typename T >
void llvm::ScopedPrinter::printSymbolOffset ( StringRef  Label,
StringRef  Symbol,
T  Value 
)
inline

Definition at line 339 of file ScopedPrinter.h.

References hex(), and llvm::ARMBuildAttrs::Symbol.

◆ printVersion()

template<typename... T>
void llvm::ScopedPrinter::printVersion ( StringRef  Label,
T...  Version 
)
inline

Definition at line 248 of file ScopedPrinter.h.

References getOStream(), startLine(), T, and Version.

◆ resetIndent()

void llvm::ScopedPrinter::resetIndent ( )
inline

Definition at line 129 of file ScopedPrinter.h.

◆ setPrefix()

void llvm::ScopedPrinter::setPrefix ( StringRef  P)
inline

Definition at line 133 of file ScopedPrinter.h.

References P.

◆ startLine()

virtual raw_ostream& llvm::ScopedPrinter::startLine ( )
inlinevirtual

◆ unindent()

void llvm::ScopedPrinter::unindent ( int  Levels = 1)
inline

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