[PATCH] D113864: Don't add irrelevant items to queue in DwarfCompileUnit::createScopeChildrenDIE (NFC)
Aaron Puchert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 14 14:44:53 PST 2021
aaronpuchert updated this revision to Diff 387136.
aaronpuchert added a comment.
Also use the non-modifying `DenseMapBase::lookup` instead of `operator[]`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113864/new/
https://reviews.llvm.org/D113864
Files:
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
Index: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -980,9 +980,7 @@
bool visitedAllDependencies = Item.getInt();
WorkList.pop_back();
- // Dependency is in a different lexical scope or a global.
- if (!Var)
- continue;
+ assert(Var);
// Already handled.
if (Visited.count(Var))
@@ -1006,8 +1004,10 @@
// visited again after all of its dependencies are handled.
WorkList.push_back({Var, 1});
for (auto *Dependency : dependencies(Var)) {
- auto Dep = dyn_cast_or_null<const DILocalVariable>(Dependency);
- WorkList.push_back({DbgVar[Dep], 0});
+ // Don't add dependency if it is in a different lexical scope or a global.
+ if (const auto *Dep = dyn_cast<const DILocalVariable>(Dependency))
+ if (DbgVariable *Var = DbgVar.lookup(Dep))
+ WorkList.push_back({Var, 0});
}
}
return Result;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113864.387136.patch
Type: text/x-patch
Size: 1066 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211114/dc125a3c/attachment.bin>
More information about the llvm-commits
mailing list