Support: Stop stringifying DW_ATE_{lo,hi}_user
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 6 Feb 2015 23:44:24 +0000 (23:44 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 6 Feb 2015 23:44:24 +0000 (23:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228468 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Dwarf.cpp
unittests/Support/DwarfTest.cpp

index 9972960d3737ef4078cd93108e11222e1fedd1aa..7b94b71834dc200bcdb95d1d7a08051d2023cf57 100644 (file)
@@ -422,8 +422,6 @@ const char *llvm::dwarf::AttributeEncodingString(unsigned Encoding) {
   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;
 }
index 2dccfe7ad3c0ce121ae498f547b0293313a015d9..b1a23b31c1c2f14bc77589ee9cfb927e2aa4bb9d 100644 (file)
@@ -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