Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 231537a

Browse files
committed
Revert "DebugInfo: Ensure that all debug location scope chains from instructions within a function, lead to the function itself."
This reverts commit r212205. Reverting this again, still seeing crashes when building compiler-rt... Sorry for the continued noise, not sure why I'm failing to reproduce this locally. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212226 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent fddd7ad commit 231537a

File tree

3 files changed

+4
-34
lines changed

3 files changed

+4
-34
lines changed

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,8 @@ void DwarfDebug::finishVariableDefinitions() {
788788
for (const auto &Var : ConcreteVariables) {
789789
DIE *VariableDie = Var->getDIE();
790790
// FIXME: There shouldn't be any variables without DIEs.
791-
assert(VariableDie);
791+
if (!VariableDie)
792+
continue;
792793
// FIXME: Consider the time-space tradeoff of just storing the unit pointer
793794
// in the ConcreteVariables list, rather than looking it up again here.
794795
// DIE::getUnit isn't simple - it walks parent pointers, etc.

lib/CodeGen/LexicalScopes.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ LexicalScope *LexicalScopes::findLexicalScope(DebugLoc DL) {
137137
/// getOrCreateLexicalScope - Find lexical scope for the given DebugLoc. If
138138
/// not available then create new lexical scope.
139139
LexicalScope *LexicalScopes::getOrCreateLexicalScope(DebugLoc DL) {
140-
if (DL.isUnknown())
141-
return nullptr;
142140
MDNode *Scope = nullptr;
143141
MDNode *InlinedAt = nullptr;
144142
DL.getScopeAndInlinedAt(Scope, InlinedAt, MF->getFunction()->getContext());
@@ -174,12 +172,9 @@ LexicalScope *LexicalScopes::getOrCreateRegularScope(MDNode *Scope) {
174172
std::make_tuple(Parent, DIDescriptor(Scope),
175173
nullptr, false)).first;
176174

177-
if (!Parent) {
178-
assert(DIDescriptor(Scope).isSubprogram());
179-
assert(DISubprogram(Scope).describes(MF->getFunction()));
180-
assert(!CurrentFnLexicalScope);
175+
if (!Parent && DIDescriptor(Scope).isSubprogram() &&
176+
DISubprogram(Scope).describes(MF->getFunction()))
181177
CurrentFnLexicalScope = &I->second;
182-
}
183178

184179
return &I->second;
185180
}

lib/IR/DebugInfo.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -538,32 +538,6 @@ bool DISubprogram::Verify() const {
538538
if (isLValueReference() && isRValueReference())
539539
return false;
540540

541-
if (auto *F = getFunction()) {
542-
LLVMContext &Ctxt = F->getContext();
543-
for (auto &BB : *F) {
544-
for (auto &I : BB) {
545-
DebugLoc DL = I.getDebugLoc();
546-
if (DL.isUnknown())
547-
continue;
548-
549-
MDNode *Scope = nullptr;
550-
MDNode *IA = nullptr;
551-
// walk the inlined-at scopes
552-
while (DL.getScopeAndInlinedAt(Scope, IA, F->getContext()), IA)
553-
DL = DebugLoc::getFromDILocation(IA);
554-
DL.getScopeAndInlinedAt(Scope, IA, Ctxt);
555-
assert(!IA);
556-
while (!DIDescriptor(Scope).isSubprogram()) {
557-
DILexicalBlockFile D(Scope);
558-
Scope = D.isLexicalBlockFile()
559-
? D.getScope()
560-
: DebugLoc::getFromDILexicalBlock(Scope).getScope(Ctxt);
561-
}
562-
if (!DISubprogram(Scope).describes(F))
563-
return false;
564-
}
565-
}
566-
}
567541
return DbgNode->getNumOperands() == 20;
568542
}
569543

0 commit comments

Comments
 (0)