[PATCH] Fixing line numbers of inlined allocas

Wolfgang Pieb wolfgang_pieb at playstation.sony.com
Wed Oct 15 13:01:33 PDT 2014


>>! In D5401#13, @dblaikie wrote:

> What would happen to your test case if we had nodebug on the callee? I guess your solution would still work for that (adjusting the debugloc of the allocas) - maybe we're just going to have to clear the allocas' DebugLocs anyway?

FWIW, nodebug on the callee doesn't change anything since the callee's allocas have no DebugLoc in either case.

My original thought of adjusting the allocas' DebugLocs instead of just removing them was that an inlined alloca is equivalent to a caller's alloca and should be treated as such in every respect, but that's probably not exactly correct wrt debug information.

> 
> To sum up:
> 
> If we special case non-debug functions when inlining, attributing their instructions to the call site, but non-debug instructions in debug functions were just persisted with no debug location then we'd still need to special case allocas from non-debug functions to avoid this bug in that case.
> 
> So it sounds like we need to special case the static allocas, but the special case should probably be to not add a debugloc for them (unlike other instructions).

Yes. I'll prepare another patch.

> 
> Then there remains an open question as to whether, for debugloc-less instructions in non-nodebug functions, should they be treated the same as instructions in nodebug functions (attributed to the call site) or unattributed? (for now I'm happy to leave them handled the same way as nodebug instructions, attributing them to the call site)

http://reviews.llvm.org/D5401






More information about the llvm-commits mailing list