LLVM  17.0.0git
DWARFLinkerCompileUnit.h
Go to the documentation of this file.
1 //===- DWARFLinkerCompileUnit.h ---------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_DWARFLINKER_DWARFLINKERCOMPILEUNIT_H
10 #define LLVM_DWARFLINKER_DWARFLINKERCOMPILEUNIT_H
11 
12 #include "llvm/ADT/AddressRanges.h"
13 #include "llvm/ADT/DenseMap.h"
14 #include "llvm/CodeGen/DIE.h"
16 #include <optional>
17 
18 namespace llvm {
19 
20 class DeclContext;
21 
22 /// Mapped value in the address map is the offset to apply to the
23 /// linked address.
25 
26 // FIXME: Delete this structure.
27 struct PatchLocation {
29 
30  PatchLocation() = default;
32 
33  void set(uint64_t New) const {
34  assert(I);
35  const auto &Old = *I;
36  assert(Old.getType() == DIEValue::isInteger);
37  *I = DIEValue(Old.getAttribute(), Old.getForm(), DIEInteger(New));
38  }
39 
40  uint64_t get() const {
41  assert(I);
42  return I->getDIEInteger().getValue();
43  }
44 };
45 
46 /// Stores all information relating to a compile unit, be it in its original
47 /// instance in the object file to its brand new cloned and generated DIE tree.
48 class CompileUnit {
49 public:
50  /// Information gathered about a DIE in the object file.
51  struct DIEInfo {
52  /// Address offset to apply to the described entity.
53  int64_t AddrAdjust;
54 
55  /// ODR Declaration context.
57 
58  /// Cloned version of that DIE.
60 
61  /// The index of this DIE's parent.
63 
64  /// Is the DIE part of the linked output?
65  bool Keep : 1;
66 
67  /// Was this DIE's entity found in the map?
68  bool InDebugMap : 1;
69 
70  /// Is this a pure forward declaration we can strip?
71  bool Prune : 1;
72 
73  /// Does DIE transitively refer an incomplete decl?
74  bool Incomplete : 1;
75 
76  /// Is DIE in the clang module scope?
77  bool InModuleScope : 1;
78 
79  /// Is ODR marking done?
80  bool ODRMarkingDone : 1;
81 
82  /// Is this a reference to a DIE that hasn't been cloned yet?
84 
85 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
86  LLVM_DUMP_METHOD void dump();
87 #endif // if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
88  };
89 
90  CompileUnit(DWARFUnit &OrigUnit, unsigned ID, bool CanUseODR,
91  StringRef ClangModuleName)
92  : OrigUnit(OrigUnit), ID(ID), ClangModuleName(ClangModuleName) {
93  Info.resize(OrigUnit.getNumDIEs());
94 
95  auto CUDie = OrigUnit.getUnitDIE(false);
96  if (!CUDie) {
97  HasODR = false;
98  return;
99  }
100  if (auto Lang = dwarf::toUnsigned(CUDie.find(dwarf::DW_AT_language)))
101  HasODR = CanUseODR && (*Lang == dwarf::DW_LANG_C_plus_plus ||
102  *Lang == dwarf::DW_LANG_C_plus_plus_03 ||
103  *Lang == dwarf::DW_LANG_C_plus_plus_11 ||
104  *Lang == dwarf::DW_LANG_C_plus_plus_14 ||
105  *Lang == dwarf::DW_LANG_ObjC_plus_plus);
106  else
107  HasODR = false;
108  }
109 
110  DWARFUnit &getOrigUnit() const { return OrigUnit; }
111 
112  unsigned getUniqueID() const { return ID; }
113 
114  void createOutputDIE() { NewUnit.emplace(OrigUnit.getUnitDIE().getTag()); }
115 
117  if (NewUnit)
118  return &const_cast<BasicDIEUnit &>(*NewUnit).getUnitDie();
119  return nullptr;
120  }
121 
122  bool hasODR() const { return HasODR; }
123  bool isClangModule() const { return !ClangModuleName.empty(); }
125  /// Return the DW_AT_LLVM_sysroot of the compile unit or an empty StringRef.
127 
128  const std::string &getClangModuleName() const { return ClangModuleName; }
129 
130  DIEInfo &getInfo(unsigned Idx) { return Info[Idx]; }
131  const DIEInfo &getInfo(unsigned Idx) const { return Info[Idx]; }
132 
133  DIEInfo &getInfo(const DWARFDie &Die) {
134  unsigned Idx = getOrigUnit().getDIEIndex(Die);
135  return Info[Idx];
136  }
137 
138  uint64_t getStartOffset() const { return StartOffset; }
139  uint64_t getNextUnitOffset() const { return NextUnitOffset; }
141 
142  std::optional<uint64_t> getLowPc() const { return LowPc; }
143  uint64_t getHighPc() const { return HighPc; }
144  bool hasLabelAt(uint64_t Addr) const { return Labels.count(Addr); }
145 
146  std::optional<PatchLocation> getUnitRangesAttribute() const {
147  return UnitRangeAttribute;
148  }
149 
150  const RangesTy &getFunctionRanges() const { return Ranges; }
151 
152  const std::vector<PatchLocation> &getRangesAttributes() const {
153  return RangeAttributes;
154  }
155 
156  const std::vector<std::pair<PatchLocation, int64_t>> &
158  return LocationAttributes;
159  }
160 
161  /// Mark every DIE in this unit as kept. This function also
162  /// marks variables as InDebugMap so that they appear in the
163  /// reconstructed accelerator tables.
164  void markEverythingAsKept();
165 
166  /// Compute the end offset for this unit. Must be called after the CU's DIEs
167  /// have been cloned. \returns the next unit offset (which is also the
168  /// current debug_info section size).
170 
171  /// Keep track of a forward reference to DIE \p Die in \p RefUnit by \p
172  /// Attr. The attribute should be fixed up later to point to the absolute
173  /// offset of \p Die in the debug_info section or to the canonical offset of
174  /// \p Ctxt if it is non-null.
175  void noteForwardReference(DIE *Die, const CompileUnit *RefUnit,
176  DeclContext *Ctxt, PatchLocation Attr);
177 
178  /// Apply all fixups recorded by noteForwardReference().
179  void fixupForwardReferences();
180 
181  /// Add the low_pc of a label that is relocated by applying
182  /// offset \p PCOffset.
183  void addLabelLowPc(uint64_t LabelLowPc, int64_t PcOffset);
184 
185  /// Add a function range [\p LowPC, \p HighPC) that is relocated by applying
186  /// offset \p PCOffset.
187  void addFunctionRange(uint64_t LowPC, uint64_t HighPC, int64_t PCOffset);
188 
189  /// Keep track of a DW_AT_range attribute that we will need to patch up later.
190  void noteRangeAttribute(const DIE &Die, PatchLocation Attr);
191 
192  /// Keep track of a location attribute pointing to a location list in the
193  /// debug_loc section.
194  void noteLocationAttribute(PatchLocation Attr, int64_t PcOffset);
195 
196  /// Add a name accelerator entry for \a Die with \a Name.
197  void addNamespaceAccelerator(const DIE *Die, DwarfStringPoolEntryRef Name);
198 
199  /// Add a name accelerator entry for \a Die with \a Name.
200  void addNameAccelerator(const DIE *Die, DwarfStringPoolEntryRef Name,
201  bool SkipPubnamesSection = false);
202 
203  /// Add various accelerator entries for \p Die with \p Name which is stored
204  /// in the string table at \p Offset. \p Name must be an Objective-C
205  /// selector.
206  void addObjCAccelerator(const DIE *Die, DwarfStringPoolEntryRef Name,
207  bool SkipPubnamesSection = false);
208 
209  /// Add a type accelerator entry for \p Die with \p Name which is stored in
210  /// the string table at \p Offset.
211  void addTypeAccelerator(const DIE *Die, DwarfStringPoolEntryRef Name,
212  bool ObjcClassImplementation,
213  uint32_t QualifiedNameHash);
214 
215  struct AccelInfo {
216  /// Name of the entry.
218 
219  /// DIE this entry describes.
220  const DIE *Die;
221 
222  /// Hash of the fully qualified name.
224 
225  /// Emit this entry only in the apple_* sections.
227 
228  /// Is this an ObjC class implementation?
230 
232  bool SkipPubSection = false)
234 
236  uint32_t QualifiedNameHash, bool ObjCClassIsImplementation)
239  ObjcClassImplementation(ObjCClassIsImplementation) {}
240  };
241 
242  const std::vector<AccelInfo> &getPubnames() const { return Pubnames; }
243  const std::vector<AccelInfo> &getPubtypes() const { return Pubtypes; }
244  const std::vector<AccelInfo> &getNamespaces() const { return Namespaces; }
245  const std::vector<AccelInfo> &getObjC() const { return ObjC; }
246 
247  MCSymbol *getLabelBegin() { return LabelBegin; }
248  void setLabelBegin(MCSymbol *S) { LabelBegin = S; }
249 
250 private:
251  DWARFUnit &OrigUnit;
252  unsigned ID;
253  std::vector<DIEInfo> Info; ///< DIE info indexed by DIE index.
254  std::optional<BasicDIEUnit> NewUnit;
255  MCSymbol *LabelBegin = nullptr;
256 
257  uint64_t StartOffset;
258  uint64_t NextUnitOffset;
259 
260  std::optional<uint64_t> LowPc;
261  uint64_t HighPc = 0;
262 
263  /// A list of attributes to fixup with the absolute offset of
264  /// a DIE in the debug_info section.
265  ///
266  /// The offsets for the attributes in this array couldn't be set while
267  /// cloning because for cross-cu forward references the target DIE's offset
268  /// isn't known you emit the reference attribute.
269  std::vector<
270  std::tuple<DIE *, const CompileUnit *, DeclContext *, PatchLocation>>
271  ForwardDIEReferences;
272 
273  /// The ranges in that map are the PC ranges for functions in this unit,
274  /// associated with the PC offset to apply to the addresses to get
275  /// the linked address.
276  RangesTy Ranges;
277 
278  /// The DW_AT_low_pc of each DW_TAG_label.
280 
281  /// DW_AT_ranges attributes to patch after we have gathered
282  /// all the unit's function addresses.
283  /// @{
284  std::vector<PatchLocation> RangeAttributes;
285  std::optional<PatchLocation> UnitRangeAttribute;
286  /// @}
287 
288  /// Location attributes that need to be transferred from the
289  /// original debug_loc section to the liked one. They are stored
290  /// along with the PC offset that is to be applied to their
291  /// function's address.
292  std::vector<std::pair<PatchLocation, int64_t>> LocationAttributes;
293 
294  /// Accelerator entries for the unit, both for the pub*
295  /// sections and the apple* ones.
296  /// @{
297  std::vector<AccelInfo> Pubnames;
298  std::vector<AccelInfo> Pubtypes;
299  std::vector<AccelInfo> Namespaces;
300  std::vector<AccelInfo> ObjC;
301  /// @}
302 
303  /// Is this unit subject to the ODR rule?
304  bool HasODR;
305 
306  /// The DW_AT_language of this unit.
307  uint16_t Language = 0;
308 
309  /// The DW_AT_LLVM_sysroot of this unit.
310  std::string SysRoot;
311 
312  /// If this is a Clang module, this holds the module's name.
313  std::string ClangModuleName;
314 };
315 
316 } // end namespace llvm
317 
318 #endif // LLVM_DWARFLINKER_DWARFLINKERCOMPILEUNIT_H
llvm::CompileUnit::DIEInfo::AddrAdjust
int64_t AddrAdjust
Address offset to apply to the described entity.
Definition: DWARFLinkerCompileUnit.h:53
llvm::CompileUnit::hasLabelAt
bool hasLabelAt(uint64_t Addr) const
Definition: DWARFLinkerCompileUnit.h:144
llvm::CompileUnit::getOrigUnit
DWARFUnit & getOrigUnit() const
Definition: DWARFLinkerCompileUnit.h:110
llvm::CompileUnit::DIEInfo::Ctxt
DeclContext * Ctxt
ODR Declaration context.
Definition: DWARFLinkerCompileUnit.h:56
LLVM_DUMP_METHOD
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Definition: Compiler.h:492
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::CompileUnit::getInfo
DIEInfo & getInfo(unsigned Idx)
Definition: DWARFLinkerCompileUnit.h:130
llvm::DeclContext
A DeclContext is a named program scope that is used for ODR uniquing of types.
Definition: DWARFLinkerDeclContext.h:78
llvm::PatchLocation::get
uint64_t get() const
Definition: DWARFLinkerCompileUnit.h:40
llvm::DIEValue
Definition: DIE.h:369
llvm::dwarf::toUnsigned
std::optional< uint64_t > toUnsigned(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract an unsigned constant.
Definition: DWARFFormValue.h:225
llvm::CompileUnit::DIEInfo::ParentIdx
uint32_t ParentIdx
The index of this DIE's parent.
Definition: DWARFLinkerCompileUnit.h:62
llvm::CompileUnit::getLowPc
std::optional< uint64_t > getLowPc() const
Definition: DWARFLinkerCompileUnit.h:142
llvm::CompileUnit::getRangesAttributes
const std::vector< PatchLocation > & getRangesAttributes() const
Definition: DWARFLinkerCompileUnit.h:152
llvm::CompileUnit::DIEInfo::UnclonedReference
bool UnclonedReference
Is this a reference to a DIE that hasn't been cloned yet?
Definition: DWARFLinkerCompileUnit.h:83
llvm::CompileUnit::addTypeAccelerator
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.
Definition: DWARFLinkerCompileUnit.cpp:165
llvm::SmallDenseMap< uint64_t, uint64_t, 1 >
llvm::PatchLocation::PatchLocation
PatchLocation(DIE::value_iterator I)
Definition: DWARFLinkerCompileUnit.h:31
llvm::CompileUnit::DIEInfo::Prune
bool Prune
Is this a pure forward declaration we can strip?
Definition: DWARFLinkerCompileUnit.h:71
llvm::BasicDIEUnit
Definition: DIE.h:923
llvm::CompileUnit::getClangModuleName
const std::string & getClangModuleName() const
Definition: DWARFLinkerCompileUnit.h:128
DenseMap.h
llvm::CompileUnit::getLanguage
uint16_t getLanguage()
Definition: DWARFLinkerCompileUnit.cpp:43
llvm::CompileUnit::getPubtypes
const std::vector< AccelInfo > & getPubtypes() const
Definition: DWARFLinkerCompileUnit.h:243
llvm::CompileUnit::getLabelBegin
MCSymbol * getLabelBegin()
Definition: DWARFLinkerCompileUnit.h:247
llvm::CompileUnit::CompileUnit
CompileUnit(DWARFUnit &OrigUnit, unsigned ID, bool CanUseODR, StringRef ClangModuleName)
Definition: DWARFLinkerCompileUnit.h:90
llvm::DenseMapBase::count
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
Definition: DenseMap.h:145
llvm::CompileUnit::noteRangeAttribute
void noteRangeAttribute(const DIE &Die, PatchLocation Attr)
Keep track of a DW_AT_range attribute that we will need to patch up later.
Definition: DWARFLinkerCompileUnit.cpp:137
llvm::CompileUnit::getHighPc
uint64_t getHighPc() const
Definition: DWARFLinkerCompileUnit.h:143
llvm::DIE
A structured debug information entry.
Definition: DIE.h:739
llvm::CompileUnit::DIEInfo::InDebugMap
bool InDebugMap
Was this DIE's entity found in the map?
Definition: DWARFLinkerCompileUnit.h:68
llvm::CompileUnit::AccelInfo::SkipPubSection
bool SkipPubSection
Emit this entry only in the apple_* sections.
Definition: DWARFLinkerCompileUnit.h:226
llvm::CompileUnit::DIEInfo::dump
LLVM_DUMP_METHOD void dump()
Definition: DWARFLinkerCompileUnit.cpp:16
llvm::CompileUnit::getLocationAttributes
const std::vector< std::pair< PatchLocation, int64_t > > & getLocationAttributes() const
Definition: DWARFLinkerCompileUnit.h:157
llvm::DwarfStringPoolEntryRef
DwarfStringPoolEntryRef: Dwarf string pool entry reference.
Definition: DwarfStringPoolEntry.h:44
llvm::CompileUnit::addObjCAccelerator
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.
Definition: DWARFLinkerCompileUnit.cpp:153
llvm::yaml::isInteger
static bool isInteger(StringRef Val)
Definition: ELFYAML.cpp:1528
llvm::CompileUnit::AccelInfo::AccelInfo
AccelInfo(DwarfStringPoolEntryRef Name, const DIE *Die, uint32_t QualifiedNameHash, bool ObjCClassIsImplementation)
Definition: DWARFLinkerCompileUnit.h:235
llvm::DWARFUnit::getUnitDIE
DWARFDie getUnitDIE(bool ExtractUnitDIEOnly=true)
Definition: DWARFUnit.h:426
llvm::CompileUnit::DIEInfo::Clone
DIE * Clone
Cloned version of that DIE.
Definition: DWARFLinkerCompileUnit.h:59
llvm::DWARFUnit::getNumDIEs
unsigned getNumDIEs()
Returns the number of DIEs in the unit.
Definition: DWARFUnit.h:488
llvm::CompileUnit::DIEInfo
Information gathered about a DIE in the object file.
Definition: DWARFLinkerCompileUnit.h:51
AddressRanges.h
llvm::CompileUnit::getInfo
DIEInfo & getInfo(const DWARFDie &Die)
Definition: DWARFLinkerCompileUnit.h:133
llvm::CompileUnit::getNamespaces
const std::vector< AccelInfo > & getNamespaces() const
Definition: DWARFLinkerCompileUnit.h:244
llvm::DIEValueList::value_iterator
Definition: DIE.h:675
llvm::DebugInfoSize
Hold the input and output of the debug info size in bytes.
Definition: DWARFLinker.cpp:40
false
Definition: StackSlotColoring.cpp:141
llvm::CompileUnit::getUniqueID
unsigned getUniqueID() const
Definition: DWARFLinkerCompileUnit.h:112
llvm::DIEInteger
An integer value DIE.
Definition: DIE.h:163
llvm::PatchLocation::I
DIE::value_iterator I
Definition: DWARFLinkerCompileUnit.h:28
llvm::CompileUnit::getPubnames
const std::vector< AccelInfo > & getPubnames() const
Definition: DWARFLinkerCompileUnit.h:242
llvm::CallingConv::ID
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
llvm::CompileUnit::getInfo
const DIEInfo & getInfo(unsigned Idx) const
Definition: DWARFLinkerCompileUnit.h:131
DIE.h
llvm::CompileUnit::AccelInfo
Definition: DWARFLinkerCompileUnit.h:215
uint64_t
llvm::CompileUnit::getObjC
const std::vector< AccelInfo > & getObjC() const
Definition: DWARFLinkerCompileUnit.h:245
llvm::CompileUnit::AccelInfo::AccelInfo
AccelInfo(DwarfStringPoolEntryRef Name, const DIE *Die, bool SkipPubSection=false)
Definition: DWARFLinkerCompileUnit.h:231
llvm::CompileUnit::addLabelLowPc
void addLabelLowPc(uint64_t LabelLowPc, int64_t PcOffset)
Add the low_pc of a label that is relocated by applying offset PCOffset.
Definition: DWARFLinkerCompileUnit.cpp:123
llvm::CompileUnit::DIEInfo::Keep
bool Keep
Is the DIE part of the linked output?
Definition: DWARFLinkerCompileUnit.h:65
Addr
uint64_t Addr
Definition: ELFObjHandler.cpp:79
llvm::CompileUnit
Stores all information relating to a compile unit, be it in its original instance in the object file ...
Definition: DWARFLinkerCompileUnit.h:48
DWARFUnit.h
llvm::AddressRangesMap< int64_t >
llvm::CompileUnit::getStartOffset
uint64_t getStartOffset() const
Definition: DWARFLinkerCompileUnit.h:138
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::CompileUnit::getNextUnitOffset
uint64_t getNextUnitOffset() const
Definition: DWARFLinkerCompileUnit.h:139
llvm::CompileUnit::getFunctionRanges
const RangesTy & getFunctionRanges() const
Definition: DWARFLinkerCompileUnit.h:150
llvm::CompileUnit::setStartOffset
void setStartOffset(uint64_t DebugInfoSize)
Definition: DWARFLinkerCompileUnit.h:140
llvm::CompileUnit::setLabelBegin
void setLabelBegin(MCSymbol *S)
Definition: DWARFLinkerCompileUnit.h:248
llvm::CompileUnit::addFunctionRange
void addFunctionRange(uint64_t LowPC, uint64_t HighPC, int64_t PCOffset)
Add a function range [LowPC, HighPC) that is relocated by applying offset PCOffset.
Definition: DWARFLinkerCompileUnit.cpp:127
llvm::CompileUnit::DIEInfo::ODRMarkingDone
bool ODRMarkingDone
Is ODR marking done?
Definition: DWARFLinkerCompileUnit.h:80
llvm::CompileUnit::AccelInfo::Name
DwarfStringPoolEntryRef Name
Name of the entry.
Definition: DWARFLinkerCompileUnit.h:217
llvm::CompileUnit::AccelInfo::QualifiedNameHash
uint32_t QualifiedNameHash
Hash of the fully qualified name.
Definition: DWARFLinkerCompileUnit.h:223
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
llvm::CompileUnit::addNameAccelerator
void addNameAccelerator(const DIE *Die, DwarfStringPoolEntryRef Name, bool SkipPubnamesSection=false)
Add a name accelerator entry for Die with Name.
Definition: DWARFLinkerCompileUnit.cpp:159
llvm::CompileUnit::noteLocationAttribute
void noteLocationAttribute(PatchLocation Attr, int64_t PcOffset)
Keep track of a location attribute pointing to a location list in the debug_loc section.
Definition: DWARFLinkerCompileUnit.cpp:144
uint32_t
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::CompileUnit::addNamespaceAccelerator
void addNamespaceAccelerator(const DIE *Die, DwarfStringPoolEntryRef Name)
Add a name accelerator entry for Die with Name.
Definition: DWARFLinkerCompileUnit.cpp:148
llvm::CompileUnit::computeNextUnitOffset
uint64_t computeNextUnitOffset(uint16_t DwarfVersion)
Compute the end offset for this unit.
Definition: DWARFLinkerCompileUnit.cpp:89
llvm::CompileUnit::getSysRoot
StringRef getSysRoot()
Return the DW_AT_LLVM_sysroot of the compile unit or an empty StringRef.
Definition: DWARFLinkerCompileUnit.cpp:51
uint16_t
llvm::CompileUnit::fixupForwardReferences
void fixupForwardReferences()
Apply all fixups recorded by noteForwardReference().
Definition: DWARFLinkerCompileUnit.cpp:105
llvm::DWARFUnit
Definition: DWARFUnit.h:206
llvm::PatchLocation
Definition: DWARFLinkerCompileUnit.h:27
llvm::PatchLocation::set
void set(uint64_t New) const
Definition: DWARFLinkerCompileUnit.h:33
llvm::CompileUnit::hasODR
bool hasODR() const
Definition: DWARFLinkerCompileUnit.h:122
llvm::CompileUnit::getOutputUnitDIE
DIE * getOutputUnitDIE() const
Definition: DWARFLinkerCompileUnit.h:116
llvm::CompileUnit::createOutputDIE
void createOutputDIE()
Definition: DWARFLinkerCompileUnit.h:114
llvm::CompileUnit::AccelInfo::ObjcClassImplementation
bool ObjcClassImplementation
Is this an ObjC class implementation?
Definition: DWARFLinkerCompileUnit.h:229
llvm::DWARFDie::getTag
dwarf::Tag getTag() const
Definition: DWARFDie.h:71
llvm::PatchLocation::PatchLocation
PatchLocation()=default
llvm::CompileUnit::AccelInfo::Die
const DIE * Die
DIE this entry describes.
Definition: DWARFLinkerCompileUnit.h:220
llvm::DWARFUnit::getDIEIndex
uint32_t getDIEIndex(const DWARFDebugInfoEntry *Die) const
Return the index of a Die entry inside the unit's DIE vector.
Definition: DWARFUnit.h:262
llvm::CompileUnit::noteForwardReference
void noteForwardReference(DIE *Die, const CompileUnit *RefUnit, DeclContext *Ctxt, PatchLocation Attr)
Keep track of a forward reference to DIE Die in RefUnit by Attr.
Definition: DWARFLinkerCompileUnit.cpp:100
llvm::CompileUnit::DIEInfo::InModuleScope
bool InModuleScope
Is DIE in the clang module scope?
Definition: DWARFLinkerCompileUnit.h:77
llvm::DWARFDie
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
Definition: DWARFDie.h:42
llvm::CompileUnit::DIEInfo::Incomplete
bool Incomplete
Does DIE transitively refer an incomplete decl?
Definition: DWARFLinkerCompileUnit.h:74
llvm::CompileUnit::markEverythingAsKept
void markEverythingAsKept()
Mark every DIE in this unit as kept.
Definition: DWARFLinkerCompileUnit.cpp:59
llvm::CompileUnit::getUnitRangesAttribute
std::optional< PatchLocation > getUnitRangesAttribute() const
Definition: DWARFLinkerCompileUnit.h:146
llvm::DIEUnit::getUnitDie
DIE & getUnitDie()
Definition: DIE.h:919
llvm::CompileUnit::isClangModule
bool isClangModule() const
Definition: DWARFLinkerCompileUnit.h:123