diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-06 22:55:13 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-06 22:55:13 +0000 |
commit | d40af00e66b8b15960614d423681953ea7a41eb2 (patch) | |
tree | 57e52d848fdf2b191700e0ce81dea0b890302a20 /llvm/lib/Support/Dwarf.cpp | |
parent | 0317944b1a6dc9aa06acc66e8849ea63df8f3da1 (diff) | |
download | bcm5719-llvm-d40af00e66b8b15960614d423681953ea7a41eb2.tar.gz bcm5719-llvm-d40af00e66b8b15960614d423681953ea7a41eb2.zip |
Support: Add dwarf::getLanguage()
llvm-svn: 228458
Diffstat (limited to 'llvm/lib/Support/Dwarf.cpp')
-rw-r--r-- | llvm/lib/Support/Dwarf.cpp | 7 |
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"; |