[cfe-dev] Optionally suppress debug info for inlined calls?

Robinson, Paul Paul_Robinson at playstation.sony.com
Mon Nov 25 18:40:31 PST 2013


> What's the patch look like to do this?
> 
> -eric

Aside from the usual wiring up driver->clang->llvm to pass
a flag down, there are 3 places that needed to be tweaked.
In DwarfDebug.cpp, DwarfDebug::beginInstruction() needs some
minor remodeling to chase the DL.getInlinedAt() chain, to find 
the source loc of the original call site. I don't recall for
certain but I think treating these instructions as "unknown"
didn't work because there might not be any instructions left
from the original call, so we have to put the call-site loc
on something.
Also in DwarfDebug.cpp, DwarfDebug::constructScopeDIE() needs
to bail out before doing any actual work.
Then up in Clang, CGExpr.cpp had code to stuff in a column
number at the call site even if column info is suppressed, and
that shouldn't happen if we're suppressing the inlined scope.

Doing the filtering on the output side like this is clearly
much easier when you're suppressing everything.  Doing the
fancier footwork (adequate to allow DW_AT_inline to tell the
truth) is way more involved, I think, but once that's
demonstrably correct (as we will be able to tell from looking
at what the new-and-improved DW_AT_inline says) then I would
expect it to be not-hard to rewire -gno-inlined-scopes to
use the same info and dial back the scopes that actually get
suppressed.

--paulr






More information about the cfe-dev mailing list