This is an archive of the discontinued LLVM Phabricator instance.

[BOLT][DWARF] Add support for DW_FORM_addr for DW_AT_call_return_pc
ClosedPublic

Authored by ayermolo on Oct 18 2022, 2:58 PM.

Details

Summary

GCC 12 produces DW_FORM_addr for DW_AT_call_return_pc. Added support for that.
Fixes facebookincubator/BOLT#307

Diff Detail

Event Timeline

ayermolo created this revision.Oct 18 2022, 2:58 PM
Herald added a reviewer: Amir. · View Herald Transcript
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
ayermolo requested review of this revision.Oct 18 2022, 2:58 PM
Herald added a project: Restricted Project. · View Herald Transcript
ayermolo edited the summary of this revision. (Show Details)Oct 18 2022, 2:58 PM
ayermolo edited the summary of this revision. (Show Details)Oct 18 2022, 4:53 PM
ayermolo updated this revision to Diff 468747.Oct 18 2022, 4:57 PM

fix for unit test

maksfb added inline comments.Oct 18 2022, 5:30 PM
bolt/lib/Rewrite/DWARFRewriter.cpp
507

nit:

510

nit: use curly braces for the else block(s) if you've used them for the if block.

511

Probably no need to update the address if it hasn't changed to reduce the number of patches?

ayermolo added inline comments.Oct 18 2022, 8:52 PM
bolt/lib/Rewrite/DWARFRewriter.cpp
510

I was wondering about that.
Is it because of
"Similarly, braces should be used when a single-statement body is complex enough that it becomes difficult to see where the block containing the following statement began. An if/else chain or a loop is considered a single statement for this rule, and this rule applies recursively."

511

I was going for simpler logic. I doubt it will add that many more patches.

maksfb added inline comments.Oct 18 2022, 10:10 PM
bolt/lib/Rewrite/DWARFRewriter.cpp
510

It mostly b/c of: "... readability is also harmed if an if/else chain does not use braced bodies for either all or none of its members..."

511

Okay.

maksfb accepted this revision.Oct 19 2022, 8:37 AM
This revision is now accepted and ready to land.Oct 19 2022, 8:37 AM
ayermolo marked 5 inline comments as done.Oct 19 2022, 10:21 AM