summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Dwarf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/Dwarf.cpp')
-rw-r--r--llvm/lib/Support/Dwarf.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Support/Dwarf.cpp b/llvm/lib/Support/Dwarf.cpp
index 8e36396f070..9972960d373 100644
--- a/llvm/lib/Support/Dwarf.cpp
+++ b/llvm/lib/Support/Dwarf.cpp
@@ -489,6 +489,13 @@ const char *llvm::dwarf::LanguageString(unsigned Language) {
}
}
+unsigned llvm::dwarf::getLanguage(StringRef LanguageString) {
+ return StringSwitch<unsigned>(LanguageString)
+#define HANDLE_DW_LANG(ID, NAME) .Case("DW_LANG_" #NAME, DW_LANG_##NAME)
+#include "llvm/Support/Dwarf.def"
+ .Default(0);
+}
+
const char *llvm::dwarf::CaseString(unsigned Case) {
switch (Case) {
case DW_ID_case_sensitive: return "DW_ID_case_sensitive";
OpenPOWER on IntegriCloud