summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-30 22:58:19 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-30 22:58:19 +0000
commit899ae61feed7e1025eff022ad908d4152a9b5fe0 (patch)
tree6e896f52f893db3a1a1461f8cc62ca17029236a2 /llvm/lib/CodeGen/AsmPrinter
parent3c10817b927ad9aa1e48bc85f29e47bfc4736b0e (diff)
downloadbcm5719-llvm-899ae61feed7e1025eff022ad908d4152a9b5fe0.tar.gz
bcm5719-llvm-899ae61feed7e1025eff022ad908d4152a9b5fe0.zip
Revert "Emit DW_AT_object_pointer once, on the declaration, for each function."
Breaks GDB buildbot (http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/14517) GCC emits DW_AT_object_pointer /everywhere/ (declaration, abstract definition, inlined subroutine), but it looks like GCC relies on it being somewhere other than the declaration, at least. I'll experiment further & can hopefully still remove it from the inlined_subroutine. This reverts commit r207705. llvm-svn: 207719
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp13
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h2
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp9
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h2
4 files changed, 8 insertions, 18 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 6960ec94551..91a7b6e53aa 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -557,16 +557,11 @@ DIE *DwarfDebug::createScopeChildrenDIE(
}
void DwarfDebug::createAndAddScopeChildren(DwarfCompileUnit &TheCU,
- LexicalScope *Scope,
- DISubprogram Sub, DIE &ScopeDIE) {
+ LexicalScope *Scope, DIE &ScopeDIE) {
// We create children when the scope DIE is not null.
SmallVector<std::unique_ptr<DIE>, 8> Children;
if (DIE *ObjectPointer = createScopeChildrenDIE(TheCU, Scope, Children))
- // The declaration will have the object_pointer, otherwise put it on the
- // definition. This happens with ObjC blocks that have object_pointer on
- // non-member functions.
- if (!Sub.getFunctionDeclaration())
- TheCU.addDIEEntry(ScopeDIE, dwarf::DW_AT_object_pointer, *ObjectPointer);
+ TheCU.addDIEEntry(ScopeDIE, dwarf::DW_AT_object_pointer, *ObjectPointer);
// Add children
for (auto &I : Children)
@@ -585,7 +580,7 @@ void DwarfDebug::constructAbstractSubprogramScopeDIE(DwarfCompileUnit &TheCU,
if (DIE *ScopeDIE = TheCU.getDIE(Sub)) {
AbstractSPDies.insert(std::make_pair(Sub, ScopeDIE));
- createAndAddScopeChildren(TheCU, Scope, Sub, *ScopeDIE);
+ createAndAddScopeChildren(TheCU, Scope, *ScopeDIE);
}
}
@@ -602,7 +597,7 @@ DIE &DwarfDebug::constructSubprogramScopeDIE(DwarfCompileUnit &TheCU,
DIE &ScopeDIE = updateSubprogramScopeDIE(TheCU, Sub);
- createAndAddScopeChildren(TheCU, Scope, Sub, ScopeDIE);
+ createAndAddScopeChildren(TheCU, Scope, ScopeDIE);
return ScopeDIE;
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index e0d7ef4d893..f0472e93f55 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -368,7 +368,7 @@ class DwarfDebug : public AsmPrinterHandler {
std::unique_ptr<DIE> constructScopeDIE(DwarfCompileUnit &TheCU,
LexicalScope *Scope);
void createAndAddScopeChildren(DwarfCompileUnit &TheCU, LexicalScope *Scope,
- DISubprogram Sub, DIE &ScopeDIE);
+ DIE &ScopeDIE);
/// \brief Construct a DIE for this abstract scope.
void constructAbstractSubprogramScopeDIE(DwarfCompileUnit &TheCU,
LexicalScope *Scope);
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index d37dcf27378..2d7e1c93dd5 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -1164,8 +1164,7 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, DIDerivedType DTy) {
}
/// constructSubprogramArguments - Construct function argument DIEs.
-DIE *DwarfUnit::constructSubprogramArguments(DIE &Buffer, DIArray Args) {
- DIE *ObjectPointer = nullptr;
+void DwarfUnit::constructSubprogramArguments(DIE &Buffer, DIArray Args) {
for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) {
DIDescriptor Ty = Args.getElement(i);
if (Ty.isUnspecifiedParameter()) {
@@ -1176,11 +1175,8 @@ DIE *DwarfUnit::constructSubprogramArguments(DIE &Buffer, DIArray Args) {
addType(Arg, DIType(Ty));
if (DIType(Ty).isArtificial())
addFlag(Arg, dwarf::DW_AT_artificial);
- if (DIType(Ty).isObjectPointer())
- ObjectPointer = &Arg;
}
}
- return ObjectPointer;
}
/// constructTypeDIE - Construct type DIE from DICompositeType.
@@ -1501,8 +1497,7 @@ DIE *DwarfUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
// Add arguments. Do not add arguments for subprogram definition. They will
// be handled while processing variables.
- if (DIE *ObjectPointer = constructSubprogramArguments(SPDie, Args))
- addDIEEntry(SPDie, dwarf::DW_AT_object_pointer, *ObjectPointer);
+ constructSubprogramArguments(SPDie, Args);
}
if (SP.isArtificial())
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
index 5beae1e29c4..b2ac647e00e 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
@@ -418,7 +418,7 @@ public:
AbstractOrInlined AbsIn = AOI_None);
/// constructSubprogramArguments - Construct function argument DIEs.
- DIE *constructSubprogramArguments(DIE &Buffer, DIArray Args);
+ void constructSubprogramArguments(DIE &Buffer, DIArray Args);
/// Create a DIE with the given Tag, add the DIE to its parent, and
/// call insertDIE if MD is not null.
OpenPOWER on IntegriCloud