LLVM
13.0.0git
|
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. More...
#include "llvm/DWARFLinker/DWARFLinkerCompileUnit.h"
Classes | |
struct | AccelInfo |
struct | DIEInfo |
Information gathered about a DIE in the object file. More... | |
Public Member Functions | |
CompileUnit (DWARFUnit &OrigUnit, unsigned ID, bool CanUseODR, StringRef ClangModuleName) | |
DWARFUnit & | getOrigUnit () const |
unsigned | getUniqueID () const |
void | createOutputDIE () |
DIE * | getOutputUnitDIE () const |
bool | hasODR () const |
bool | isClangModule () const |
uint16_t | getLanguage () |
StringRef | getSysRoot () |
Return the DW_AT_LLVM_sysroot of the compile unit or an empty StringRef. More... | |
const std::string & | getClangModuleName () const |
DIEInfo & | getInfo (unsigned Idx) |
const DIEInfo & | getInfo (unsigned Idx) const |
DIEInfo & | getInfo (const DWARFDie &Die) |
uint64_t | getStartOffset () const |
uint64_t | getNextUnitOffset () const |
void | setStartOffset (uint64_t DebugInfoSize) |
uint64_t | getLowPc () const |
uint64_t | getHighPc () const |
bool | hasLabelAt (uint64_t Addr) const |
Optional< PatchLocation > | getUnitRangesAttribute () const |
const FunctionIntervals & | getFunctionRanges () const |
const std::vector< PatchLocation > & | getRangesAttributes () const |
const std::vector< std::pair< PatchLocation, int64_t > > & | getLocationAttributes () const |
void | setHasInterestingContent () |
bool | hasInterestingContent () |
void | markEverythingAsKept () |
Mark every DIE in this unit as kept. More... | |
uint64_t | computeNextUnitOffset (uint16_t DwarfVersion) |
Compute the end offset for this unit. More... | |
void | noteForwardReference (DIE *Die, const CompileUnit *RefUnit, DeclContext *Ctxt, PatchLocation Attr) |
Keep track of a forward reference to DIE Die in RefUnit by Attr . More... | |
void | fixupForwardReferences () |
Apply all fixups recorded by noteForwardReference(). More... | |
void | addLabelLowPc (uint64_t LabelLowPc, int64_t PcOffset) |
Add the low_pc of a label that is relocated by applying offset PCOffset . More... | |
void | addFunctionRange (uint64_t LowPC, uint64_t HighPC, int64_t PCOffset) |
Add a function range [LowPC , HighPC ) that is relocated by applying offset PCOffset . More... | |
void | noteRangeAttribute (const DIE &Die, PatchLocation Attr) |
Keep track of a DW_AT_range attribute that we will need to patch up later. More... | |
void | noteLocationAttribute (PatchLocation Attr, int64_t PcOffset) |
Keep track of a location attribute pointing to a location list in the debug_loc section. More... | |
void | addNamespaceAccelerator (const DIE *Die, DwarfStringPoolEntryRef Name) |
Add a name accelerator entry for Die with Name. More... | |
void | addNameAccelerator (const DIE *Die, DwarfStringPoolEntryRef Name, bool SkipPubnamesSection=false) |
Add a name accelerator entry for Die with Name. More... | |
void | addObjCAccelerator (const DIE *Die, DwarfStringPoolEntryRef Name, bool SkipPubnamesSection=false) |
Add various accelerator entries for Die with Name which is stored in the string table at Offset . More... | |
void | addTypeAccelerator (const DIE *Die, DwarfStringPoolEntryRef Name, bool ObjcClassImplementation, uint32_t QualifiedNameHash) |
Add a type accelerator entry for Die with Name which is stored in the string table at Offset . More... | |
const std::vector< AccelInfo > & | getPubnames () const |
const std::vector< AccelInfo > & | getPubtypes () const |
const std::vector< AccelInfo > & | getNamespaces () const |
const std::vector< AccelInfo > & | getObjC () const |
MCSymbol * | getLabelBegin () |
void | setLabelBegin (MCSymbol *S) |
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.
Definition at line 50 of file DWARFLinkerCompileUnit.h.
|
inline |
Definition at line 79 of file DWARFLinkerCompileUnit.h.
References llvm::DWARFUnit::getNumDIEs(), llvm::DWARFUnit::getUnitDIE(), and llvm::dwarf::toUnsigned().
void llvm::CompileUnit::addFunctionRange | ( | uint64_t | LowPC, |
uint64_t | HighPC, | ||
int64_t | PCOffset | ||
) |
Add a function range [LowPC
, HighPC
) that is relocated by applying offset PCOffset
.
Definition at line 106 of file DWARFLinkerCompileUnit.cpp.
References llvm::IntervalMap< KeyT, ValT, N, Traits >::insert(), llvm::max(), and llvm::min().
void llvm::CompileUnit::addLabelLowPc | ( | uint64_t | LabelLowPc, |
int64_t | PcOffset | ||
) |
Add the low_pc of a label that is relocated by applying offset PCOffset
.
Definition at line 102 of file DWARFLinkerCompileUnit.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert().
void llvm::CompileUnit::addNameAccelerator | ( | const DIE * | Die, |
DwarfStringPoolEntryRef | Name, | ||
bool | SkipPubnamesSection = false |
||
) |
Add a name accelerator entry for Die with Name.
Definition at line 139 of file DWARFLinkerCompileUnit.cpp.
void llvm::CompileUnit::addNamespaceAccelerator | ( | const DIE * | Die, |
DwarfStringPoolEntryRef | Name | ||
) |
Add a name accelerator entry for Die with Name.
Definition at line 128 of file DWARFLinkerCompileUnit.cpp.
void llvm::CompileUnit::addObjCAccelerator | ( | const DIE * | Die, |
DwarfStringPoolEntryRef | Name, | ||
bool | SkipPubnamesSection = false |
||
) |
Add various accelerator entries for Die
with Name
which is stored in the string table at Offset
.
Name
must be an Objective-C selector.
Definition at line 133 of file DWARFLinkerCompileUnit.cpp.
void llvm::CompileUnit::addTypeAccelerator | ( | const DIE * | Die, |
DwarfStringPoolEntryRef | Name, | ||
bool | ObjcClassImplementation, | ||
uint32_t | QualifiedNameHash | ||
) |
Add a type accelerator entry for Die
with Name
which is stored in the string table at Offset
.
Definition at line 145 of file DWARFLinkerCompileUnit.cpp.
uint64_t llvm::CompileUnit::computeNextUnitOffset | ( | uint16_t | DwarfVersion | ) |
Compute the end offset for this unit.
Must be called after the CU's DIEs have been cloned.
Definition at line 72 of file DWARFLinkerCompileUnit.cpp.
|
inline |
Definition at line 104 of file DWARFLinkerCompileUnit.h.
References llvm::DWARFDie::getTag(), and llvm::DWARFUnit::getUnitDIE().
void llvm::CompileUnit::fixupForwardReferences | ( | ) |
Apply all fixups recorded by noteForwardReference().
Definition at line 88 of file DWARFLinkerCompileUnit.cpp.
References llvm::DeclContext::getCanonicalDIEOffset(), llvm::DIE::getOffset(), getStartOffset(), llvm::Ref, and llvm::PatchLocation::set().
|
inline |
Definition at line 118 of file DWARFLinkerCompileUnit.h.
|
inline |
Definition at line 140 of file DWARFLinkerCompileUnit.h.
Referenced by llvm::DwarfStreamer::emitUnitRangesEntries().
|
inline |
Definition at line 133 of file DWARFLinkerCompileUnit.h.
Definition at line 123 of file DWARFLinkerCompileUnit.h.
References getOrigUnit().
|
inline |
Definition at line 120 of file DWARFLinkerCompileUnit.h.
Referenced by llvm::inFunctionScope(), and llvm::DeclContext::setLastSeenDIE().
Definition at line 121 of file DWARFLinkerCompileUnit.h.
|
inline |
Definition at line 240 of file DWARFLinkerCompileUnit.h.
Referenced by llvm::DwarfStreamer::emitCompileUnitHeader().
uint16_t llvm::CompileUnit::getLanguage | ( | ) |
Definition at line 24 of file DWARFLinkerCompileUnit.cpp.
References getOrigUnit(), llvm::DWARFUnit::getUnitDIE(), and llvm::dwarf::toUnsigned().
|
inline |
Definition at line 147 of file DWARFLinkerCompileUnit.h.
Referenced by llvm::DwarfStreamer::emitLocationsForUnit().
|
inline |
Definition at line 132 of file DWARFLinkerCompileUnit.h.
Referenced by llvm::DwarfStreamer::emitLocationsForUnit().
|
inline |
Definition at line 237 of file DWARFLinkerCompileUnit.h.
|
inline |
Definition at line 129 of file DWARFLinkerCompileUnit.h.
Referenced by llvm::DwarfStreamer::emitCompileUnitHeader().
|
inline |
Definition at line 238 of file DWARFLinkerCompileUnit.h.
|
inline |
Definition at line 100 of file DWARFLinkerCompileUnit.h.
Referenced by llvm::DwarfStreamer::emitCompileUnitHeader(), llvm::DwarfStreamer::emitLocationsForUnit(), llvm::DwarfStreamer::emitUnitRangesEntries(), llvm::DeclContextTree::getChildDeclContext(), getInfo(), getLanguage(), getSysRoot(), llvm::inFunctionScope(), and llvm::DeclContext::setLastSeenDIE().
|
inline |
Definition at line 106 of file DWARFLinkerCompileUnit.h.
References llvm::DIEUnit::getUnitDie().
|
inline |
Definition at line 235 of file DWARFLinkerCompileUnit.h.
Referenced by llvm::DwarfStreamer::emitPubNamesForUnit().
|
inline |
Definition at line 236 of file DWARFLinkerCompileUnit.h.
Referenced by llvm::DwarfStreamer::emitPubTypesForUnit().
|
inline |
Definition at line 142 of file DWARFLinkerCompileUnit.h.
|
inline |
Definition at line 128 of file DWARFLinkerCompileUnit.h.
Referenced by llvm::DwarfStreamer::emitCompileUnitHeader(), and fixupForwardReferences().
StringRef llvm::CompileUnit::getSysRoot | ( | ) |
Return the DW_AT_LLVM_sysroot of the compile unit or an empty StringRef.
Definition at line 32 of file DWARFLinkerCompileUnit.cpp.
References getOrigUnit(), llvm::DWARFUnit::getUnitDIE(), llvm::StringRef::str(), and llvm::dwarf::toStringRef().
|
inline |
Definition at line 102 of file DWARFLinkerCompileUnit.h.
Referenced by llvm::DwarfStreamer::emitCompileUnitHeader(), llvm::DeclContextTree::getChildDeclContext(), and llvm::DeclContext::setLastSeenDIE().
|
inline |
Definition at line 136 of file DWARFLinkerCompileUnit.h.
|
inline |
Definition at line 152 of file DWARFLinkerCompileUnit.h.
|
inline |
Definition at line 134 of file DWARFLinkerCompileUnit.h.
References Addr, and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count().
|
inline |
Definition at line 112 of file DWARFLinkerCompileUnit.h.
|
inline |
Definition at line 113 of file DWARFLinkerCompileUnit.h.
void llvm::CompileUnit::markEverythingAsKept | ( | ) |
Mark every DIE in this unit as kept.
This function also marks variables as InDebugMap so that they appear in the reconstructed accelerator tables.
Definition at line 40 of file DWARFLinkerCompileUnit.cpp.
References llvm::DWARFUnit::getAddressByteSize(), llvm::DWARFUnit::getDIEAtIndex(), llvm::DIE::getTag(), I, llvm::inFunctionScope(), and setHasInterestingContent().
void llvm::CompileUnit::noteForwardReference | ( | DIE * | Die, |
const CompileUnit * | RefUnit, | ||
DeclContext * | Ctxt, | ||
PatchLocation | Attr | ||
) |
Keep track of a forward reference to DIE Die
in RefUnit
by Attr
.
Keep track of a forward cross-cu reference from this unit to Die
that lives in RefUnit
.
The attribute should be fixed up later to point to the absolute offset of Die
in the debug_info section or to the canonical offset of Ctxt
if it is non-null.
Definition at line 83 of file DWARFLinkerCompileUnit.cpp.
void llvm::CompileUnit::noteLocationAttribute | ( | PatchLocation | Attr, |
int64_t | PcOffset | ||
) |
Keep track of a location attribute pointing to a location list in the debug_loc section.
Definition at line 124 of file DWARFLinkerCompileUnit.cpp.
void llvm::CompileUnit::noteRangeAttribute | ( | const DIE & | Die, |
PatchLocation | Attr | ||
) |
Keep track of a DW_AT_range attribute that we will need to patch up later.
Definition at line 117 of file DWARFLinkerCompileUnit.cpp.
References llvm::DIE::getTag().
|
inline |
Definition at line 151 of file DWARFLinkerCompileUnit.h.
Referenced by markEverythingAsKept().
|
inline |
Definition at line 241 of file DWARFLinkerCompileUnit.h.
References S.
Referenced by llvm::DwarfStreamer::emitCompileUnitHeader().
|
inline |
Definition at line 130 of file DWARFLinkerCompileUnit.h.