summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-08-29 22:05:26 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-08-29 22:05:26 +0000
commit71fffa950aa4f1e043ef73a982191c8a404c8360 (patch)
tree140c6919b8ba22cebf766d8f49e335c37a756be5 /llvm/lib/CodeGen
parent02118cedd5c85f8288e55f96afd5a422e5b3a0ac (diff)
downloadbcm5719-llvm-71fffa950aa4f1e043ef73a982191c8a404c8360.tar.gz
bcm5719-llvm-71fffa950aa4f1e043ef73a982191c8a404c8360.zip
Stuff
llvm-svn: 216787
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 7f8d152a691..69cc8d8d695 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -751,6 +751,11 @@ void DwarfDebug::beginModule() {
for (MDNode *N : CU_Nodes->operands()) {
DICompileUnit CUNode(N);
DwarfCompileUnit &CU = constructDwarfCompileUnit(CUNode);
+ DIArray SPs = CUNode.getSubprograms();
+ for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++i)
+ SPMap.insert(std::make_pair(SPs.getElement(i), &CU));
+ if (CU.getCUNode().getEmissionKind() == DIBuilder::LineTablesOnly)
+ continue;
DIArray ImportedEntities = CUNode.getImportedEntities();
for (unsigned i = 0, e = ImportedEntities.getNumElements(); i != e; ++i)
ScopesWithImportedEntities.push_back(std::make_pair(
@@ -761,9 +766,6 @@ void DwarfDebug::beginModule() {
DIArray GVs = CUNode.getGlobalVariables();
for (unsigned i = 0, e = GVs.getNumElements(); i != e; ++i)
CU.createGlobalVariableDIE(DIGlobalVariable(GVs.getElement(i)));
- DIArray SPs = CUNode.getSubprograms();
- for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++i)
- SPMap.insert(std::make_pair(SPs.getElement(i), &CU));
DIArray EnumTypes = CUNode.getEnumTypes();
for (unsigned i = 0, e = EnumTypes.getNumElements(); i != e; ++i) {
DIType Ty(EnumTypes.getElement(i));
@@ -833,12 +835,13 @@ void DwarfDebug::finishSubprogramDefinitions() {
// If this subprogram has an abstract definition, reference that
SPCU->addDIEEntry(*D, dwarf::DW_AT_abstract_origin, *AbsSPDIE);
} else {
- if (!D)
+ if (!D && TheCU.getEmissionKind() != DIBuilder::LineTablesOnly)
// Lazily construct the subprogram if we didn't see either concrete or
// inlined versions during codegen.
D = SPCU->getOrCreateSubprogramDIE(SP);
- // And attach the attributes
- SPCU->applySubprogramAttributesToDefinition(SP, *D);
+ if (D)
+ // And attach the attributes
+ SPCU->applySubprogramAttributesToDefinition(SP, *D);
}
}
}
@@ -1667,6 +1670,17 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
LexicalScope *FnScope = LScopes.getCurrentFunctionScope();
DwarfCompileUnit &TheCU = *SPMap.lookup(FnScope->getScopeNode());
+ if (TheCU.getCUNode().getEmissionKind() == DIBuilder::LineTablesOnly && LScopes.getAbstractScopesList().empty()) {
+ assert(ScopeVariables.empty());
+ assert(CurrentFnArguments.empty());
+ assert(DbgValues.empty());
+ assert(AbstractVariables.empty());
+ LabelsBeforeInsn.clear();
+ LabelsAfterInsn.clear();
+ PrevLabel = nullptr;
+ CurFn = nullptr;
+ return;
+ }
// Construct abstract scopes.
for (LexicalScope *AScope : LScopes.getAbstractScopesList()) {
OpenPOWER on IntegriCloud