r228589 - DebugInfo: Suppress the location of instructions in complex default arguments.

David Blaikie dblaikie at gmail.com
Mon Feb 9 10:55:57 PST 2015


Author: dblaikie
Date: Mon Feb  9 12:55:57 2015
New Revision: 228589

URL: http://llvm.org/viewvc/llvm-project?rev=228589&view=rev
Log:
DebugInfo: Suppress the location of instructions in complex default arguments.

Modified:
    cfe/trunk/lib/CodeGen/CGExprComplex.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-line.cpp

Modified: cfe/trunk/lib/CodeGen/CGExprComplex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprComplex.cpp?rev=228589&r1=228588&r2=228589&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprComplex.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprComplex.cpp Mon Feb  9 12:55:57 2015
@@ -1033,8 +1033,14 @@ ComplexPairTy CodeGenFunction::EmitCompl
   assert(E && getComplexType(E->getType()) &&
          "Invalid complex expression to emit");
 
-  return ComplexExprEmitter(*this, IgnoreReal, IgnoreImag)
-    .Visit(const_cast<Expr*>(E));
+  bool hasDebugInfo = getDebugInfo();
+  if (isa<CXXDefaultArgExpr>(E))
+    disableDebugInfo();
+  auto R = ComplexExprEmitter(*this, IgnoreReal, IgnoreImag)
+                .Visit(const_cast<Expr *>(E));
+  if (isa<CXXDefaultArgExpr>(E) && hasDebugInfo)
+    enableDebugInfo();
+  return R;
 }
 
 void CodeGenFunction::EmitComplexExprIntoLValue(const Expr *E, LValue dest,

Modified: cfe/trunk/test/CodeGenCXX/debug-info-line.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-line.cpp?rev=228589&r1=228588&r2=228589&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-line.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-line.cpp Mon Feb  9 12:55:57 2015
@@ -285,6 +285,14 @@ void f23() {
   f23_b();
 }
 
+// CHECK-LABEL: define
+void f24_a(__complex float = complex_src());
+void f24() {
+// CHECK: call {{.*}}complex_src{{.*}}, !dbg [[DBG_F24:![0-9]*]]
+#line 2600
+  f24_a();
+}
+
 // CHECK: [[DBG_F1]] = !MDLocation(line: 100,
 // CHECK: [[DBG_FOO_VALUE]] = !MDLocation(line: 200,
 // CHECK: [[DBG_FOO_REF]] = !MDLocation(line: 202,
@@ -314,3 +322,4 @@ void f23() {
 // CHECK: [[DBG_F19_2]] = !MDLocation(line: 2101,
 // CHECK: [[DBG_F20_1]] = !MDLocation(line: 2200,
 // CHECK: [[DBG_F23]] = !MDLocation(line: 2500,
+// CHECK: [[DBG_F24]] = !MDLocation(line: 2600,





More information about the cfe-commits mailing list