summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-06 22:34:48 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-06 22:34:48 +0000
commit4031beb10adad0c0e41ab6c4078d934ec9feac25 (patch)
treefe0aba6f93b349434f23a8b772b0ca14fbd614e6
parenta209f0d89212ea5dbb1b1fe900e02a0d5de30cfe (diff)
downloadbcm5719-llvm-4031beb10adad0c0e41ab6c4078d934ec9feac25.tar.gz
bcm5719-llvm-4031beb10adad0c0e41ab6c4078d934ec9feac25.zip
Support: Stop stringifying DW_LANG_{lo,hi}_user
llvm-svn: 228451
-rw-r--r--llvm/lib/Support/Dwarf.cpp2
-rw-r--r--llvm/unittests/Support/DwarfTest.cpp10
2 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/Support/Dwarf.cpp b/llvm/lib/Support/Dwarf.cpp
index 80dfd102317..8367473c728 100644
--- a/llvm/lib/Support/Dwarf.cpp
+++ b/llvm/lib/Support/Dwarf.cpp
@@ -507,9 +507,7 @@ const char *llvm::dwarf::LanguageString(unsigned Language) {
case DW_LANG_C_plus_plus_03: return "DW_LANG_C_plus_plus_03";
case DW_LANG_C_plus_plus_11: return "DW_LANG_C_plus_plus_11";
case DW_LANG_OCaml: return "DW_LANG_OCaml";
- case DW_LANG_lo_user: return "DW_LANG_lo_user";
case DW_LANG_Mips_Assembler: return "DW_LANG_Mips_Assembler";
- case DW_LANG_hi_user: return "DW_LANG_hi_user";
}
return nullptr;
}
diff --git a/llvm/unittests/Support/DwarfTest.cpp b/llvm/unittests/Support/DwarfTest.cpp
index d016aacedce..a1438205f73 100644
--- a/llvm/unittests/Support/DwarfTest.cpp
+++ b/llvm/unittests/Support/DwarfTest.cpp
@@ -42,4 +42,14 @@ TEST(DwarfTest, getTag) {
EXPECT_EQ(DW_TAG_invalid, getTag("DW_TAG_user_base"));
}
+TEST(DwarfTest, LanguageStringOnInvalid) {
+ // This is invalid, so it shouldn't be stringified.
+ EXPECT_EQ(nullptr, LanguageString(0));
+
+ // These aren't really tags: they describe ranges within tags. They
+ // shouldn't be stringified either.
+ EXPECT_EQ(nullptr, LanguageString(DW_LANG_lo_user));
+ EXPECT_EQ(nullptr, LanguageString(DW_LANG_hi_user));
+}
+
} // end namespace
OpenPOWER on IntegriCloud