LLVM 23.0.0git
llvm::ScopedPrinter Class Reference

#include "llvm/Support/ScopedPrinter.h"

Inheritance diagram for llvm::ScopedPrinter:
[legend]

Public Types

enum class  ScopedPrinterKind { Base , JSON }

Public Member Functions

 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, unsigned NumStrs>
void printEnum (StringRef Label, T Value, EnumStrings< TEnum, NumStrs > EnumValues)
template<typename T, typename TFlag, unsigned NumStrs>
void printFlags (StringRef Label, T Value, EnumStrings< TFlag, NumStrs > Flags, TFlag EnumMask1={}, TFlag EnumMask2={}, TFlag EnumMask3={}, ArrayRef< FlagEntry > ExtraFlags={})
template<typename T>
void printFlags (StringRef Label, T Value, SmallVectorImpl< FlagEntry > &SetFlags)
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, typename... TArgs>
void printVersion (StringRef Label, T MajorVersion, TArgs... MinorVersions)
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)

Detailed Description

Definition at line 87 of file ScopedPrinter.h.

Member Enumeration Documentation

◆ ScopedPrinterKind

Enumerator
Base 
JSON 

Definition at line 89 of file ScopedPrinter.h.

Constructor & Destructor Documentation

◆ ScopedPrinter()

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

◆ ~ScopedPrinter()

virtual llvm::ScopedPrinter::~ScopedPrinter ( )
virtualdefault

Member Function Documentation

◆ arrayBegin() [1/2]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 408 of file ScopedPrinter.h.

◆ arrayBegin() [2/2]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 410 of file ScopedPrinter.h.

◆ arrayEnd()

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 412 of file ScopedPrinter.h.

◆ classof()

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

Definition at line 100 of file ScopedPrinter.h.

References Base, and ScopedPrinter().

◆ flush()

void llvm::ScopedPrinter::flush ( )
inline

Definition at line 106 of file ScopedPrinter.h.

◆ getIndentLevel()

int llvm::ScopedPrinter::getIndentLevel ( )
inline

Definition at line 116 of file ScopedPrinter.h.

◆ getKind()

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

Definition at line 98 of file ScopedPrinter.h.

◆ getOStream()

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

Definition at line 419 of file ScopedPrinter.h.

Referenced by printVersion().

◆ hex()

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

Definition at line 126 of file ScopedPrinter.h.

References T.

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

◆ indent()

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

Definition at line 108 of file ScopedPrinter.h.

◆ objectBegin() [1/2]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 402 of file ScopedPrinter.h.

◆ objectBegin() [2/2]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 404 of file ScopedPrinter.h.

◆ objectEnd()

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 406 of file ScopedPrinter.h.

◆ printBinary() [1/5]

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

Definition at line 371 of file ScopedPrinter.h.

◆ printBinary() [2/5]

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

Definition at line 367 of file ScopedPrinter.h.

◆ printBinary() [3/5]

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

Definition at line 361 of file ScopedPrinter.h.

◆ printBinary() [4/5]

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

Definition at line 357 of file ScopedPrinter.h.

◆ printBinary() [5/5]

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

Definition at line 377 of file ScopedPrinter.h.

◆ printBinaryBlock() [1/3]

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

Definition at line 388 of file ScopedPrinter.h.

◆ printBinaryBlock() [2/3]

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

Definition at line 383 of file ScopedPrinter.h.

◆ printBinaryBlock() [3/3]

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

Definition at line 392 of file ScopedPrinter.h.

◆ printBoolean()

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 246 of file ScopedPrinter.h.

References startLine().

◆ printEnum()

template<typename T, typename TEnum, unsigned NumStrs>
void llvm::ScopedPrinter::printEnum ( StringRef Label,
T Value,
EnumStrings< TEnum, NumStrs > EnumValues )
inline

Definition at line 129 of file ScopedPrinter.h.

References printHex(), T, and llvm::EnumStrings< T, NumStrs >::toString().

◆ printFlags() [1/3]

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

Definition at line 172 of file ScopedPrinter.h.

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

◆ printFlags() [2/3]

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

Definition at line 138 of file ScopedPrinter.h.

References T.

◆ printFlags() [3/3]

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

Definition at line 166 of file ScopedPrinter.h.

References hex(), llvm::sort(), and T.

◆ printHex() [1/2]

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

Definition at line 338 of file ScopedPrinter.h.

References hex(), and T.

◆ printHex() [2/2]

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

Definition at line 334 of file ScopedPrinter.h.

References hex(), and T.

Referenced by printEnum(), and llvm::ScopedPrinter::printHex< support::ulittle16_t >().

◆ printHexList()

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

Definition at line 327 of file ScopedPrinter.h.

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

◆ printIndent()

void llvm::ScopedPrinter::printIndent ( )
inline

Definition at line 120 of file ScopedPrinter.h.

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 312 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [2/13]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 266 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [3/13]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 301 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [4/13]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 297 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [5/13]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 293 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [6/13]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 305 of file ScopedPrinter.h.

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

◆ printList() [7/13]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 270 of file ScopedPrinter.h.

References llvm::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 282 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [10/13]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 278 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [11/13]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 274 of file ScopedPrinter.h.

References llvm::List.

◆ printList() [12/13]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 286 of file ScopedPrinter.h.

References llvm::SmallVectorImpl< T >::emplace_back(), and llvm::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 317 of file ScopedPrinter.h.

References llvm::List, Printer, startLine(), and T.

◆ printNumber() [1/15]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 185 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [2/15]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 229 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [3/15]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 237 of file ScopedPrinter.h.

References llvm::format(), and startLine().

◆ printNumber() [4/15]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 233 of file ScopedPrinter.h.

References llvm::format(), and startLine().

◆ printNumber() [5/15]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 205 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [6/15]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 221 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [7/15]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 213 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [8/15]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 197 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [9/15]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 189 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [10/15]

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

Definition at line 242 of file ScopedPrinter.h.

References T, and llvm::to_string().

◆ printNumber() [11/15]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 193 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [12/15]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 209 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [13/15]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 225 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [14/15]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 217 of file ScopedPrinter.h.

References startLine().

◆ printNumber() [15/15]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 201 of file ScopedPrinter.h.

References startLine().

◆ printObject()

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

Definition at line 398 of file ScopedPrinter.h.

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

◆ printString() [1/2]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 349 of file ScopedPrinter.h.

References startLine().

◆ printString() [2/2]

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

Reimplemented in llvm::JSONScopedPrinter.

Definition at line 347 of file ScopedPrinter.h.

References startLine().

Referenced by printObject().

◆ printStringEscaped()

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

Definition at line 353 of file ScopedPrinter.h.

◆ printSymbolOffset()

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

Definition at line 343 of file ScopedPrinter.h.

References hex(), and T.

◆ printVersion()

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

Definition at line 251 of file ScopedPrinter.h.

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

◆ resetIndent()

void llvm::ScopedPrinter::resetIndent ( )
inline

Definition at line 114 of file ScopedPrinter.h.

◆ setPrefix()

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

Definition at line 118 of file ScopedPrinter.h.

References P.

◆ startLine()

◆ unindent()

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

Definition at line 110 of file ScopedPrinter.h.


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