r227663 - DebugInfo: Fix line table for comparisons harder/better for the sake of C (& the GDB buildbot)

David Blaikie dblaikie at gmail.com
Fri Jan 30 17:10:12 PST 2015


Author: dblaikie
Date: Fri Jan 30 19:10:11 2015
New Revision: 227663

URL: http://llvm.org/viewvc/llvm-project?rev=227663&view=rev
Log:
DebugInfo: Fix line table for comparisons harder/better for the sake of C (& the GDB buildbot)

Added:
    cfe/trunk/test/CodeGen/debug-info-line.c
Modified:
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=227663&r1=227662&r2=227663&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Fri Jan 30 19:10:11 2015
@@ -1190,7 +1190,11 @@ void CodeGenFunction::EmitBranchOnBoolEx
                                                   CurrentCount - TrueCount);
 
   // Emit the code with the fully general case.
-  llvm::Value *CondV = EvaluateExprAsBool(Cond);
+  llvm::Value *CondV;
+  {
+    ApplyDebugLocation DL(*this, Cond);
+    CondV = EvaluateExprAsBool(Cond);
+  }
   Builder.CreateCondBr(CondV, TrueBlock, FalseBlock, Weights);
 }
 

Added: cfe/trunk/test/CodeGen/debug-info-line.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info-line.c?rev=227663&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/debug-info-line.c (added)
+++ cfe/trunk/test/CodeGen/debug-info-line.c Fri Jan 30 19:10:11 2015
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -w -gline-tables-only -fexceptions -fcxx-exceptions -S -emit-llvm %s -o - | FileCheck %s
+
+int f1(int a, int b) {
+  // CHECK: icmp {{.*}}, !dbg [[DBG_F1:!.*]]
+#line 100
+  return a  //
+         && //
+         b;
+}
+
+// CHECK: [[DBG_F1]] = !MDLocation(line: 100,





More information about the cfe-commits mailing list