summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-06-13 22:35:44 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-06-13 22:35:44 +0000
commitf154f3b59239def7a33a8e0d4bce0f9165247b47 (patch)
treea5610ce3edbb73a7f8163435c4cc973352423fdb /lib/CodeGen
parent869d3efac9f13b12e36255aaf5ae88c8e05347df (diff)
downloadllvm-f154f3b59239def7a33a8e0d4bce0f9165247b47.tar.gz
llvm-f154f3b59239def7a33a8e0d4bce0f9165247b47.tar.bz2
llvm-f154f3b59239def7a33a8e0d4bce0f9165247b47.tar.xz
DebugInfo: Reference abstract definitions from variables in concrete definitions that preceed their first inline definition.
Rather than relying on abstract variables looked up at the time the concrete variable is created, look them up at the end of the module to ensure they're referenced even if they're created after the concrete definition. This completes/matches the work done in r209677 to handle this for the subprograms themselves. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp7
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 1eb88b9178..77bb77d4a5 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -791,7 +791,7 @@ void DwarfDebug::finishVariableDefinitions() {
// DIE::getUnit isn't simple - it walks parent pointers, etc.
DwarfCompileUnit *Unit = lookupUnit(VariableDie->getUnit());
assert(Unit);
- DbgVariable *AbsVar = Var->getAbstractVariable();
+ DbgVariable *AbsVar = getExistingAbstractVariable(Var->getVariable());
if (AbsVar && AbsVar->getDIE()) {
Unit->addDIEEntry(*VariableDie, dwarf::DW_AT_abstract_origin,
*AbsVar->getDIE());
@@ -1081,6 +1081,11 @@ DbgVariable *DwarfDebug::getExistingAbstractVariable(const DIVariable &DV,
return nullptr;
}
+DbgVariable *DwarfDebug::getExistingAbstractVariable(const DIVariable &DV) {
+ DIVariable Cleansed;
+ return getExistingAbstractVariable(DV, Cleansed);
+}
+
DbgVariable *DwarfDebug::createAbstractVariable(DIVariable &Var,
LexicalScope *Scope) {
auto AbsDbgVariable = make_unique<DbgVariable>(Var, nullptr, this);
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 88b8a674b3..8445b74798 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -346,6 +346,7 @@ class DwarfDebug : public AsmPrinterHandler {
/// \brief Find abstract variable associated with Var.
DbgVariable *getExistingAbstractVariable(const DIVariable &DV,
DIVariable &Cleansed);
+ DbgVariable *getExistingAbstractVariable(const DIVariable &DV);
DbgVariable *createAbstractVariable(DIVariable &DV, LexicalScope *Scope);
DbgVariable *getOrCreateAbstractVariable(DIVariable &Var,
const MDNode *Scope);