[llvm] dc65f57 - [DWARFYAML] Merge forms that use same encodings. NFC.

Xing GUO via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 20:33:02 PDT 2020


Author: Xing GUO
Date: 2020-07-17T11:31:49+08:00
New Revision: dc65f57124a81511b085396dea621f585382299c

URL: https://github.com/llvm/llvm-project/commit/dc65f57124a81511b085396dea621f585382299c
DIFF: https://github.com/llvm/llvm-project/commit/dc65f57124a81511b085396dea621f585382299c.diff

LOG: [DWARFYAML] Merge forms that use same encodings. NFC.

Added: 
    

Modified: 
    llvm/lib/ObjectYAML/DWARFVisitor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ObjectYAML/DWARFVisitor.cpp b/llvm/lib/ObjectYAML/DWARFVisitor.cpp
index c393b17aaa33..bea71fb3235d 100644
--- a/llvm/lib/ObjectYAML/DWARFVisitor.cpp
+++ b/llvm/lib/ObjectYAML/DWARFVisitor.cpp
@@ -118,6 +118,10 @@ template <typename T> Error DWARFYAML::VisitorImpl<T>::traverseDebugInfo() {
           case dwarf::DW_FORM_addrx:
           case dwarf::DW_FORM_rnglistx:
           case dwarf::DW_FORM_loclistx:
+          case dwarf::DW_FORM_udata:
+          case dwarf::DW_FORM_ref_udata:
+          case dwarf::DW_FORM_GNU_addr_index:
+          case dwarf::DW_FORM_GNU_str_index:
             onValue((uint64_t)FormVal->Value, /*LEB=*/true);
             break;
           case dwarf::DW_FORM_data1:
@@ -143,15 +147,12 @@ template <typename T> Error DWARFYAML::VisitorImpl<T>::traverseDebugInfo() {
           case dwarf::DW_FORM_data8:
           case dwarf::DW_FORM_ref8:
           case dwarf::DW_FORM_ref_sup8:
+          case dwarf::DW_FORM_ref_sig8:
             onValue((uint64_t)FormVal->Value);
             break;
           case dwarf::DW_FORM_sdata:
             onValue((int64_t)FormVal->Value, true);
             break;
-          case dwarf::DW_FORM_udata:
-          case dwarf::DW_FORM_ref_udata:
-            onValue((uint64_t)FormVal->Value, true);
-            break;
           case dwarf::DW_FORM_string:
             onValue(FormVal->CStr);
             break;
@@ -169,13 +170,6 @@ template <typename T> Error DWARFYAML::VisitorImpl<T>::traverseDebugInfo() {
           case dwarf::DW_FORM_strp_sup:
             onVariableSizeValue(FormVal->Value, getOffsetSize(Unit));
             break;
-          case dwarf::DW_FORM_ref_sig8:
-            onValue((uint64_t)FormVal->Value);
-            break;
-          case dwarf::DW_FORM_GNU_addr_index:
-          case dwarf::DW_FORM_GNU_str_index:
-            onValue((uint64_t)FormVal->Value, true);
-            break;
           default:
             break;
           }


        


More information about the llvm-commits mailing list