[PATCH] D136204: [BOLT][DWARF] Add support for DW_FORM_addr for DW_AT_call_return_pc

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 17:30:44 PDT 2022


maksfb added inline comments.


================
Comment at: bolt/lib/Rewrite/DWARFRewriter.cpp:507
+        if (AttrVal.V.getForm() == dwarf::DW_FORM_addrx) {
+          uint32_t Index =
+              AddrWriter->getIndexFromAddress(UpdatedAddress, Unit);
----------------
nit:


================
Comment at: bolt/lib/Rewrite/DWARFRewriter.cpp:510
           DebugInfoPatcher.addUDataPatch(AttrVal.Offset, Index, AttrVal.Size);
+        } else if (AttrVal.V.getForm() == dwarf::DW_FORM_addr)
+          DebugInfoPatcher.addLE32Patch(AttrVal.Offset, UpdatedAddress);
----------------
nit: use curly braces for the `else` block(s) if you've used them for the `if` block.


================
Comment at: bolt/lib/Rewrite/DWARFRewriter.cpp:511
+        } else if (AttrVal.V.getForm() == dwarf::DW_FORM_addr)
+          DebugInfoPatcher.addLE32Patch(AttrVal.Offset, UpdatedAddress);
         else
----------------
Probably no need to update the address if it hasn't changed to reduce the number of patches?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136204/new/

https://reviews.llvm.org/D136204



More information about the llvm-commits mailing list