class MetadataLoader::MetadataLoaderImpl
Declaration
class MetadataLoader::MetadataLoaderImpl { /* full declaration omitted */ };
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:404
Member Variables
- private anonymous struct / union MetadataList
- private llvm::BitcodeReaderValueList& ValueList
- private llvm::BitstreamCursor& Stream
- private llvm::LLVMContext& Context
- private llvm::Module& TheModule
- private std::function<Type*(unsigned int)> getTypeByID
- private llvm::BitstreamCursor IndexCursor
- Cursor associated with the lazy-loading of Metadata. This is the easy way to keep around the right "context" (Abbrev list) to be able to jump in the middle of the metadata block and load any record.
- private std::vector<StringRef> MDStringRef
- Index that keeps track of MDString values.
- private std::vector<uint64_t> GlobalMetadataBitPosIndex
- Index that keeps track of where to find a metadata record in the stream.
- private uint64_t GlobalDeclAttachmentPos = 0
- Cursor position of the start of the global decl attachments, to enable loading using the index built for lazy loading, instead of forward references.
- private unsigned int NumGlobalDeclAttachSkipped = 0
- Baisic correctness check that we end up parsing all of the global decl attachments.
- private unsigned int NumGlobalDeclAttachParsed = 0
- private std::vector<std::pair<DICompileUnit*, Metadata*>> CUSubprograms
- private SmallDenseMap<llvm::Function*, llvm::DISubprogram*, 16> FunctionsWithSPs
- Functions that need to be matched with subprograms when upgrading old metadata.
- private DenseMap<unsigned int, unsigned int> MDKindMap
- private bool StripTBAA = false
- private bool HasSeenOldLoopTags = false
- private bool NeedUpgradeToDIGlobalVariableExpression = false
- private bool NeedDeclareExpressionUpgrade = false
- private bool IsImporting = false
- True if metadata is being parsed for a module being ThinLTO imported.
Method Overview
- public MetadataLoaderImpl(llvm::BitstreamCursor & Stream, llvm::Module & TheModule, llvm::BitcodeReaderValueList & ValueList, std::function<Type *(unsigned int)> getTypeByID, bool IsImporting)
- public llvm::Metadata * getMetadataFwdRefOrLoad(unsigned int ID)
- public bool hasFwdRefs() const
- public bool hasSeenOldLoopTags() const
- public bool isStrippingTBAA() const
- private Expected<bool> lazyLoadModuleMetadataBlock()
- private llvm::MDString * lazyLoadOneMDString(unsigned int Idx)
- private void lazyLoadOneMetadata(unsigned int Idx, (anonymous namespace)::(anonymous namespace)::PlaceholderQueue & Placeholders)
- private Expected<bool> loadGlobalDeclAttachments()
- public llvm::DISubprogram * lookupSubprogramForFunction(llvm::Function * F)
- private llvm::Error parseGlobalObjectAttachment(llvm::GlobalObject & GO, ArrayRef<uint64_t> Record)
- public llvm::Error parseMetadata(bool ModuleLevel)
- public llvm::Error parseMetadataAttachment(llvm::Function & F, ArrayRef<llvm::Instruction *> InstructionList)
- private llvm::Error parseMetadataKindRecord(SmallVectorImpl<uint64_t> & Record)
- public llvm::Error parseMetadataKinds()
- private llvm::Error parseMetadataStrings(ArrayRef<uint64_t> Record, llvm::StringRef Blob, function_ref<void (llvm::StringRef)> CallBack)
- private llvm::Error parseOneMetadata(SmallVectorImpl<uint64_t> & Record, unsigned int Code, (anonymous namespace)::(anonymous namespace)::PlaceholderQueue & Placeholders, llvm::StringRef Blob, unsigned int & NextMetadataNo)
- private void resolveForwardRefsAndPlaceholders((anonymous namespace)::(anonymous namespace)::PlaceholderQueue & Placeholders)
- public void setStripTBAA(bool Value)
- public void shrinkTo(unsigned int N)
- public unsigned int size() const
- private void upgradeCUSubprograms()
- private void upgradeCUVariables()
- private llvm::Error upgradeDIExpression(uint64_t FromVersion, MutableArrayRef<uint64_t> & Expr, SmallVectorImpl<uint64_t> & Buffer)
- private void upgradeDebugInfo()
- public void upgradeDebugIntrinsics(llvm::Function & F)
- private void upgradeDeclareExpressions(llvm::Function & F)
Methods
¶MetadataLoaderImpl(
llvm::BitstreamCursor& Stream,
llvm::Module& TheModule,
llvm::BitcodeReaderValueList& ValueList,
std::function<Type*(unsigned int)>
getTypeByID,
bool IsImporting)
MetadataLoaderImpl(
llvm::BitstreamCursor& Stream,
llvm::Module& TheModule,
llvm::BitcodeReaderValueList& ValueList,
std::function<Type*(unsigned int)>
getTypeByID,
bool IsImporting)
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:632
Parameters
- llvm::BitstreamCursor& Stream
- llvm::Module& TheModule
- llvm::BitcodeReaderValueList& ValueList
- std::function<Type*(unsigned int)> getTypeByID
- bool IsImporting
¶llvm::Metadata* getMetadataFwdRefOrLoad(
unsigned int ID)
llvm::Metadata* getMetadataFwdRefOrLoad(
unsigned int ID)
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:645
Parameters
- unsigned int ID
¶bool hasFwdRefs() const
bool hasFwdRefs() const
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:643
¶bool hasSeenOldLoopTags() const
bool hasSeenOldLoopTags() const
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:665
¶bool isStrippingTBAA() const
bool isStrippingTBAA() const
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:673
¶Expected<bool> lazyLoadModuleMetadataBlock()
Expected<bool> lazyLoadModuleMetadataBlock()
Description
Populate the index above to enable lazily loading of metadata, and load the named metadata as well as the transitively referenced global Metadata.
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:445
¶llvm::MDString* lazyLoadOneMDString(
unsigned int Idx)
llvm::MDString* lazyLoadOneMDString(
unsigned int Idx)
Description
On-demand loading of a single MDString. Requires the index above to be populated.
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:422
Parameters
- unsigned int Idx
¶void lazyLoadOneMetadata(
unsigned int Idx,
(anonymous namespace)::(
anonymous namespace)::PlaceholderQueue&
Placeholders)
void lazyLoadOneMetadata(
unsigned int Idx,
(anonymous namespace)::(
anonymous namespace)::PlaceholderQueue&
Placeholders)
Description
On-demand loading of a single metadata. Requires the index above to be populated.
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:449
Parameters
- unsigned int Idx
- (anonymous namespace)::( anonymous namespace)::PlaceholderQueue& Placeholders
¶Expected<bool> loadGlobalDeclAttachments()
Expected<bool> loadGlobalDeclAttachments()
Description
Load the global decl attachments, using the index built for lazy loading.
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:440
¶llvm::DISubprogram* lookupSubprogramForFunction(
llvm::Function* F)
llvm::DISubprogram* lookupSubprogramForFunction(
llvm::Function* F)
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:661
Parameters
¶llvm::Error parseGlobalObjectAttachment(
llvm::GlobalObject& GO,
ArrayRef<uint64_t> Record)
llvm::Error parseGlobalObjectAttachment(
llvm::GlobalObject& GO,
ArrayRef<uint64_t> Record)
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:475
Parameters
- llvm::GlobalObject& GO
- ArrayRef<uint64_t> Record
¶llvm::Error parseMetadata(bool ModuleLevel)
llvm::Error parseMetadata(bool ModuleLevel)
Description
Parse a METADATA_BLOCK. If ModuleLevel is true then we are parsing module level metadata.
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:641
Parameters
- bool ModuleLevel
¶llvm::Error parseMetadataAttachment(
llvm::Function& F,
ArrayRef<llvm::Instruction*> InstructionList)
llvm::Error parseMetadataAttachment(
llvm::Function& F,
ArrayRef<llvm::Instruction*> InstructionList)
Description
Parse metadata attachments.
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:667
Parameters
- llvm::Function& F
- ArrayRef<llvm::Instruction*> InstructionList
¶llvm::Error parseMetadataKindRecord(
SmallVectorImpl<uint64_t>& Record)
llvm::Error parseMetadataKindRecord(
SmallVectorImpl<uint64_t>& Record)
Description
Parse a single METADATA_KIND record, inserting result in MDKindMap.
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:477
Parameters
- SmallVectorImpl<uint64_t>& Record
¶llvm::Error parseMetadataKinds()
llvm::Error parseMetadataKinds()
Description
Parse the metadata kinds out of the METADATA_KIND_BLOCK.
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:670
¶llvm::Error parseMetadataStrings(
ArrayRef<uint64_t> Record,
llvm::StringRef Blob,
function_ref<void(llvm::StringRef)> CallBack)
llvm::Error parseMetadataStrings(
ArrayRef<uint64_t> Record,
llvm::StringRef Blob,
function_ref<void(llvm::StringRef)> CallBack)
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:473
Parameters
- ArrayRef<uint64_t> Record
- llvm::StringRef Blob
- function_ref<void(llvm::StringRef)> CallBack
¶llvm::Error parseOneMetadata(
SmallVectorImpl<uint64_t>& Record,
unsigned int Code,
(anonymous namespace)::(
anonymous namespace)::PlaceholderQueue&
Placeholders,
llvm::StringRef Blob,
unsigned int& NextMetadataNo)
llvm::Error parseOneMetadata(
SmallVectorImpl<uint64_t>& Record,
unsigned int Code,
(anonymous namespace)::(
anonymous namespace)::PlaceholderQueue&
Placeholders,
llvm::StringRef Blob,
unsigned int& NextMetadataNo)
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:470
Parameters
- SmallVectorImpl<uint64_t>& Record
- unsigned int Code
- (anonymous namespace)::( anonymous namespace)::PlaceholderQueue& Placeholders
- llvm::StringRef Blob
- unsigned int& NextMetadataNo
¶void resolveForwardRefsAndPlaceholders(
(anonymous namespace)::(
anonymous namespace)::PlaceholderQueue&
Placeholders)
void resolveForwardRefsAndPlaceholders(
(anonymous namespace)::(
anonymous namespace)::PlaceholderQueue&
Placeholders)
Description
Ensure that all forward-references and placeholders are resolved. Iteratively lazy-loading metadata on-demand if needed.
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:479
Parameters
- (anonymous namespace)::( anonymous namespace)::PlaceholderQueue& Placeholders
¶void setStripTBAA(bool Value)
void setStripTBAA(bool Value)
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:672
Parameters
- bool Value
¶void shrinkTo(unsigned int N)
void shrinkTo(unsigned int N)
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:676
Parameters
- unsigned int N
¶unsigned int size() const
unsigned int size() const
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:675
¶void upgradeCUSubprograms()
void upgradeCUSubprograms()
Description
Upgrade old-style CU < -> SP pointers to point from SP to CU.
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:482
¶void upgradeCUVariables()
void upgradeCUVariables()
Description
Upgrade old-style bare DIGlobalVariables to DIGlobalVariableExpressions.
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:492
¶llvm::Error upgradeDIExpression(
uint64_t FromVersion,
MutableArrayRef<uint64_t>& Expr,
SmallVectorImpl<uint64_t>& Buffer)
llvm::Error upgradeDIExpression(
uint64_t FromVersion,
MutableArrayRef<uint64_t>& Expr,
SmallVectorImpl<uint64_t>& Buffer)
Description
Upgrade the expression from previous versions.
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:545
Parameters
- uint64_t FromVersion
- MutableArrayRef<uint64_t>& Expr
- SmallVectorImpl<uint64_t>& Buffer
¶void upgradeDebugInfo()
void upgradeDebugInfo()
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:626
¶void upgradeDebugIntrinsics(llvm::Function& F)
void upgradeDebugIntrinsics(llvm::Function& F)
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:677
Parameters
¶void upgradeDeclareExpressions(llvm::Function& F)
void upgradeDeclareExpressions(llvm::Function& F)
Description
Remove a leading DW_OP_deref from DIExpressions in a dbg.declare that describes a function argument.
Declared at: llvm/lib/Bitcode/Reader/MetadataLoader.cpp:527