[PATCH] D37529: [codeview] omit debug locations for nested exprs unless column info enabled

Bob Haarman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 15:20:06 PDT 2017


inglorion added inline comments.


================
Comment at: clang/test/CodeGenCXX/debug-info-nested-exprs.cpp:44
+  int a = bar(x, y) +
+          baz(x, z) +
+          qux(y, z);
----------------
zturner wrote:
> inglorion wrote:
> > zturner wrote:
> > > Can you make a function called `int foo()` and make this `int a = bar(foo(), y) + ...`
> > Yes. Why? To test an additional level of nesting?
> Yes.  for that matter, even better would be if this call to `foo()` spans multiple lines.  Right here you've got a single statement which spans multiple lines, but no individual sub-expression spans multiple lines.  And FWICT there is no nesting at all, since + is just a builtin operator.
The nesting here is the calls to bar, baz, and qux inside the declaration of a. The old behavior would emit separate locations for each of the calls, the new behavior annotates each of the calls with the same location as the declaration. This causes the debugger to stop only once for the entire statement when using step over, and makes step into specific work.


https://reviews.llvm.org/D37529





More information about the cfe-commits mailing list