[Lldb-commits] [PATCH] D91734: [FastISel] Flush local value map on every instruction
David Blaikie via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Dec 2 16:06:10 PST 2020
dblaikie added a comment.
Sometihng like this seems plausible to me:
$ git diff
diff --git clang/lib/CodeGen/CGExprScalar.cpp clang/lib/CodeGen/CGExprScalar.cpp
index c906af8a4afa..c85ce46508a6 100644
--- clang/lib/CodeGen/CGExprScalar.cpp
+++ clang/lib/CodeGen/CGExprScalar.cpp
@@ -4187,6 +4187,7 @@ Value *ScalarExprEmitter::VisitBinLAnd(const BinaryOperator *E) {
// setting up the PHI node in the Cont Block for this.
llvm::PHINode *PN = llvm::PHINode::Create(llvm::Type::getInt1Ty(VMContext), 2,
"", ContBlock);
+ PN->setDebugLoc(Builder.getCurrentDebugLocation());
for (llvm::pred_iterator PI = pred_begin(ContBlock), PE = pred_end(ContBlock);
PI != PE; ++PI)
PN->addIncoming(llvm::ConstantInt::getFalse(VMContext), *PI);
@@ -4209,12 +4210,6 @@ Value *ScalarExprEmitter::VisitBinLAnd(const BinaryOperator *E) {
// Insert an entry into the phi node for the edge with the value of RHSCond.
PN->addIncoming(RHSCond, RHSBlock);
- // Artificial location to preserve the scope information
- {
- auto NL = ApplyDebugLocation::CreateArtificial(CGF);
- PN->setDebugLoc(Builder.getCurrentDebugLocation());
- }
-
// ZExt result to int.
return Builder.CreateZExtOrBitCast(PN, ResTy, "land.ext");
}
diff --git clang/test/CodeGen/debug-info-inline-for.c clang/test/CodeGen/debug-info-inline-for.c
index 55066b28a1ff..5d1b1e7fc3bd 100644
--- clang/test/CodeGen/debug-info-inline-for.c
+++ clang/test/CodeGen/debug-info-inline-for.c
@@ -10,4 +10,4 @@ int func(int n) {
// CHECK: land.end:
// CHECK-NEXT: {{.*}} = phi i1 {{.*}} !dbg ![[DbgLoc:[0-9]+]]
-// CHECK: ![[DbgLoc]] = !DILocation(line: 0
+// CHECK: ![[DbgLoc]] = !DILocation(line: 6, column: 19
Not sure if it addresses all of the regressions though.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91734/new/
https://reviews.llvm.org/D91734
More information about the lldb-commits
mailing list