[PATCH] D43036: Use a stable topological sort instead of std::stable_sort in DIE *DwarfCompileUnit::createScopeChildrenDIE()

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 16:47:15 PST 2018


aprantl closed this revision.
aprantl added a comment.

Thanks! Landed as r324677.



================
Comment at: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:637
+      auto Var = dyn_cast_or_null<const DILocalVariable>(Dependency);
+      WorkList.push_back({DbgVar[Var], 0});
+    }
----------------
vsapsai wrote:
> What would happen and if it is even possible if `Dependency` is not a local variable?
> 
> And in this case `dyn_cast<>` should be enough, we don't add nullptr dependencies.
In theory a frontend could produce metadata where the count is a global variable. This doesn't make much sense in practice, but we don't reject it in the verifier, so we might as well handle it gracefully.


https://reviews.llvm.org/D43036





More information about the llvm-commits mailing list