[PATCH] D38830: [DWARF] Fix bad comparator in sortGlobalExprs.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 11 17:27:01 PDT 2017
efriedma added a comment.
See also https://bugs.llvm.org//show_bug.cgi?id=34921 .
> you should be able to strip out everything from the IR that is not a global variable and not reachable via a !DIGlobalVariable metadata node
Okay. Actually, I probably also need to dump out the IR sometime after GlobalMerge runs (for some reason, the crash doesn't trigger otherwise), but I'll figure something out.
================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:514
+ if (!A.Expr || !B.Expr)
+ return !!B.Expr;
+ auto FragmentA = A.Expr->getFragmentInfo();
----------------
aprantl wrote:
> Does `return !A.Expr` achieve the same thing and is easier to read?
Suppose A.Expr and B.Expr are null. Then the comparator should return false, but !A.Expr is true.
Repository:
rL LLVM
https://reviews.llvm.org/D38830
More information about the llvm-commits
mailing list