class CompileUnit
Declaration
class CompileUnit { /* full declaration omitted */ };
Description
Stores all information relating to a compile unit, be it in its original instance in the object file to its brand new cloned and generated DIE tree.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:47
Member Variables
- private llvm::DWARFUnit& OrigUnit
- private unsigned int ID
- private std::vector<DIEInfo> Info
- DIE info indexed by DIE index.
- private Optional<llvm::BasicDIEUnit> NewUnit
- private llvm::MCSymbol* LabelBegin = nullptr
- private uint64_t StartOffset
- private uint64_t NextUnitOffset
- private uint64_t LowPc = std::numeric_limits<unsigned long>::max()
- private uint64_t HighPc = 0
- private std::vector<std::tuple<DIE*, const CompileUnit*, DeclContext*, PatchLocation>> ForwardDIEReferences
- The offsets for the attributes in this array couldn't be set while cloning because for cross-cu forward references the target DIE's offset isn't known you emit the reference attribute.
- private llvm::RangesTy Ranges
- The ranges in that map are the PC ranges for functions in this unit, associated with the PC offset to apply to the addresses to get the linked address.
- private SmallDenseMap<uint64_t, uint64_t, 1> Labels
- The DW_AT_low_pc of each DW_TAG_label.
- private std::vector<PatchLocation> RangeAttributes
- DW_AT_ranges attributes to patch after we have gathered all the unit's function addresses. @ {
- private Optional<llvm::PatchLocation> UnitRangeAttribute
- private std::vector<std::pair<PatchLocation, int64_t>> LocationAttributes
- Location attributes that need to be transferred from the original debug_loc section to the liked one. They are stored along with the PC offset that is to be applied to their function's address.
- private std::vector<AccelInfo> Pubnames
- Accelerator entries for the unit, both for the pub* sections and the apple* ones. @ {
- private std::vector<AccelInfo> Pubtypes
- private std::vector<AccelInfo> Namespaces
- private std::vector<AccelInfo> ObjC
- private bool HasODR
- Is this unit subject to the ODR rule?
- private uint16_t Language = 0
- The DW_AT_language of this unit.
- private std::string SysRoot
- The DW_AT_LLVM_sysroot of this unit.
- private std::string ClangModuleName
- If this is a Clang module, this holds the module's name.
Method Overview
- public CompileUnit(llvm::DWARFUnit & OrigUnit, unsigned int ID, bool CanUseODR, llvm::StringRef ClangModuleName)
- public void addFunctionRange(uint64_t LowPC, uint64_t HighPC, int64_t PCOffset)
- public void addLabelLowPc(uint64_t LabelLowPc, int64_t PcOffset)
- public void addNameAccelerator(const llvm::DIE * Die, llvm::DwarfStringPoolEntryRef Name, bool SkipPubnamesSection = false)
- public void addNamespaceAccelerator(const llvm::DIE * Die, llvm::DwarfStringPoolEntryRef Name)
- public void addObjCAccelerator(const llvm::DIE * Die, llvm::DwarfStringPoolEntryRef Name, bool SkipPubnamesSection = false)
- public void addTypeAccelerator(const llvm::DIE * Die, llvm::DwarfStringPoolEntryRef Name, bool ObjcClassImplementation, uint32_t QualifiedNameHash)
- public uint64_t computeNextUnitOffset(uint16_t DwarfVersion)
- public void createOutputDIE()
- public void fixupForwardReferences()
- public const std::string & getClangModuleName() const
- public const llvm::RangesTy & getFunctionRanges() const
- public uint64_t getHighPc() const
- public llvm::CompileUnit::DIEInfo & getInfo(unsigned int Idx)
- public const llvm::CompileUnit::DIEInfo & getInfo(unsigned int Idx) const
- public llvm::CompileUnit::DIEInfo & getInfo(const llvm::DWARFDie & Die)
- public llvm::MCSymbol * getLabelBegin()
- public uint16_t getLanguage()
- public const std::vector<std::pair<PatchLocation, int64_t>> & getLocationAttributes() const
- public uint64_t getLowPc() const
- public const std::vector<AccelInfo> & getNamespaces() const
- public uint64_t getNextUnitOffset() const
- public const std::vector<AccelInfo> & getObjC() const
- public llvm::DWARFUnit & getOrigUnit() const
- public llvm::DIE * getOutputUnitDIE() const
- public const std::vector<AccelInfo> & getPubnames() const
- public const std::vector<AccelInfo> & getPubtypes() const
- public const std::vector<PatchLocation> & getRangesAttributes() const
- public uint64_t getStartOffset() const
- public llvm::StringRef getSysRoot()
- public unsigned int getUniqueID() const
- public Optional<llvm::PatchLocation> getUnitRangesAttribute() const
- public bool hasLabelAt(uint64_t Addr) const
- public bool hasODR() const
- public bool isClangModule() const
- public void markEverythingAsKept()
- public void noteForwardReference(llvm::DIE * Die, const llvm::CompileUnit * RefUnit, llvm::DeclContext * Ctxt, llvm::PatchLocation Attr)
- public void noteLocationAttribute(llvm::PatchLocation Attr, int64_t PcOffset)
- public void noteRangeAttribute(const llvm::DIE & Die, llvm::PatchLocation Attr)
- public void setLabelBegin(llvm::MCSymbol * S)
- public void setStartOffset(uint64_t DebugInfoSize)
Methods
¶CompileUnit(llvm::DWARFUnit& OrigUnit,
unsigned int ID,
bool CanUseODR,
llvm::StringRef ClangModuleName)
CompileUnit(llvm::DWARFUnit& OrigUnit,
unsigned int ID,
bool CanUseODR,
llvm::StringRef ClangModuleName)
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:82
Parameters
- llvm::DWARFUnit& OrigUnit
- unsigned int ID
- bool CanUseODR
- llvm::StringRef ClangModuleName
¶void addFunctionRange(uint64_t LowPC,
uint64_t HighPC,
int64_t PCOffset)
void addFunctionRange(uint64_t LowPC,
uint64_t HighPC,
int64_t PCOffset)
Description
Add a function range [\p LowPC, \p HighPC) that is relocated by applying offset \p PCOffset.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:179
Parameters
- uint64_t LowPC
- uint64_t HighPC
- int64_t PCOffset
¶void addLabelLowPc(uint64_t LabelLowPc,
int64_t PcOffset)
void addLabelLowPc(uint64_t LabelLowPc,
int64_t PcOffset)
Description
Add the low_pc of a label that is relocated by applying offset \p PCOffset.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:175
Parameters
- uint64_t LabelLowPc
- int64_t PcOffset
¶void addNameAccelerator(
const llvm::DIE* Die,
llvm::DwarfStringPoolEntryRef Name,
bool SkipPubnamesSection = false)
void addNameAccelerator(
const llvm::DIE* Die,
llvm::DwarfStringPoolEntryRef Name,
bool SkipPubnamesSection = false)
Description
Add a name accelerator entry for \a Die with \a Name.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:192
Parameters
- const llvm::DIE* Die
- llvm::DwarfStringPoolEntryRef Name
- bool SkipPubnamesSection = false
¶void addNamespaceAccelerator(
const llvm::DIE* Die,
llvm::DwarfStringPoolEntryRef Name)
void addNamespaceAccelerator(
const llvm::DIE* Die,
llvm::DwarfStringPoolEntryRef Name)
Description
Add a name accelerator entry for \a Die with \a Name.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:189
Parameters
- const llvm::DIE* Die
- llvm::DwarfStringPoolEntryRef Name
¶void addObjCAccelerator(
const llvm::DIE* Die,
llvm::DwarfStringPoolEntryRef Name,
bool SkipPubnamesSection = false)
void addObjCAccelerator(
const llvm::DIE* Die,
llvm::DwarfStringPoolEntryRef Name,
bool SkipPubnamesSection = false)
Description
Add various accelerator entries for \p Die with \p Name which is stored in the string table at \p Offset. \p Name must be an Objective-C selector.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:198
Parameters
- const llvm::DIE* Die
- llvm::DwarfStringPoolEntryRef Name
- bool SkipPubnamesSection = false
¶void addTypeAccelerator(
const llvm::DIE* Die,
llvm::DwarfStringPoolEntryRef Name,
bool ObjcClassImplementation,
uint32_t QualifiedNameHash)
void addTypeAccelerator(
const llvm::DIE* Die,
llvm::DwarfStringPoolEntryRef Name,
bool ObjcClassImplementation,
uint32_t QualifiedNameHash)
Description
Add a type accelerator entry for \p Die with \p Name which is stored in the string table at \p Offset.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:203
Parameters
- const llvm::DIE* Die
- llvm::DwarfStringPoolEntryRef Name
- bool ObjcClassImplementation
- uint32_t QualifiedNameHash
¶uint64_t computeNextUnitOffset(
uint16_t DwarfVersion)
uint64_t computeNextUnitOffset(
uint16_t DwarfVersion)
Description
Compute the end offset for this unit. Must be called after the CU's DIEs have been cloned.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:161
Parameters
- uint16_t DwarfVersion
Returns
the next unit offset (which is also the current debug_info section size).
¶void createOutputDIE()
void createOutputDIE()
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:106
¶void fixupForwardReferences()
void fixupForwardReferences()
Description
Apply all fixups recorded by noteForwardReference().
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:171
¶const std::string& getClangModuleName() const
const std::string& getClangModuleName() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:120
¶const llvm::RangesTy& getFunctionRanges() const
const llvm::RangesTy& getFunctionRanges() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:142
¶uint64_t getHighPc() const
uint64_t getHighPc() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:135
¶llvm::CompileUnit::DIEInfo& getInfo(
unsigned int Idx)
llvm::CompileUnit::DIEInfo& getInfo(
unsigned int Idx)
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:122
Parameters
- unsigned int Idx
¶const llvm::CompileUnit::DIEInfo& getInfo(
unsigned int Idx) const
const llvm::CompileUnit::DIEInfo& getInfo(
unsigned int Idx) const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:123
Parameters
- unsigned int Idx
¶llvm::CompileUnit::DIEInfo& getInfo(
const llvm::DWARFDie& Die)
llvm::CompileUnit::DIEInfo& getInfo(
const llvm::DWARFDie& Die)
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:125
Parameters
- const llvm::DWARFDie& Die
¶llvm::MCSymbol* getLabelBegin()
llvm::MCSymbol* getLabelBegin()
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:239
¶uint16_t getLanguage()
uint16_t getLanguage()
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:116
¶const std::vector<
std::pair<PatchLocation, int64_t>>&
getLocationAttributes() const
const std::vector<
std::pair<PatchLocation, int64_t>>&
getLocationAttributes() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:149
¶uint64_t getLowPc() const
uint64_t getLowPc() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:134
¶const std::vector<AccelInfo>& getNamespaces()
const
const std::vector<AccelInfo>& getNamespaces()
const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:236
¶uint64_t getNextUnitOffset() const
uint64_t getNextUnitOffset() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:131
¶const std::vector<AccelInfo>& getObjC() const
const std::vector<AccelInfo>& getObjC() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:237
¶llvm::DWARFUnit& getOrigUnit() const
llvm::DWARFUnit& getOrigUnit() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:102
¶llvm::DIE* getOutputUnitDIE() const
llvm::DIE* getOutputUnitDIE() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:108
¶const std::vector<AccelInfo>& getPubnames() const
const std::vector<AccelInfo>& getPubnames() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:234
¶const std::vector<AccelInfo>& getPubtypes() const
const std::vector<AccelInfo>& getPubtypes() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:235
¶const std::vector<PatchLocation>&
getRangesAttributes() const
const std::vector<PatchLocation>&
getRangesAttributes() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:144
¶uint64_t getStartOffset() const
uint64_t getStartOffset() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:130
¶llvm::StringRef getSysRoot()
llvm::StringRef getSysRoot()
Description
Return the DW_AT_LLVM_sysroot of the compile unit or an empty StringRef.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:118
¶unsigned int getUniqueID() const
unsigned int getUniqueID() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:104
¶Optional<llvm::PatchLocation>
getUnitRangesAttribute() const
Optional<llvm::PatchLocation>
getUnitRangesAttribute() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:138
¶bool hasLabelAt(uint64_t Addr) const
bool hasLabelAt(uint64_t Addr) const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:136
Parameters
- uint64_t Addr
¶bool hasODR() const
bool hasODR() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:114
¶bool isClangModule() const
bool isClangModule() const
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:115
¶void markEverythingAsKept()
void markEverythingAsKept()
Description
Mark every DIE in this unit as kept. This function also marks variables as InDebugMap so that they appear in the reconstructed accelerator tables.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:156
¶void noteForwardReference(
llvm::DIE* Die,
const llvm::CompileUnit* RefUnit,
llvm::DeclContext* Ctxt,
llvm::PatchLocation Attr)
void noteForwardReference(
llvm::DIE* Die,
const llvm::CompileUnit* RefUnit,
llvm::DeclContext* Ctxt,
llvm::PatchLocation Attr)
Description
Keep track of a forward reference to DIE \p Die in \p RefUnit by \p Attr. The attribute should be fixed up later to point to the absolute offset of \p Die in the debug_info section or to the canonical offset of\p Ctxt if it is non-null.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:167
Parameters
- llvm::DIE* Die
- const llvm::CompileUnit* RefUnit
- llvm::DeclContext* Ctxt
- llvm::PatchLocation Attr
¶void noteLocationAttribute(
llvm::PatchLocation Attr,
int64_t PcOffset)
void noteLocationAttribute(
llvm::PatchLocation Attr,
int64_t PcOffset)
Description
Keep track of a location attribute pointing to a location list in the debug_loc section.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:186
Parameters
- llvm::PatchLocation Attr
- int64_t PcOffset
¶void noteRangeAttribute(const llvm::DIE& Die,
llvm::PatchLocation Attr)
void noteRangeAttribute(const llvm::DIE& Die,
llvm::PatchLocation Attr)
Description
Keep track of a DW_AT_range attribute that we will need to patch up later.
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:182
Parameters
- const llvm::DIE& Die
- llvm::PatchLocation Attr
¶void setLabelBegin(llvm::MCSymbol* S)
void setLabelBegin(llvm::MCSymbol* S)
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:240
Parameters
¶void setStartOffset(uint64_t DebugInfoSize)
void setStartOffset(uint64_t DebugInfoSize)
Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h:132
Parameters
- uint64_t DebugInfoSize