llvm::buffer_unique_ostream

raw_svector_ostream that owns another stream and buffers until destruction.

Synopsis

Declared in <llvm/Support/raw_ostream.h>

class buffer_unique_ostream
    : public raw_svector_ostream

Base Classes

NameDescription
raw_svector_ostreamA raw_ostream that writes to a SmallVector or SmallString.

Type Aliases

NameDescription
uuid_t Output a formatted UUID with dash separators.

Enums

NameDescription
Colors ANSI terminal color codes.
OStreamKind Discriminator for concrete raw_ostream subclasses.

Member Functions

NameDescription
buffer_unique_ostream [constructor]Own OS and buffer all writes until destruction.
~buffer_unique_ostream [destructor] [virtual]Flush buffered contents into the owned stream.
operator= [deleted]Copy-assignment is deleted.
GetBufferSize Return the size of the current stream buffer, or the preferred size if buffering is enabled but the buffer has not been allocated yet.
GetNumBytesInBuffer Return the number of bytes currently held in the stream buffer.
SetBufferSize Set the stream to be buffered, using the specified buffer size.
SetBuffered Set the stream to be buffered, with an automatically determined buffer size.
SetUnbuffered Set the stream to be unbuffered.
buffer Return a mutable reference to the backing SmallVector.
changeColor [virtual]Changes the foreground color of text that will be output from this point forward.
colors_enabled Return true if ANSI color output is currently enabled.
enable_colors [virtual]Enable or disable ANSI color output for subsequent writes.
flush [deleted]Flushing is unnecessary; the SmallVector is always up to date.
get_kind Return the concrete stream kind discriminator.
has_colors [virtual]This function determines if this stream is displayed and supports colors. The result is unaffected by calls to enable_color().
indent indent - Insert 'NumSpaces' spaces.
is_displayed [virtual]Return true if this stream is connected to a tty or console.
pwrite Write Size bytes from Ptr at absolute stream offset Offset.
reserveExtraSpace [virtual]Reserve capacity so the vector can hold tell() + ExtraSize bytes.
resetColor [virtual]Resets the colors to terminal defaults. Call this when you are done outputting colored text, or before program exit.
reverseColor [virtual]Reverses the foreground and background colors.
str Return a StringRef for the vector contents.
tell tell - Return the current offset with the file.
write write overloads
write_escaped Output Str, turning '', 't', ' ', '"', and anything that doesn't satisfy llvm::isPrint into an escape sequence.
write_hex Output N in hexadecimal, without any prefix or padding.
write_uuid Write UUID UUID to the stream.
write_zeros write_zeros - Insert 'NumZeros' nulls.
operator<< Left shift operators

Static Member Functions

NameDescription
classof Return true if OS is a raw_svector_ostream.

Static Data Members

NameDescription
BLACK Black foreground color constant.
BLUE Blue foreground color constant.
BRIGHT_BLACK Bright black (gray) foreground color constant.
BRIGHT_BLUE Bright blue foreground color constant.
BRIGHT_CYAN Bright cyan foreground color constant.
BRIGHT_GREEN Bright green foreground color constant.
BRIGHT_MAGENTA Bright magenta foreground color constant.
BRIGHT_RED Bright red foreground color constant.
BRIGHT_WHITE Bright white foreground color constant.
BRIGHT_YELLOW Bright yellow foreground color constant.
CYAN Cyan foreground color constant.
GREEN Green foreground color constant.
MAGENTA Magenta foreground color constant.
RED Red foreground color constant.
RESET Reset colors to the terminal default.
SAVEDCOLOR Saved-color constant that preserves the current color.
WHITE White foreground color constant.
YELLOW Yellow foreground color constant.

Protected Member Functions

NameDescription
SetBuffer Use the provided buffer as the raw_ostream buffer.
getBufferStart Return the beginning of the current stream buffer, or 0 if the stream is unbuffered.
preferred_buffer_size [virtual]Return an efficient buffer size for the underlying output mechanism.

Non-Member Functions

NameDescription
CheckBitcodeOutputToConsoleCheck for bitcode output written to a console.
PrintStatisticsPrint statistics to the given output stream.
PrintStatisticsJSONPrint statistics in JSON format. This does include all global timers (
WriteGraphWrite graph G as DOT text to stream O.
convertCtxProfToYamlWrite Profile to OS as YAML.
createBitcodeWriterPassCreate and return a pass that writes the module to the specified ostream. Note that this pass is designed for use with the legacy pass manager.
createMIR2VecPrinterLegacyPassMIR2VecPrinter pass - This pass prints out the MIR2Vec embeddings for machine functions, basic blocks and instructions.
createMIR2VecVocabPrinterLegacyPassMIR2VecVocabPrinter pass - This pass prints out the MIR2Vec vocabulary contents to the given stream as a debugging tool.
createMachineFunctionPrinterPassMachineFunctionPrinter pass - This pass prints out the machine function to the given stream as a debugging tool.
createPrintFunctionPassCreate and return a pass that prints functions to the specified raw_ostream as they are processed.
createPrintMIRPassMIRPrinting pass - this pass prints out the LLVM IR into the given stream using the MIR serialization format.
createPrintModulePassCreate and return a pass that writes the module to the specified raw_ostream.
emitLinkerFlagsForGlobalCOFFEmit COFF linker flags to export or exclude a global.
emitLinkerFlagsForUsedCOFFEmit a COFF /INCLUDE: directive so the linker keeps a global.
operator<<Write DDG edge E to stream OS.
operator<<Debug print ModRefInfo.
operator<<Print FMF to the output stream O.
operator<<Write MD to OS using Metadata::print.
operator<<Print Ensemble En to stream OS.
operator<<Print SlotIndex li to stream os.
operator<<Write Mode to OS via DenormalMode::print.
operator<<Print MI to OS.
operator<<Print Trace Tr to stream OS.
operator<<Write the spelled name of RM to OS.
operator<<Write a human readable form of Mask to OS.
operator<<Print a short description useful for debugging or logging.
operator<<Write indexed reference R to stream OS.
operator<<Print a version number.
operator<<Write a record field to an output stream.
operator<<Print VT to OS.
operator<<Write a formatted object to OS.
operator<<Stream Sym to OS using WasmSymbol::print.
operator<<Print FMP to OS as a human-readable fault map.
operator<<Print VI to OS for debugging.
operator<<An raw_ostream inserter for modules.
operator<<Write subrange SR to stream OS.
operator<<Stream operators for Attributor debug printing.
operator<<Print an IR position to an output stream.
operator<<Write optional value O to OS, or std::nullopt if empty.
operator<<Write data dependence graph G to stream OS.
operator<<Invoke P's print callback on OS and return OS.
operator<<Write a record to an output stream.
operator<<Print MO to OS.
operator<<Write ValMapping to OS.
operator<<Print Marker to OS.
operator<<Print T to OS using its LLVM assembly syntax.
operator<<Write AliasSet AS to stream OS.
operator<<Print I to OS as a signed decimal.
operator<<Print location expression Loc to OS.
operator<<Print R to OS.
operator<<Print Config to OS.
operator<<Print I to OS using its signedness.
operator<<Write virtual register map VRM to stream OS.
operator<<Write a record keeper to an output stream.
operator<<Write InstrMapping to OS.
operator<<Print comparison predicate Pred to OS.
operator<<Write live-range segment S to stream OS.
operator<<Write the live physical registers in LR to OS.
operator<<Print a potential LLVM values state to an output stream.
operator<<Print SCEVPredicate P to OS.
operator<<Write the LiveRangeUpdater X to stream OS.
operator<<Write value-number info VNI to stream OS.
operator<<Print an abstract state to an output stream.
operator<<Write cache cost CC to stream OS.
operator<<Print dominator tree node Node to stream O.
operator<<Print SCEVUse U to OS.
operator<<Print MO to OS.
operator<<Print FFI to OS as a human-readable function fault-info record.
operator<<Print DV to OS.
operator<<Write Ty to OS.
operator<<Print C to OS using its LLVM assembly syntax.
operator<<Print Loop to stream OS.
operator<<Print an AAPointerInfo access description to an output stream.
operator<<Write machine basic block MBB to stream OS.
operator<<Prints X to OS.
operator<<Print machine instruction MI to stream OS.
operator<<Print memprof callsite summary SNI to OS.
operator<<Print Label to OS.
operator<<Write live range R to stream OS.
operator<<Print SCEV S to OS.
operator<<Write PartMapping to OS.
operator<<Debug print MemoryEffects.
operator<<Write DDG edge kind K to stream OS.
operator<<Write OpdMapper to OS.
operator<<Write live interval LI to stream OS.
operator<<Write DDG node N to stream OS.
operator<<Write the raw fixed-point frequency value of Freq to OS.
operator<<Write a PseudoSourceValue to a stream.
operator<<Print allocation summary AE to OS.
operator<<Write Ty to OS.
operator<<Write loop nest LN to stream OS.
operator<<Write a representation of std::nullopt to OS.
operator<<Write a machine constant pool value to a stream.
operator<<Print lattice element Val to stream OS.
operator<<Write UTC time point TP to stream OS.
operator<<Write a textual representation of V to OS.
operator<<Write Indent spaces to OS.
operator<<Print V to OS.
operator<<Print a human-readable description of Info.
operator<<Write RHS to OS.
operator<<Write I to OS.
operator<<Write AliasSetTracker AST to stream OS.
operator<<Print a RegionNode.
operator<<Print X to OS.
operator<<Write DDG node kind K to stream OS.
operator<<Debug print CaptureComponents.
operator<<Print the name of this node's function.
operator<<Stream operator function for FixedOrScalableQuantity.
operator<<Print FI to OS as a human-readable function info record.
operator<<Write a textual representation of error E to stream OS.
operator<<Print a potential constant-int values state to an output stream.
operator<<Print Known to OS.
operator<<Print a short description useful for debugging or logging.
operator<<Write MemoryAccess MA to stream OS.
operator<<Print a change status to an output stream.
operator<<Write AR to OS in a human-readable form.
operator<<Write time point TP to stream OS.
operator<<Print the reserved intervals of Segments to os.
operator<<Print CR to OS.
operator<<Print V to OS.
operator<<Write Size to OS in a human-readable form.
operator<<Print an integer-range state to an output stream.
operator<<Write FPEnv to OS via DenormalFPEnv::print.
operator<<Print the constant range CR to the output stream OS.
operator<<Print address range R to OS (8-byte addresses by default).
operator<<Write Prob to OS.
operator<<Print an integer state to an output stream.
operator<<Print MIB summary MIB to OS.
operator<<Write Value to OS as a hexadecimal number.
operator<<Stream a human-readable representation of FX to OS.
operator<<Print PHI to OS.
operator<<Print Sym to OS without target-specific assembler info.
operator<<Print legalize action Action to stream OS.
operator<<Print an IR-position kind to an output stream.
operator<<Write live range LR to stream OS.
operator<<Print an ILPValue to a raw_ostream.
operator<<Stream a human-readable representation of AR to OS.
operator<<Stream a human-readable representation of R to OS.
operator<<Write RegBank to OS.
operator<<Print V to OS.
printFormattedPipelinePassesPrint Pipeline to OS using the requested Format.
printIRUnitNameForStackTracePrint the name of a Function for inclusion in a stack trace.
printIRUnitNameForStackTracePrint the name of IR for inclusion in a stack trace.
printIRUnitNameForStackTracePrint the name of a Module for inclusion in a stack trace.
printLLVMNameWithoutPrefixPrint out a name of an LLVM value without any prefixes.
printMIRPrint MIR using New Pass Manager (uses FunctionAnalysisManager). If VRM is non-null, the printer will serialize VirtRegMap state (split-from, assigned-phys).
printMIRPrint MIR using Legacy Pass Manager (uses MachineModuleInfo). If VRM is non-null, the printer will serialize VirtRegMap state (split-from, assigned-phys).
printMIRPrint LLVM IR using the MIR serialization format to the given output stream.
printRelativeBlockFreqPrint Freq as a multiple of the entry frequency EntryFreq.
reportAndResetTimingsReport collected pass timings immediately and reset the timers to zero.
timeTraceProfilerWriteWrite profiling data to an output stream.
writeArchiveToStreamWrite an archive directly to an output stream.
write_doubleWrite a floating-point value to a stream.
write_hexWrite a hexadecimal value to a stream.
write_integerWrite a signed long long to a stream.
write_integerWrite an unsigned long to a stream.
write_integerWrite a signed long to a stream.
write_integerWrite an unsigned long long to a stream.
write_integerWrite an unsigned int to a stream.
write_integerWrite a signed int to a stream.
AA::operator<<Print a range to an output stream.
AMDGPU::operator<<Writes TargetID to OS.
DWARFYAML::emitDebugAbbrevEmit the .debug_abbrev section described by DI to OS.
DWARFYAML::emitDebugAddrEmit the .debug_addr section described by DI to OS.
DWARFYAML::emitDebugArangesEmit the .debug_aranges section described by DI to OS.
DWARFYAML::emitDebugGNUPubnamesEmit the .debug_gnu_pubnames section described by DI to OS.
DWARFYAML::emitDebugGNUPubtypesEmit the .debug_gnu_pubtypes section described by DI to OS.
DWARFYAML::emitDebugInfoEmit the .debug_info section described by DI to OS.
DWARFYAML::emitDebugLineEmit the .debug_line section described by DI to OS.
DWARFYAML::emitDebugLoclistsEmit the .debug_loclists section described by DI to OS.
DWARFYAML::emitDebugNamesEmit the .debug_names section described by DI to OS.
DWARFYAML::emitDebugPubnamesEmit the .debug_pubnames section described by DI to OS.
DWARFYAML::emitDebugPubtypesEmit the .debug_pubtypes section described by DI to OS.
DWARFYAML::emitDebugRangesEmit the .debug_ranges section described by DI to OS.
DWARFYAML::emitDebugRnglistsEmit the .debug_rnglists section described by DI to OS.
DWARFYAML::emitDebugStrEmit the .debug_str section described by DI to OS.
DWARFYAML::emitDebugStrOffsetsEmit the .debug_str_offsets section described by DI to OS.
DomTreeBuilder::operator<<Print the block name of BP to stream O.
ELF::encodeCrelEncode a sequence of relocations in ELF CREL format to an output stream.
GVNExpression::operator<<Print E to OS.
IntegerInclusiveIntervalUtils::printIntervalsPrint intervals to output stream.
Intrinsic::printFPClassMaskPrint an immediate floating-point class mask constant.
MachO::operator<<Write the architecture name to an output stream.
MachO::operator<<Write an architecture set to a raw output stream.
MachO::operator<<Write a packed version to an output stream.
MachO::operator<<Write a target to an output stream.
bfi_detail::operator<<Print X to OS.
cas::operator<<Print ID to OS.
cl::printBuildConfigPrint the compiler build configuration to OS.
codeview::operator<<Stream a human-readable representation of Guid to OS.
dwarf::operator<<Print unwind table Rows to OS.
dwarf::operator<<Print register locations RL to OS.
dwarf::operator<<Print unwind row Row to OS.
dwarf::operator<<Print unwind location R to OS.
gsym::dumpDump all strings in a StringTable to a stream with formatted offsets.
gsym::operator<<Stream a human-readable representation of FI to OS.
gsym::operator<<Stream a human-readable representation of R to OS.
gsym::operator<<Stream a human-readable representation of R to OS.
gsym::operator<<Stream a human-readable representation of H to OS.
gsym::operator<<Stream a human-readable representation of LT to OS.
gsym::operator<<Stream a human-readable representation of H to OS.
gsym::operator<<Stream a human-readable representation of LE to OS.
gsym::operator<<Stream a human-readable representation of CSIC to OS.
gsym::operator<<Stream a human-readable representation of CSI to OS.
gsym::operator<<Stream a human-readable representation of R to OS.
ifs::writeIFSToOutputStreamAttempts to write an IFS interface file to a raw_ostream.
jitlink::operator<<Write a description of block B to OS.
jitlink::operator<<Write a description of symbol A to OS.
jitlink::operator<<Write the given symbol lookup flags to an output stream.
jitlink::printEdgePrint a description of edge E in block B to OS.
json::operator<<Serialize V to compact JSON on OS.
lsp::operator<<Print a Position for debugging.
lsp::operator<<Print a Location for debugging.
lsp::operator<<Print a Range for debugging.
lsp::operator<<Print SignatureInformation for debugging.
lsp::operator<<Print a URIForFile for debugging.
lsp::operator<<Print a TextEdit for debugging.
lsp::operator<<Print a MarkupKind for debugging.
lsp::operator<<Print a CompletionItem for debugging.
lsp::operator<<Print an InlayHintKind for debugging.
mca::operator<<Write InstRef IR to stream OS.
nvvm::printEvictPolicyTypePrint an eviction policy immediate to OS.
nvvm::printTMAReductionOpPrint a TMA reduction op immediate to OS.
nvvm::printTcgen05CollectorUsageOpPrint a TCGEN05 collector usage op immediate to OS.
nvvm::printTcgen05MMACollectorBBufferPrint a TCGEN05 MMA collector B-buffer immediate to OS.
nvvm::printTcgen05MMAKindPrint a TCGEN05 MMA kind immediate to OS.
nvvm::printTensormapElemTypePrint a tensormap element type immediate to OS.
nvvm::printTensormapFillModePrint a tensormap fill mode immediate to OS.
nvvm::printTensormapInterleaveLayoutPrint a tensormap interleave layout immediate to OS.
nvvm::printTensormapSwizzleAtomicityPrint a tensormap swizzle atomicity immediate to OS.
nvvm::printTensormapSwizzleModePrint a tensormap swizzle mode immediate to OS.
objcarc::operator<<Print the ARCInstKind Class to stream OS.
object::operator<<Print Addr to OS as a human-readable sectioned address.
orc::operator<<Render a SymbolMap entry.
orc::operator<<Render an array of SymbolStringPtrs.
orc::operator<<Stream the builder configuration from JTMBP to OS.
orc::operator<<Write R to OS as a hexadecimal start/end pair.
orc::operator<<Render a SymbolLookupSet.
orc::operator<<Print a MemDeallocPolicy.
orc::operator<<Print an AllocGroup.
orc::operator<<Dump a SymbolStringPool. Useful for debugging dangling-pointer crashes.
orc::operator<<Print the symbol name of Sym to OS.
orc::operator<<Render a SymbolLookupSet entry.
orc::operator<<Render a SymbolAliasMap.
orc::operator<<Render a JITDylibSearchOrder.
orc::operator<<Print a MemProt as an RWX triple.
orc::operator<<Render a SymbolMap.
orc::operator<<Render a SymbolLookupFlags instance.
orc::operator<<Render a LookupKind.
orc::operator<<Render a SymbolState.
orc::operator<<Render a SymbolDependendeMap.
orc::operator<<Render a SymbolNameSet.
orc::operator<<Write A to OS as a hexadecimal address.
orc::operator<<Render a SymbolDependenceMap entry.
orc::operator<<Render a SymbolNameVector.
orc::operator<<Render a SymbolFlagsMap entry.
orc::operator<<Render a SymbolFlagsMap.
orc::operator<<Render a MaterializationUnit.
orc::operator<<Render JITSymbolFlags.
orc::operator<</ Render a JITDylibLookupFlags instance.
pdb::dumpPDBSourceCompressionWrite the name of a PDB source-compression method to OS.
pdb::dumpSymbolFieldPrint an indented Name Value field on a new line of a symbol dump.
pdb::dumpSymbolIdFieldDump a named symbol-id field, optionally recursing into the referenced symbol.
pdb::operator<<Write the name of a PDB_UdtType enumerator to OS.
pdb::operator<<Write the name of a PDB_SymType enumerator to OS.
pdb::operator<<Write the active payload of a Variant to OS.
pdb::operator<<Write the name of a CodeView thunk ordinal to OS.
pdb::operator<<Write a CPU register name to OS.
pdb::operator<<Write the name of a PDB_DataKind enumerator to OS.
pdb::operator<<Write the name of a PDB_Checksum enumerator to OS.
pdb::operator<<Write the name of a PDB_LocType enumerator to OS.
pdb::operator<<Write the name of a PDB_VariantType enumerator to OS.
pdb::operator<<Write a calling-convention name (e.g. __cdecl) to OS.
pdb::operator<<Write symbol-tag counts from Stats to OS.
pdb::operator<<Write a dotted major.minor.build version string to OS.
pdb::operator<<Write the name of a PDB_BuiltinType enumerator to OS.
pdb::operator<<Write the name of a PDB_MemberAccess enumerator to OS.
pdb::operator<<Write the name of a PDB_Machine enumerator to OS.
pdb::operator<<Write the name of a PDB_Lang enumerator to OS.
rdf::operator<<Write a printed phi-use node to OS.
rdf::operator<<Write a printed definition stack to OS.
rdf::operator<<Write a printed instruction node to OS.
rdf::operator<<Write a printed function node to OS.
rdf::operator<<Write a printed node list to OS.
rdf::operator<<Write a printed node id to OS.
rdf::operator<<Write a printed reference node to OS.
rdf::operator<<Write a printed statement node to OS.
rdf::operator<<Write a printed register aggregate to OS.
rdf::operator<<Write a printed register reference to OS.
rdf::operator<<Write register aggregate A to stream OS.
rdf::operator<<Write a printed node set to OS.
rdf::operator<<Write a printed register set to OS.
rdf::operator<<Write a printed phi node to OS.
rdf::operator<<Write a printed use node to OS.
rdf::operator<<Write short-form lane mask P to stream OS.
rdf::operator<<Write a printed definition node to OS.
rdf::operator<<Write a printed liveness reference map to OS.
rdf::operator<<Write a printed block node to OS.
remarks::operator<<Write remark Remark to OS.
remarks::operator<<Write argument Arg to OS.
remarks::operator<<Write remark location RLoc to OS.
sampleprof::operator<<Print Loc to OS.
sampleprof::operator<<Write Obj to OS as a string or hash code.
sampleprof::operator<<Print Context to OS.
sampleprof::operator<<Print FS to OS.
sampleprof::operator<<Print Sample to OS.
sandboxir::operator<<Write a textual representation of A to OS.
sandboxir::operator<<Write Mask to OS.
sandboxir::operator<<Print Pass to OS.
sandboxir::operator<<Print Tracker to OS.
sandboxir::operator<<Print Rgn to OS.
sandboxir::operator<<Stream-print SandboxIR Value V to OS.
sandboxir::operator<<Write LR to OS.
sandboxir::operator<<Print C to OS.
sandboxir::operator<<Write a textual representation of N to OS.
sandboxir::operator<<Print C to OS.
sys::PrintStackTracePrint the stack trace using the given raw_ostream object.
sys::operator<<Debugging output for Memory::ProtectionFlags.
sys::operator<<Debugging output for MemoryBlock.
sys::printArgPrint a command argument, and optionally quote it.
sys::printDefaultTargetAndDetectedCPUThis is a function compatible with cl::AddExtraVersionPrinter, which adds info about the current target triple and detected CPU.
hlsl::rootsig::dumpRootElementsDump each element of Elements to OS, one per line.
hlsl::rootsig::operator<<Write Descriptor to OS in a human-readable form.
hlsl::rootsig::operator<<Write Element to OS by dispatching on its active variant.
hlsl::rootsig::operator<<Write Table to OS in a human-readable form.
hlsl::rootsig::operator<<Write StaticSampler to OS in a human-readable form.
hlsl::rootsig::operator<<Write Flags to OS in a human-readable form.
hlsl::rootsig::operator<<Write Constants to OS in a human-readable form.
hlsl::rootsig::operator<<Write Clause to OS in a human-readable form.
support::endian::writeWrite a double to os using the given byte order.
support::endian::writeWrite value to os using the given byte order.
support::endian::writeWrite each value in vals to os using the given byte order.
support::endian::writeWrite a float to os using the given byte order.
support::endian::write_arrayWrite each value in values to os using the given byte order.