#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/AssemblyAnnotationWriter.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/Comdat.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DebugProgramInstruction.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalAlias.h"
#include "llvm/IR/GlobalIFunc.h"
#include "llvm/IR/GlobalObject.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/IRPrintingPasses.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ModuleSlotTracker.h"
#include "llvm/IR/ModuleSummaryIndex.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/TypeFinder.h"
#include "llvm/IR/TypedPointerType.h"
#include "llvm/IR/Use.h"
#include "llvm/IR/User.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/AtomicOrdering.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/SaveAndRestore.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <memory>
#include <optional>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
usingnamespacellvm;
AssemblyAnnotationWriter::~AssemblyAnnotationWriter() = default;
OrderMap;
UseListOrderMap;
static const Value *skipMetadataWrapper(const Value *V) { … }
static void orderValue(const Value *V, OrderMap &OM) { … }
static OrderMap orderModule(const Module *M) { … }
static std::vector<unsigned>
predictValueUseListOrder(const Value *V, unsigned ID, const OrderMap &OM) { … }
static UseListOrderMap predictUseListOrder(const Module *M) { … }
static const Module *getModuleFromVal(const Value *V) { … }
static const Module *getModuleFromDPI(const DbgMarker *Marker) { … }
static const Module *getModuleFromDPI(const DbgRecord *DR) { … }
static void PrintCallingConv(unsigned cc, raw_ostream &Out) { … }
enum PrefixType { … };
void llvm::printLLVMNameWithoutPrefix(raw_ostream &OS, StringRef Name) { … }
static void PrintLLVMName(raw_ostream &OS, StringRef Name, PrefixType Prefix) { … }
static void PrintLLVMName(raw_ostream &OS, const Value *V) { … }
static void PrintShuffleMask(raw_ostream &Out, Type *Ty, ArrayRef<int> Mask) { … }
namespace {
class TypePrinting { … };
}
TypeFinder &TypePrinting::getNamedTypes() { … }
std::vector<StructType *> &TypePrinting::getNumberedTypes() { … }
bool TypePrinting::empty() { … }
void TypePrinting::incorporateTypes() { … }
void TypePrinting::print(Type *Ty, raw_ostream &OS) { … }
void TypePrinting::printStructBody(StructType *STy, raw_ostream &OS) { … }
AbstractSlotTrackerStorage::~AbstractSlotTrackerStorage() = default;
namespace llvm {
class SlotTracker : public AbstractSlotTrackerStorage { … };
}
ModuleSlotTracker::ModuleSlotTracker(SlotTracker &Machine, const Module *M,
const Function *F)
: … { … }
ModuleSlotTracker::ModuleSlotTracker(const Module *M,
bool ShouldInitializeAllMetadata)
: … { … }
ModuleSlotTracker::~ModuleSlotTracker() = default;
SlotTracker *ModuleSlotTracker::getMachine() { … }
void ModuleSlotTracker::incorporateFunction(const Function &F) { … }
int ModuleSlotTracker::getLocalSlot(const Value *V) { … }
void ModuleSlotTracker::setProcessHook(
std::function<void(AbstractSlotTrackerStorage *, const Module *, bool)>
Fn) { … }
void ModuleSlotTracker::setProcessHook(
std::function<void(AbstractSlotTrackerStorage *, const Function *, bool)>
Fn) { … }
static SlotTracker *createSlotTracker(const Value *V) { … }
#if 0
#define ST_DEBUG …
#else
#define ST_DEBUG(X) …
#endif
SlotTracker::SlotTracker(const Module *M, bool ShouldInitializeAllMetadata)
: … { … }
SlotTracker::SlotTracker(const Function *F, bool ShouldInitializeAllMetadata)
: … { … }
SlotTracker::SlotTracker(const ModuleSummaryIndex *Index)
: … { … }
inline void SlotTracker::initializeIfNeeded() { … }
int SlotTracker::initializeIndexIfNeeded() { … }
void SlotTracker::processModule() { … }
void SlotTracker::processFunction() { … }
int SlotTracker::processIndex() { … }
void SlotTracker::processGlobalObjectMetadata(const GlobalObject &GO) { … }
void SlotTracker::processFunctionMetadata(const Function &F) { … }
void SlotTracker::processDbgRecordMetadata(const DbgRecord &DR) { … }
void SlotTracker::processInstructionMetadata(const Instruction &I) { … }
void SlotTracker::purgeFunction() { … }
int SlotTracker::getGlobalSlot(const GlobalValue *V) { … }
void SlotTracker::setProcessHook(
std::function<void(AbstractSlotTrackerStorage *, const Module *, bool)>
Fn) { … }
void SlotTracker::setProcessHook(
std::function<void(AbstractSlotTrackerStorage *, const Function *, bool)>
Fn) { … }
void SlotTracker::createMetadataSlot(const MDNode *N) { … }
int SlotTracker::getMetadataSlot(const MDNode *N) { … }
int SlotTracker::getLocalSlot(const Value *V) { … }
int SlotTracker::getAttributeGroupSlot(AttributeSet AS) { … }
int SlotTracker::getModulePathSlot(StringRef Path) { … }
int SlotTracker::getGUIDSlot(GlobalValue::GUID GUID) { … }
int SlotTracker::getTypeIdSlot(StringRef Id) { … }
int SlotTracker::getTypeIdCompatibleVtableSlot(StringRef Id) { … }
void SlotTracker::CreateModuleSlot(const GlobalValue *V) { … }
void SlotTracker::CreateFunctionSlot(const Value *V) { … }
void SlotTracker::CreateMetadataSlot(const MDNode *N) { … }
void SlotTracker::CreateAttributeSetSlot(AttributeSet AS) { … }
void SlotTracker::CreateModulePathSlot(StringRef Path) { … }
void SlotTracker::CreateGUIDSlot(GlobalValue::GUID GUID) { … }
void SlotTracker::CreateTypeIdSlot(StringRef Id) { … }
void SlotTracker::CreateTypeIdCompatibleVtableSlot(StringRef Id) { … }
namespace {
struct AsmWriterContext { … };
}
static void WriteAsOperandInternal(raw_ostream &Out, const Value *V,
AsmWriterContext &WriterCtx);
static void WriteAsOperandInternal(raw_ostream &Out, const Metadata *MD,
AsmWriterContext &WriterCtx,
bool FromValue = false);
static void WriteOptimizationInfo(raw_ostream &Out, const User *U) { … }
static void WriteAPFloatInternal(raw_ostream &Out, const APFloat &APF) { … }
static void WriteConstantInternal(raw_ostream &Out, const Constant *CV,
AsmWriterContext &WriterCtx) { … }
static void writeMDTuple(raw_ostream &Out, const MDTuple *Node,
AsmWriterContext &WriterCtx) { … }
namespace {
struct FieldSeparator { … };
raw_ostream &operator<<(raw_ostream &OS, FieldSeparator &FS) { … }
struct MDFieldPrinter { … };
}
void MDFieldPrinter::printTag(const DINode *N) { … }
void MDFieldPrinter::printMacinfoType(const DIMacroNode *N) { … }
void MDFieldPrinter::printChecksum(
const DIFile::ChecksumInfo<StringRef> &Checksum) { … }
void MDFieldPrinter::printString(StringRef Name, StringRef Value,
bool ShouldSkipEmpty) { … }
static void writeMetadataAsOperand(raw_ostream &Out, const Metadata *MD,
AsmWriterContext &WriterCtx) { … }
void MDFieldPrinter::printMetadata(StringRef Name, const Metadata *MD,
bool ShouldSkipNull) { … }
template <class IntTy>
void MDFieldPrinter::printInt(StringRef Name, IntTy Int, bool ShouldSkipZero) { … }
void MDFieldPrinter::printAPInt(StringRef Name, const APInt &Int,
bool IsUnsigned, bool ShouldSkipZero) { … }
void MDFieldPrinter::printBool(StringRef Name, bool Value,
std::optional<bool> Default) { … }
void MDFieldPrinter::printDIFlags(StringRef Name, DINode::DIFlags Flags) { … }
void MDFieldPrinter::printDISPFlags(StringRef Name,
DISubprogram::DISPFlags Flags) { … }
void MDFieldPrinter::printEmissionKind(StringRef Name,
DICompileUnit::DebugEmissionKind EK) { … }
void MDFieldPrinter::printNameTableKind(StringRef Name,
DICompileUnit::DebugNameTableKind NTK) { … }
template <class IntTy, class Stringifier>
void MDFieldPrinter::printDwarfEnum(StringRef Name, IntTy Value,
Stringifier toString, bool ShouldSkipZero) { … }
static void writeGenericDINode(raw_ostream &Out, const GenericDINode *N,
AsmWriterContext &WriterCtx) { … }
static void writeDILocation(raw_ostream &Out, const DILocation *DL,
AsmWriterContext &WriterCtx) { … }
static void writeDIAssignID(raw_ostream &Out, const DIAssignID *DL,
AsmWriterContext &WriterCtx) { … }
static void writeDISubrange(raw_ostream &Out, const DISubrange *N,
AsmWriterContext &WriterCtx) { … }
static void writeDIGenericSubrange(raw_ostream &Out, const DIGenericSubrange *N,
AsmWriterContext &WriterCtx) { … }
static void writeDIEnumerator(raw_ostream &Out, const DIEnumerator *N,
AsmWriterContext &) { … }
static void writeDIBasicType(raw_ostream &Out, const DIBasicType *N,
AsmWriterContext &) { … }
static void writeDIStringType(raw_ostream &Out, const DIStringType *N,
AsmWriterContext &WriterCtx) { … }
static void writeDIDerivedType(raw_ostream &Out, const DIDerivedType *N,
AsmWriterContext &WriterCtx) { … }
static void writeDICompositeType(raw_ostream &Out, const DICompositeType *N,
AsmWriterContext &WriterCtx) { … }
static void writeDISubroutineType(raw_ostream &Out, const DISubroutineType *N,
AsmWriterContext &WriterCtx) { … }
static void writeDIFile(raw_ostream &Out, const DIFile *N, AsmWriterContext &) { … }
static void writeDICompileUnit(raw_ostream &Out, const DICompileUnit *N,
AsmWriterContext &WriterCtx) { … }
static void writeDISubprogram(raw_ostream &Out, const DISubprogram *N,
AsmWriterContext &WriterCtx) { … }
static void writeDILexicalBlock(raw_ostream &Out, const DILexicalBlock *N,
AsmWriterContext &WriterCtx) { … }
static void writeDILexicalBlockFile(raw_ostream &Out,
const DILexicalBlockFile *N,
AsmWriterContext &WriterCtx) { … }
static void writeDINamespace(raw_ostream &Out, const DINamespace *N,
AsmWriterContext &WriterCtx) { … }
static void writeDICommonBlock(raw_ostream &Out, const DICommonBlock *N,
AsmWriterContext &WriterCtx) { … }
static void writeDIMacro(raw_ostream &Out, const DIMacro *N,
AsmWriterContext &WriterCtx) { … }
static void writeDIMacroFile(raw_ostream &Out, const DIMacroFile *N,
AsmWriterContext &WriterCtx) { … }
static void writeDIModule(raw_ostream &Out, const DIModule *N,
AsmWriterContext &WriterCtx) { … }
static void writeDITemplateTypeParameter(raw_ostream &Out,
const DITemplateTypeParameter *N,
AsmWriterContext &WriterCtx) { … }
static void writeDITemplateValueParameter(raw_ostream &Out,
const DITemplateValueParameter *N,
AsmWriterContext &WriterCtx) { … }
static void writeDIGlobalVariable(raw_ostream &Out, const DIGlobalVariable *N,
AsmWriterContext &WriterCtx) { … }
static void writeDILocalVariable(raw_ostream &Out, const DILocalVariable *N,
AsmWriterContext &WriterCtx) { … }
static void writeDILabel(raw_ostream &Out, const DILabel *N,
AsmWriterContext &WriterCtx) { … }
static void writeDIExpression(raw_ostream &Out, const DIExpression *N,
AsmWriterContext &WriterCtx) { … }
static void writeDIArgList(raw_ostream &Out, const DIArgList *N,
AsmWriterContext &WriterCtx,
bool FromValue = false) { … }
static void writeDIGlobalVariableExpression(raw_ostream &Out,
const DIGlobalVariableExpression *N,
AsmWriterContext &WriterCtx) { … }
static void writeDIObjCProperty(raw_ostream &Out, const DIObjCProperty *N,
AsmWriterContext &WriterCtx) { … }
static void writeDIImportedEntity(raw_ostream &Out, const DIImportedEntity *N,
AsmWriterContext &WriterCtx) { … }
static void WriteMDNodeBodyInternal(raw_ostream &Out, const MDNode *Node,
AsmWriterContext &Ctx) { … }
static void WriteAsOperandInternal(raw_ostream &Out, const Value *V,
AsmWriterContext &WriterCtx) { … }
static void WriteAsOperandInternal(raw_ostream &Out, const Metadata *MD,
AsmWriterContext &WriterCtx,
bool FromValue) { … }
namespace {
class AssemblyWriter { … };
}
AssemblyWriter::AssemblyWriter(formatted_raw_ostream &o, SlotTracker &Mac,
const Module *M, AssemblyAnnotationWriter *AAW,
bool IsForDebug, bool ShouldPreserveUseListOrder)
: … { … }
AssemblyWriter::AssemblyWriter(formatted_raw_ostream &o, SlotTracker &Mac,
const ModuleSummaryIndex *Index, bool IsForDebug)
: … { … }
void AssemblyWriter::writeOperand(const Value *Operand, bool PrintType) { … }
void AssemblyWriter::writeSyncScope(const LLVMContext &Context,
SyncScope::ID SSID) { … }
void AssemblyWriter::writeAtomic(const LLVMContext &Context,
AtomicOrdering Ordering,
SyncScope::ID SSID) { … }
void AssemblyWriter::writeAtomicCmpXchg(const LLVMContext &Context,
AtomicOrdering SuccessOrdering,
AtomicOrdering FailureOrdering,
SyncScope::ID SSID) { … }
void AssemblyWriter::writeParamOperand(const Value *Operand,
AttributeSet Attrs) { … }
void AssemblyWriter::writeOperandBundles(const CallBase *Call) { … }
void AssemblyWriter::printModule(const Module *M) { … }
void AssemblyWriter::printModuleSummaryIndex() { … }
static const char *
getWholeProgDevirtResKindName(WholeProgramDevirtResolution::Kind K) { … }
static const char *getWholeProgDevirtResByArgKindName(
WholeProgramDevirtResolution::ByArg::Kind K) { … }
static const char *getTTResKindName(TypeTestResolution::Kind K) { … }
void AssemblyWriter::printTypeTestResolution(const TypeTestResolution &TTRes) { … }
void AssemblyWriter::printTypeIdSummary(const TypeIdSummary &TIS) { … }
void AssemblyWriter::printTypeIdCompatibleVtableSummary(
const TypeIdCompatibleVtableInfo &TI) { … }
void AssemblyWriter::printArgs(const std::vector<uint64_t> &Args) { … }
void AssemblyWriter::printWPDRes(const WholeProgramDevirtResolution &WPDRes) { … }
static const char *getSummaryKindName(GlobalValueSummary::SummaryKind SK) { … }
void AssemblyWriter::printAliasSummary(const AliasSummary *AS) { … }
void AssemblyWriter::printGlobalVarSummary(const GlobalVarSummary *GS) { … }
static std::string getLinkageName(GlobalValue::LinkageTypes LT) { … }
static std::string getLinkageNameWithSpace(GlobalValue::LinkageTypes LT) { … }
static const char *getVisibilityName(GlobalValue::VisibilityTypes Vis) { … }
static const char *getImportTypeName(GlobalValueSummary::ImportKind IK) { … }
void AssemblyWriter::printFunctionSummary(const FunctionSummary *FS) { … }
void AssemblyWriter::printTypeIdInfo(
const FunctionSummary::TypeIdInfo &TIDInfo) { … }
void AssemblyWriter::printVFuncId(const FunctionSummary::VFuncId VFId) { … }
void AssemblyWriter::printNonConstVCalls(
const std::vector<FunctionSummary::VFuncId> &VCallList, const char *Tag) { … }
void AssemblyWriter::printConstVCalls(
const std::vector<FunctionSummary::ConstVCall> &VCallList,
const char *Tag) { … }
void AssemblyWriter::printSummary(const GlobalValueSummary &Summary) { … }
void AssemblyWriter::printSummaryInfo(unsigned Slot, const ValueInfo &VI) { … }
static void printMetadataIdentifier(StringRef Name,
formatted_raw_ostream &Out) { … }
void AssemblyWriter::printNamedMDNode(const NamedMDNode *NMD) { … }
static void PrintVisibility(GlobalValue::VisibilityTypes Vis,
formatted_raw_ostream &Out) { … }
static void PrintDSOLocation(const GlobalValue &GV,
formatted_raw_ostream &Out) { … }
static void PrintDLLStorageClass(GlobalValue::DLLStorageClassTypes SCT,
formatted_raw_ostream &Out) { … }
static void PrintThreadLocalModel(GlobalVariable::ThreadLocalMode TLM,
formatted_raw_ostream &Out) { … }
static StringRef getUnnamedAddrEncoding(GlobalVariable::UnnamedAddr UA) { … }
static void maybePrintComdat(formatted_raw_ostream &Out,
const GlobalObject &GO) { … }
void AssemblyWriter::printGlobal(const GlobalVariable *GV) { … }
void AssemblyWriter::printAlias(const GlobalAlias *GA) { … }
void AssemblyWriter::printIFunc(const GlobalIFunc *GI) { … }
void AssemblyWriter::printComdat(const Comdat *C) { … }
void AssemblyWriter::printTypeIdentities() { … }
void AssemblyWriter::printFunction(const Function *F) { … }
void AssemblyWriter::printArgument(const Argument *Arg, AttributeSet Attrs) { … }
void AssemblyWriter::printBasicBlock(const BasicBlock *BB) { … }
void AssemblyWriter::printInstructionLine(const Instruction &I) { … }
void AssemblyWriter::printGCRelocateComment(const GCRelocateInst &Relocate) { … }
void AssemblyWriter::printInfoComment(const Value &V) { … }
static void maybePrintCallAddrSpace(const Value *Operand, const Instruction *I,
raw_ostream &Out) { … }
void AssemblyWriter::printInstruction(const Instruction &I) { … }
void AssemblyWriter::printDbgMarker(const DbgMarker &Marker) { … }
void AssemblyWriter::printDbgRecord(const DbgRecord &DR) { … }
void AssemblyWriter::printDbgVariableRecord(const DbgVariableRecord &DVR) { … }
void AssemblyWriter::printDbgRecordLine(const DbgRecord &DR) { … }
void AssemblyWriter::printDbgLabelRecord(const DbgLabelRecord &Label) { … }
void AssemblyWriter::printMetadataAttachments(
const SmallVectorImpl<std::pair<unsigned, MDNode *>> &MDs,
StringRef Separator) { … }
void AssemblyWriter::writeMDNode(unsigned Slot, const MDNode *Node) { … }
void AssemblyWriter::writeAllMDNodes() { … }
void AssemblyWriter::printMDNodeBody(const MDNode *Node) { … }
void AssemblyWriter::writeAttribute(const Attribute &Attr, bool InAttrGroup) { … }
void AssemblyWriter::writeAttributeSet(const AttributeSet &AttrSet,
bool InAttrGroup) { … }
void AssemblyWriter::writeAllAttributeGroups() { … }
void AssemblyWriter::printUseListOrder(const Value *V,
const std::vector<unsigned> &Shuffle) { … }
void AssemblyWriter::printUseLists(const Function *F) { … }
void Function::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW,
bool ShouldPreserveUseListOrder,
bool IsForDebug) const { … }
void BasicBlock::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW,
bool ShouldPreserveUseListOrder,
bool IsForDebug) const { … }
void Module::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW,
bool ShouldPreserveUseListOrder, bool IsForDebug) const { … }
void NamedMDNode::print(raw_ostream &ROS, bool IsForDebug) const { … }
void NamedMDNode::print(raw_ostream &ROS, ModuleSlotTracker &MST,
bool IsForDebug) const { … }
void Comdat::print(raw_ostream &ROS, bool ) const { … }
void Type::print(raw_ostream &OS, bool , bool NoDetails) const { … }
static bool isReferencingMDNode(const Instruction &I) { … }
void DbgMarker::print(raw_ostream &ROS, bool IsForDebug) const { … }
void DbgVariableRecord::print(raw_ostream &ROS, bool IsForDebug) const { … }
void DbgMarker::print(raw_ostream &ROS, ModuleSlotTracker &MST,
bool IsForDebug) const { … }
void DbgLabelRecord::print(raw_ostream &ROS, bool IsForDebug) const { … }
void DbgVariableRecord::print(raw_ostream &ROS, ModuleSlotTracker &MST,
bool IsForDebug) const { … }
void DbgLabelRecord::print(raw_ostream &ROS, ModuleSlotTracker &MST,
bool IsForDebug) const { … }
void Value::print(raw_ostream &ROS, bool IsForDebug) const { … }
void Value::print(raw_ostream &ROS, ModuleSlotTracker &MST,
bool IsForDebug) const { … }
static bool printWithoutType(const Value &V, raw_ostream &O,
SlotTracker *Machine, const Module *M) { … }
static void printAsOperandImpl(const Value &V, raw_ostream &O, bool PrintType,
ModuleSlotTracker &MST) { … }
void Value::printAsOperand(raw_ostream &O, bool PrintType,
const Module *M) const { … }
void Value::printAsOperand(raw_ostream &O, bool PrintType,
ModuleSlotTracker &MST) const { … }
static void printMetadataImplRec(raw_ostream &ROS, const Metadata &MD,
AsmWriterContext &WriterCtx) { … }
namespace {
struct MDTreeAsmWriterContext : public AsmWriterContext { … };
}
static void printMetadataImpl(raw_ostream &ROS, const Metadata &MD,
ModuleSlotTracker &MST, const Module *M,
bool OnlyAsOperand, bool PrintAsTree = false) { … }
void Metadata::printAsOperand(raw_ostream &OS, const Module *M) const { … }
void Metadata::printAsOperand(raw_ostream &OS, ModuleSlotTracker &MST,
const Module *M) const { … }
void Metadata::print(raw_ostream &OS, const Module *M,
bool ) const { … }
void Metadata::print(raw_ostream &OS, ModuleSlotTracker &MST,
const Module *M, bool ) const { … }
void MDNode::printTree(raw_ostream &OS, const Module *M) const { … }
void MDNode::printTree(raw_ostream &OS, ModuleSlotTracker &MST,
const Module *M) const { … }
void ModuleSummaryIndex::print(raw_ostream &ROS, bool IsForDebug) const { … }
void ModuleSlotTracker::collectMDNodes(MachineMDNodeListType &L, unsigned LB,
unsigned UB) const { … }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD
void Value::dump() const { print(dbgs(), true); dbgs() << '\n'; }
LLVM_DUMP_METHOD
void DbgMarker::dump() const {
print(dbgs(), true);
dbgs() << '\n';
}
LLVM_DUMP_METHOD
void DbgRecord::dump() const { print(dbgs(), true); dbgs() << '\n'; }
LLVM_DUMP_METHOD
void Type::dump() const { print(dbgs(), true); dbgs() << '\n'; }
LLVM_DUMP_METHOD
void Module::dump() const {
print(dbgs(), nullptr,
false, true);
}
LLVM_DUMP_METHOD
void Comdat::dump() const { print(dbgs(), true); }
LLVM_DUMP_METHOD
void NamedMDNode::dump() const { print(dbgs(), true); }
LLVM_DUMP_METHOD
void Metadata::dump() const { dump(nullptr); }
LLVM_DUMP_METHOD
void Metadata::dump(const Module *M) const {
print(dbgs(), M, true);
dbgs() << '\n';
}
LLVM_DUMP_METHOD
void MDNode::dumpTree() const { dumpTree(nullptr); }
LLVM_DUMP_METHOD
void MDNode::dumpTree(const Module *M) const {
printTree(dbgs(), M);
dbgs() << '\n';
}
LLVM_DUMP_METHOD
void ModuleSummaryIndex::dump() const { print(dbgs(), true); }
#endif