[PATCH] D107515: [DWARF] Expose raw bytes in DWARFExpression

Rafael Auler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 4 17:28:36 PDT 2021


rafauler created this revision.
rafauler added reviewers: jhenderson, dblaikie, MaskRay, JDevlieghere, aprantl.
rafauler requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This information is necessary for clients of DebugInfo that
do not want to process a DWARF expression, but just treat it as a blob
of data. In BOLT, for example, we need to read these expressions in
CFIs and write them back to the binary, unchanged, so having access to
the original expression encoding is a shortcut to avoid the need to
re-encode the entire expression when re-writing exception handling
info (CFIs).

This patch is an alternative to https://reviews.llvm.org/D98301, in
which we implement the support to re-encode these expressions. But
since we don't really need to change anything in these expressions,
we can just copy their bytes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107515

Files:
  llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h


Index: llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
===================================================================
--- llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
+++ llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
@@ -159,6 +159,8 @@
 
   bool operator==(const DWARFExpression &RHS) const;
 
+  StringRef getData() const { return Data.getData(); }
+
 private:
   DataExtractor Data;
   uint8_t AddressSize;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107515.364299.patch
Type: text/x-patch
Size: 432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210805/11174105/attachment.bin>


More information about the llvm-commits mailing list