[PATCH] D26052: Modify DWARFFormValue to remember the DWARFUnit that it was decoded with.

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 16:16:58 PDT 2016


clayborg added a comment.

All DWARFFormValue objects are temporaries. I mentioned in the original description that this won't affect memory because of this.



================
Comment at: include/llvm/DebugInfo/DWARF/DWARFFormValue.h:52
 
-  dwarf::Form Form;   // Form for this value.
+  dwarf::Form Form; // Form for this value.
   ValueType Value; // Contains all data for the form.
----------------
aprantl wrote:
> You can doxygen'ify this by using
> 
> `dwarf::Form Form; ///< Form for this value.`
> 
> or
> ```
> /// Form for this value.
> dwarf::Form Form;
> ```
This is how it was, I didn't change it, but I can add the doxygen /// if desired.


================
Comment at: lib/DebugInfo/DWARF/DWARFFormValue.cpp:136
 
-bool DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr,
+bool DWARFFormValue::extractValue(const DataExtractor &data, 
+                                  uint32_t *offset_ptr,
----------------
aprantl wrote:
> A DataExtractor is only a StringRef + 2x uint8_t. Are we saving anything by passing it by reference?
It just avoids the copy. It passes one pointer for the reference versus 2 pointers + 2 uint8_t values. 


Repository:
  rL LLVM

https://reviews.llvm.org/D26052





More information about the llvm-commits mailing list