<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 9, 2015 at 11:07 AM, Frédéric Riss <span dir="ltr"><<a href="mailto:friss@apple.com" target="_blank">friss@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On Feb 9, 2015, at 10:47 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
><br>
> Author: dblaikie<br>
> Date: Mon Feb  9 12:47:14 2015<br>
> New Revision: 228588<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=228588&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=228588&view=rev</a><br>
> Log:<br>
> DebugInfo: Suppress the location of instructions in aggregate default arguments.<br>
><br>
> Matches the existing code for scalar default arguments. Complex default<br>
> arguments probably need the same handling too (test/fix to that coming<br>
> next).<br>
<br>
</span>What was the behavior before that? Was the location set to the declaration with the default argument description?</blockquote><div><br>Yes<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> I think I wouldn’t matter my debugger jumping there when the code actually does something non-trivial to initialize the argument(s).<br></blockquote><div><br>Perhaps - though it is a bit jarring whenever you step passed a std::string, std::vector, etc ctor and leap into the standard library header to see the Allocator() ctor call, then go back to your code.<br><br>I do wonder if maybe the same is_stmt change we're discussing for dtors would be suitable here, so you don't step to it, but it does appear in the backtrace. Still awkward line table entry "foo() : basic_string:20473" or something - "wait, foo isn't in basic_string...".<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Fred<br>
<div class="HOEnZb"><div class="h5"><br>
> Modified:<br>
>    cfe/trunk/lib/CodeGen/CGExprAgg.cpp<br>
>    cfe/trunk/test/CodeGenCXX/debug-info-line.cpp<br>
><br>
> Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=228588&r1=228587&r2=228588&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=228588&r1=228587&r2=228588&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)<br>
> +++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Mon Feb  9 12:47:14 2015<br>
> @@ -1387,7 +1387,12 @@ void CodeGenFunction::EmitAggExpr(const<br>
>   // Optimize the slot if possible.<br>
>   CheckAggExprForMemSetUse(Slot, E, *this);<br>
><br>
> +  bool hasDebugInfo = getDebugInfo();<br>
> +  if (isa<CXXDefaultArgExpr>(E))<br>
> +    disableDebugInfo();<br>
>   AggExprEmitter(*this, Slot).Visit(const_cast<Expr*>(E));<br>
> +  if (isa<CXXDefaultArgExpr>(E) && hasDebugInfo)<br>
> +    enableDebugInfo();<br>
> }<br>
><br>
> LValue CodeGenFunction::EmitAggExprToLValue(const Expr *E) {<br>
><br>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-line.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-line.cpp?rev=228588&r1=228587&r2=228588&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-line.cpp?rev=228588&r1=228587&r2=228588&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/test/CodeGenCXX/debug-info-line.cpp (original)<br>
> +++ cfe/trunk/test/CodeGenCXX/debug-info-line.cpp Mon Feb  9 12:47:14 2015<br>
> @@ -274,6 +274,17 @@ void f22() {<br>
>   }<br>
> }<br>
><br>
> +// CHECK-LABEL: define<br>
> +struct f23_struct {<br>
> +};<br>
> +f23_struct f23_a();<br>
> +void f23_b(f23_struct = f23_a());<br>
> +void f23() {<br>
> +// CHECK: call {{.*}}f23_a{{.*}}, !dbg [[DBG_F23:![0-9]*]]<br>
> +#line 2500<br>
> +  f23_b();<br>
> +}<br>
> +<br>
> // CHECK: [[DBG_F1]] = !MDLocation(line: 100,<br>
> // CHECK: [[DBG_FOO_VALUE]] = !MDLocation(line: 200,<br>
> // CHECK: [[DBG_FOO_REF]] = !MDLocation(line: 202,<br>
> @@ -302,3 +313,4 @@ void f22() {<br>
> // CHECK: [[DBG_F19_1]] = !MDLocation(line: 2100,<br>
> // CHECK: [[DBG_F19_2]] = !MDLocation(line: 2101,<br>
> // CHECK: [[DBG_F20_1]] = !MDLocation(line: 2200,<br>
> +// CHECK: [[DBG_F23]] = !MDLocation(line: 2500,<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br>
</div></div></blockquote></div><br></div></div>