summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-01-31 01:10:11 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-01-31 01:10:11 +0000
commit303facbeb8d9fabbc84eb7eb526f4bd2a070e585 (patch)
tree76ca0af5b5804d401f8bd13778eab54f96f53306 /clang
parent9fd4d085152c9e5defc526fe2fffe1b4ad51af2b (diff)
downloadbcm5719-llvm-303facbeb8d9fabbc84eb7eb526f4bd2a070e585.tar.gz
bcm5719-llvm-303facbeb8d9fabbc84eb7eb526f4bd2a070e585.zip
DebugInfo: Fix line table for comparisons harder/better for the sake of C (& the GDB buildbot)
llvm-svn: 227663
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp6
-rw-r--r--clang/test/CodeGen/debug-info-line.c11
2 files changed, 16 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index ae78aa00e3a..e152bfd7491 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -1190,7 +1190,11 @@ void CodeGenFunction::EmitBranchOnBoolExpr(const Expr *Cond,
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);
}
diff --git a/clang/test/CodeGen/debug-info-line.c b/clang/test/CodeGen/debug-info-line.c
new file mode 100644
index 00000000000..2e044d2ab37
--- /dev/null
+++ b/clang/test/CodeGen/debug-info-line.c
@@ -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,
OpenPOWER on IntegriCloud