llvm.org GIT mirror llvm / 181826c
Revert "Reapply "DebugInfo: Ensure that all debug location scope chains from instructions within a function, lead to the function itself."" This reverts commit r212776. Nope, still seems to be failing on the sanitizer bots... but hey, not the msan self-host anymore, it's failing in asan now. I'll start looking there next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212793 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 6 years ago
3 changed file(s) with 4 addition(s) and 34 deletion(s). Raw diff Collapse all Expand all
787787 for (const auto &Var : ConcreteVariables) {
788788 DIE *VariableDie = Var->getDIE();
789789 // FIXME: There shouldn't be any variables without DIEs.
790 assert(VariableDie);
790 if (!VariableDie)
791 continue;
791792 // FIXME: Consider the time-space tradeoff of just storing the unit pointer
792793 // in the ConcreteVariables list, rather than looking it up again here.
793794 // DIE::getUnit isn't simple - it walks parent pointers, etc.
136136 /// getOrCreateLexicalScope - Find lexical scope for the given DebugLoc. If
137137 /// not available then create new lexical scope.
138138 LexicalScope *LexicalScopes::getOrCreateLexicalScope(DebugLoc DL) {
139 if (DL.isUnknown())
140 return nullptr;
141139 MDNode *Scope = nullptr;
142140 MDNode *InlinedAt = nullptr;
143141 DL.getScopeAndInlinedAt(Scope, InlinedAt, MF->getFunction()->getContext());
173171 std::make_tuple(Parent, DIDescriptor(Scope),
174172 nullptr, false)).first;
175173
176 if (!Parent) {
177 assert(DIDescriptor(Scope).isSubprogram());
178 assert(DISubprogram(Scope).describes(MF->getFunction()));
179 assert(!CurrentFnLexicalScope);
174 if (!Parent && DIDescriptor(Scope).isSubprogram() &&
175 DISubprogram(Scope).describes(MF->getFunction()))
180176 CurrentFnLexicalScope = &I->second;
181 }
182177
183178 return &I->second;
184179 }
537537 if (isLValueReference() && isRValueReference())
538538 return false;
539539
540 if (auto *F = getFunction()) {
541 LLVMContext &Ctxt = F->getContext();
542 for (auto &BB : *F) {
543 for (auto &I : BB) {
544 DebugLoc DL = I.getDebugLoc();
545 if (DL.isUnknown())
546 continue;
547
548 MDNode *Scope = nullptr;
549 MDNode *IA = nullptr;
550 // walk the inlined-at scopes
551 while (DL.getScopeAndInlinedAt(Scope, IA, F->getContext()), IA)
552 DL = DebugLoc::getFromDILocation(IA);
553 DL.getScopeAndInlinedAt(Scope, IA, Ctxt);
554 assert(!IA);
555 while (!DIDescriptor(Scope).isSubprogram()) {
556 DILexicalBlockFile D(Scope);
557 Scope = D.isLexicalBlockFile()
558 ? D.getScope()
559 : DebugLoc::getFromDILexicalBlock(Scope).getScope(Ctxt);
560 }
561 if (!DISubprogram(Scope).describes(F))
562 return false;
563 }
564 }
565 }
566540 return DbgNode->getNumOperands() == 20;
567541 }
568542