diff --git a/lib/Support/Dwarf.cpp b/lib/Support/Dwarf.cpp index 9972960d373..7b94b71834d 100644 --- a/lib/Support/Dwarf.cpp +++ b/lib/Support/Dwarf.cpp @@ -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; } diff --git a/unittests/Support/DwarfTest.cpp b/unittests/Support/DwarfTest.cpp index 2dccfe7ad3c..b1a23b31c1c 100644 --- a/unittests/Support/DwarfTest.cpp +++ b/unittests/Support/DwarfTest.cpp @@ -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