[llvm] r228468 - Support: Stop stringifying DW_ATE_{lo,hi}_user

Duncan P. N. Exon Smith dexonsmith at apple.com
Fri Feb 6 15:44:24 PST 2015


Author: dexonsmith
Date: Fri Feb  6 17:44:24 2015
New Revision: 228468

URL: http://llvm.org/viewvc/llvm-project?rev=228468&view=rev
Log:
Support: Stop stringifying DW_ATE_{lo,hi}_user

Modified:
    llvm/trunk/lib/Support/Dwarf.cpp
    llvm/trunk/unittests/Support/DwarfTest.cpp

Modified: llvm/trunk/lib/Support/Dwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Dwarf.cpp?rev=228468&r1=228467&r2=228468&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Dwarf.cpp (original)
+++ llvm/trunk/lib/Support/Dwarf.cpp Fri Feb  6 17:44:24 2015
@@ -422,8 +422,6 @@ const char *llvm::dwarf::AttributeEncodi
   case DW_ATE_signed_fixed:              return "DW_ATE_signed_fixed";
   case DW_ATE_unsigned_fixed:            return "DW_ATE_unsigned_fixed";
   case DW_ATE_decimal_float:             return "DW_ATE_decimal_float";
-  case DW_ATE_lo_user:                   return "DW_ATE_lo_user";
-  case DW_ATE_hi_user:                   return "DW_ATE_hi_user";
   }
   return nullptr;
 }

Modified: llvm/trunk/unittests/Support/DwarfTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/DwarfTest.cpp?rev=228468&r1=228467&r2=228468&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/DwarfTest.cpp (original)
+++ llvm/trunk/unittests/Support/DwarfTest.cpp Fri Feb  6 17:44:24 2015
@@ -69,4 +69,14 @@ TEST(DwarfTest, getLanguage) {
   EXPECT_EQ(0u, getLanguage("DW_LANG_hi_user"));
 }
 
+TEST(DwarfTest, AttributeEncodingStringOnInvalid) {
+  // This is invalid, so it shouldn't be stringified.
+  EXPECT_EQ(nullptr, AttributeEncodingString(0));
+
+  // These aren't really tags: they describe ranges within tags.  They
+  // shouldn't be stringified either.
+  EXPECT_EQ(nullptr, AttributeEncodingString(DW_ATE_lo_user));
+  EXPECT_EQ(nullptr, AttributeEncodingString(DW_ATE_hi_user));
+}
+
 } // end namespace





More information about the llvm-commits mailing list