]> granicus.if.org Git - llvm/commitdiff
[DWARF] NFC: Give DwarfFormat a 1-byte base type.
authorPaul Robinson <paul.robinson@sony.com>
Mon, 26 Jun 2017 19:52:32 +0000 (19:52 +0000)
committerPaul Robinson <paul.robinson@sony.com>
Mon, 26 Jun 2017 19:52:32 +0000 (19:52 +0000)
In particular this reduces DWARFFormParams from 64 to 32 bits; pass it
around by value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306324 91177308-0d34-0410-b5e6-96231b3b80d8

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

index b7a056b18119d55ef79cb13e8620e41ccf9d5155..ab927565d05d565bd48ad4e5ad04d6d0d47742a5 100644 (file)
@@ -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
 
index 4716631130758fc25b7d8eb8e1c7e5ffb65ae6c5..78fa6639db0878cd7601ce7106fa6b95eb976223 100644 (file)
@@ -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;
index dda4a0cdb31663ed5700be84f6cd37c4b7fa8df9..861114bde1f2b2a63cdc78ff532edb58c3794e42 100644 (file)
@@ -61,7 +61,7 @@ static const DWARFFormValue::FormClass DWARF4FormClasses[] = {
 
 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::Form Form,
 
 bool DWARFFormValue::skipValue(dwarf::Form Form, DataExtractor DebugInfoData,
                                uint32_t *OffsetPtr,
-                               const DWARFFormParams &Params) {
+                               const DWARFFormParams Params) {
   bool Indirect = false;
   do {
     switch (Form) {