summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4f1fde9)
raw | patch | inline | side by side (parent: 4f1fde9)
author | David Blaikie <dblaikie@gmail.com> | |
Tue, 26 Nov 2013 19:14:34 +0000 (19:14 +0000) | ||
committer | David Blaikie <dblaikie@gmail.com> | |
Tue, 26 Nov 2013 19:14:34 +0000 (19:14 +0000) |
Since type units aren't in the CUMap, use the DwarfUnits list to iterate
over units for tasks such as accelerator table building.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195776 91177308-0d34-0410-b5e6-96231b3b80d8
over units for tasks such as accelerator table building.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195776 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp | patch | blob | history | |
lib/CodeGen/AsmPrinter/DwarfDebug.h | patch | blob | history | |
test/DebugInfo/X86/generate-odr-hash.ll | patch | blob | history |
index e1ffa05412fdb1cc912815a2eeded0babdb6cb36..5705b6abb4bf0647e918aa62c7cb98dd360424ef 100644 (file)
computeInlinedDIEs();
// Handle anything that needs to be done on a per-cu basis.
- for (DenseMap<const MDNode *, CompileUnit *>::iterator CUI = CUMap.begin(),
- CUE = CUMap.end();
- CUI != CUE; ++CUI) {
- CompileUnit *TheCU = CUI->second;
+ for (SmallVectorImpl<CompileUnit *>::const_iterator I = getUnits().begin(),
+ E = getUnits().end();
+ I != E; ++I) {
+ CompileUnit *TheCU = *I;
// Emit DW_AT_containing_type attribute to connect types with their
// vtable holding type.
TheCU->constructContainingTypeDIEs();
// Iterate over each compile unit and set the size and offsets for each
// DIE within each compile unit. All offsets are CU relative.
- for (SmallVectorImpl<CompileUnit *>::iterator I = CUs.begin(), E = CUs.end();
+ for (SmallVectorImpl<CompileUnit *>::const_iterator I = CUs.begin(),
+ E = CUs.end();
I != E; ++I) {
(*I)->setDebugInfoOffset(SecOffset);
void DwarfDebug::emitAccelNames() {
DwarfAccelTable AT(
DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4));
- for (DenseMap<const MDNode *, CompileUnit *>::iterator I = CUMap.begin(),
- E = CUMap.end();
+ for (SmallVectorImpl<CompileUnit *>::const_iterator I = getUnits().begin(),
+ E = getUnits().end();
I != E; ++I) {
- CompileUnit *TheCU = I->second;
+ CompileUnit *TheCU = *I;
const StringMap<std::vector<const DIE *> > &Names = TheCU->getAccelNames();
for (StringMap<std::vector<const DIE *> >::const_iterator
GI = Names.begin(),
void DwarfDebug::emitAccelObjC() {
DwarfAccelTable AT(
DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4));
- for (DenseMap<const MDNode *, CompileUnit *>::iterator I = CUMap.begin(),
- E = CUMap.end();
+ for (SmallVectorImpl<CompileUnit *>::const_iterator I = getUnits().begin(),
+ E = getUnits().end();
I != E; ++I) {
- CompileUnit *TheCU = I->second;
+ CompileUnit *TheCU = *I;
const StringMap<std::vector<const DIE *> > &Names = TheCU->getAccelObjC();
for (StringMap<std::vector<const DIE *> >::const_iterator
GI = Names.begin(),
void DwarfDebug::emitAccelNamespaces() {
DwarfAccelTable AT(
DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4));
- for (DenseMap<const MDNode *, CompileUnit *>::iterator I = CUMap.begin(),
- E = CUMap.end();
+ for (SmallVectorImpl<CompileUnit *>::const_iterator I = getUnits().begin(),
+ E = getUnits().end();
I != E; ++I) {
- CompileUnit *TheCU = I->second;
+ CompileUnit *TheCU = *I;
const StringMap<std::vector<const DIE *> > &Names =
TheCU->getAccelNamespace();
for (StringMap<std::vector<const DIE *> >::const_iterator
Atoms.push_back(
DwarfAccelTable::Atom(dwarf::DW_ATOM_type_flags, dwarf::DW_FORM_data1));
DwarfAccelTable AT(Atoms);
- for (DenseMap<const MDNode *, CompileUnit *>::iterator I = CUMap.begin(),
- E = CUMap.end();
+ for (SmallVectorImpl<CompileUnit *>::const_iterator I = getUnits().begin(),
+ E = getUnits().end();
I != E; ++I) {
- CompileUnit *TheCU = I->second;
+ CompileUnit *TheCU = *I;
const StringMap<std::vector<std::pair<const DIE *, unsigned> > > &Names =
TheCU->getAccelTypes();
for (StringMap<
GnuStyle ? Asm->getObjFileLowering().getDwarfGnuPubNamesSection()
: Asm->getObjFileLowering().getDwarfPubNamesSection();
- typedef DenseMap<const MDNode *, CompileUnit *> CUMapType;
- for (CUMapType::iterator I = CUMap.begin(), E = CUMap.end(); I != E; ++I) {
- CompileUnit *TheCU = I->second;
+ for (SmallVectorImpl<CompileUnit *>::const_iterator I = getUnits().begin(),
+ E = getUnits().end();
+ I != E; ++I) {
+ CompileUnit *TheCU = *I;
unsigned ID = TheCU->getUniqueID();
// Start the dwarf pubnames section.
GnuStyle ? Asm->getObjFileLowering().getDwarfGnuPubTypesSection()
: Asm->getObjFileLowering().getDwarfPubTypesSection();
- for (DenseMap<const MDNode *, CompileUnit *>::iterator I = CUMap.begin(),
- E = CUMap.end();
+ for (SmallVectorImpl<CompileUnit *>::const_iterator I = getUnits().begin(),
+ E = getUnits().end();
I != E; ++I) {
- CompileUnit *TheCU = I->second;
+ CompileUnit *TheCU = *I;
// Start the dwarf pubtypes section.
Asm->OutStreamer.SwitchSection(PSec);
index db2b92ef7af7e0de7592ea3561b53ce4fbfebd3a..c89e9dae7737e1ba4fb9f41fcd6b1ea476ae06e9 100644 (file)
~DwarfUnits();
+ const SmallVectorImpl<CompileUnit *> &getUnits() { return CUs; }
+
/// \brief Compute the size and offset of a DIE given an incoming Offset.
unsigned computeSizeAndOffset(DIE *Die, unsigned Offset);
// Holder for the skeleton information.
DwarfUnits SkeletonHolder;
-private:
-
void addScopeVariable(LexicalScope *LS, DbgVariable *Var);
+ const SmallVectorImpl<CompileUnit *> &getUnits() {
+ return InfoHolder.getUnits();
+ }
+
/// \brief Find abstract variable associated with Var.
DbgVariable *findAbstractVariable(DIVariable &Var, DebugLoc Loc);
index 8ff367fa675dd5c299018b6cbaf720607f8bc477..df86576462e0e360b91fdebcb15a159aae1c5f0b 100644 (file)
; CHECK: DW_TAG_structure_type
; CHECK-NEXT: debug_str{{.*}}"wombat"
-; Don't emit pubtype entries for type DIEs in the compile unit that just indirect to a type unit.
+; Use the unit size as a rough hash/identifier for the unit we're dealing with
+; it happens to be unambiguous at the moment, but it's hardly ideal.
; CHECK-LABEL: .debug_pubtypes contents:
-; CHECK-NEXT: unit_offset = 0x00000000
-; CHECK-NEXT: Offset
-; CHECK-NEXT: {{^$}}
+; Don't emit pubtype entries for type DIEs in the compile unit that just indirect to a type unit.
+; CHECK-NEXT: unit_size = 0x00000174
+; CHECK-NEXT: Offset Name
+; Type unit for 'bar'
+; CHECK-NEXT: unit_size = 0x0000001f
+; CHECK-NEXT: Offset Name
+; CHECK-NEXT: "bar"
+; CHECK-NEXT: unit_size = 0x00000059
+; CHECK-NEXT: Offset Name
+; CHECK-NEXT: "int"
+; CHECK-NEXT: "echidna::capybara::mongoose::fluffy"
+; CHECK-NEXT: unit_size = 0x0000002f
+; CHECK-NEXT: Offset Name
+; CHECK-NEXT: "walrus"
+; CHECK-NEXT: unit_size = 0x0000003f
+; CHECK-NEXT: Offset Name
+; CHECK-NEXT: "int"
+; CHECK-NEXT: unit_size = 0x00000036
+; CHECK-NEXT: Offset Name
+; CHECK-NEXT: "wombat"
%struct.bar = type { i8 }
%"class.echidna::capybara::mongoose::fluffy" = type { i32, i32 }