This is an archive of the discontinued LLVM Phabricator instance.

Extend debug info for function parameters in SDAG.
ClosedPublic

Authored by eugenis on Nov 25 2015, 3:58 PM.

Details

Summary

SDAG currently can emit debug location for function parameters when
an llvm.dbg.declare points to either a function argument SSA temp,
or to an AllocaInst. This change extends this logic by adding a
fallback case when neither of the above is true.

This is required for SafeStack, which may copy the contents of a
byval function argument into something that is not an alloca, and
then describe the target as the new location of the said argument.

Diff Detail

Repository
rL LLVM

Event Timeline

eugenis updated this revision to Diff 41194.Nov 25 2015, 3:58 PM
eugenis retitled this revision from to Extend debug info for function parameters in SDAG..
eugenis updated this object.
eugenis added a reviewer: pcc.
eugenis set the repository for this revision to rL LLVM.
eugenis added a subscriber: llvm-commits.

This should probably be reviewed by a debug info expert.

aprantl edited edge metadata.Nov 30 2015, 9:01 AM

Looks like a good change to me.
Instead of checking the final DWARF output in the test case, I think it would be preferable to use MIR serialization (llc -stop-after) and immediately check the result after SDAG is finished.

eugenis updated this revision to Diff 41449.Nov 30 2015, 4:00 PM
eugenis edited edge metadata.

Looks like a good change to me.
Instead of checking the final DWARF output in the test case, I think it would be preferable to use MIR serialization (llc -stop-after) and immediately check the result after SDAG is finished.

Done.

aprantl accepted this revision.Nov 30 2015, 4:09 PM
aprantl edited edge metadata.
This revision is now accepted and ready to land.Nov 30 2015, 4:09 PM
eugenis closed this revision.Nov 30 2015, 4:37 PM

r254352
Thanks for the review.