[llvm] r306324 - [DWARF] NFC: Give DwarfFormat a 1-byte base type.

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 12:52:33 PDT 2017


Author: probinson
Date: Mon Jun 26 12:52:32 2017
New Revision: 306324

URL: http://llvm.org/viewvc/llvm-project?rev=306324&view=rev
Log:
[DWARF] NFC: Give DwarfFormat a 1-byte base type.

In particular this reduces DWARFFormParams from 64 to 32 bits; pass it
around by value.

Modified:
    llvm/trunk/include/llvm/BinaryFormat/Dwarf.h
    llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFFormValue.h
    llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp

Modified: llvm/trunk/include/llvm/BinaryFormat/Dwarf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BinaryFormat/Dwarf.h?rev=306324&r1=306323&r2=306324&view=diff
==============================================================================
--- llvm/trunk/include/llvm/BinaryFormat/Dwarf.h (original)
+++ llvm/trunk/include/llvm/BinaryFormat/Dwarf.h Mon Jun 26 12:52:32 2017
@@ -484,7 +484,7 @@ private:
 };
 
 /// Constants that define the DWARF format as 32 or 64 bit.
-enum DwarfFormat { DWARF32, DWARF64 };
+enum DwarfFormat : uint8_t { DWARF32, DWARF64 };
 
 } // End of namespace dwarf
 

Modified: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFFormValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFFormValue.h?rev=306324&r1=306323&r2=306324&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFFormValue.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFFormValue.h Mon Jun 26 12:52:32 2017
@@ -142,7 +142,7 @@ public:
   /// \returns Optional<uint8_t> value with the fixed byte size or None if
   /// \p Form doesn't have a fixed byte size.
   static Optional<uint8_t> getFixedByteSize(dwarf::Form Form,
-                                            const DWARFFormParams &FormParams);
+                                            const DWARFFormParams FormParams);
 
   /// Skip a form's value in \p DebugInfoData at the offset specified by
   /// \p OffsetPtr.
@@ -154,7 +154,7 @@ public:
   /// \param Params DWARF parameters to help interpret forms.
   /// \returns true on success, false if the form was not skipped.
   bool skipValue(DataExtractor DebugInfoData, uint32_t *OffsetPtr,
-                 const DWARFFormParams &Params) const {
+                 const DWARFFormParams Params) const {
     return DWARFFormValue::skipValue(Form, DebugInfoData, OffsetPtr, Params);
   }
 
@@ -169,7 +169,7 @@ public:
   /// \param FormParams DWARF parameters to help interpret forms.
   /// \returns true on success, false if the form was not skipped.
   static bool skipValue(dwarf::Form Form, DataExtractor DebugInfoData,
-                        uint32_t *OffsetPtr, const DWARFFormParams &FormParams);
+                        uint32_t *OffsetPtr, const DWARFFormParams FormParams);
 
 private:
   void dumpString(raw_ostream &OS) const;

Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp?rev=306324&r1=306323&r2=306324&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp Mon Jun 26 12:52:32 2017
@@ -61,7 +61,7 @@ static const DWARFFormValue::FormClass D
 
 Optional<uint8_t>
 DWARFFormValue::getFixedByteSize(dwarf::Form Form,
-                                 const DWARFFormParams &Params) {
+                                 const DWARFFormParams Params) {
   switch (Form) {
   case DW_FORM_addr:
     assert(Params.Version && Params.AddrSize && "Invalid Params for form");
@@ -146,7 +146,7 @@ DWARFFormValue::getFixedByteSize(dwarf::
 
 bool DWARFFormValue::skipValue(dwarf::Form Form, DataExtractor DebugInfoData,
                                uint32_t *OffsetPtr,
-                               const DWARFFormParams &Params) {
+                               const DWARFFormParams Params) {
   bool Indirect = false;
   do {
     switch (Form) {




More information about the llvm-commits mailing list