[PATCH] Add more DWARF 5 language constants.
Bruce Mitchener
bruce.mitchener at gmail.com
Fri Feb 6 22:37:27 PST 2015
REPOSITORY
rL LLVM
http://reviews.llvm.org/D7430
Files:
llvm/trunk/include/llvm/Support/Dwarf.def
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/trunk/lib/IR/DIBuilder.cpp
Index: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -130,6 +130,30 @@
if (dwarf::DWARF_VERSION >= 4)
return 1;
break;
+
+ // The languages below have valid values only if the DWARF version >= 5.
+ case dwarf::DW_LANG_OpenCL:
+ case dwarf::DW_LANG_Go:
+ case dwarf::DW_LANG_Haskell:
+ case dwarf::DW_LANG_C_plus_plus_03:
+ case dwarf::DW_LANG_C_plus_plus_11:
+ case dwarf::DW_LANG_OCaml:
+ case dwarf::DW_LANG_Rust:
+ case dwarf::DW_LANG_C11:
+ case dwarf::DW_LANG_Swift:
+ case dwarf::DW_LANG_Dylan:
+ case dwarf::DW_LANG_C_plus_plus_14:
+ if (dwarf::DWARF_VERSION >= 5)
+ return 0;
+ break;
+
+ case dwarf::DW_LANG_Modula3:
+ case dwarf::DW_LANG_Julia:
+ case dwarf::DW_LANG_Fortran03:
+ case dwarf::DW_LANG_Fortran08:
+ if (dwarf::DWARF_VERSION >= 5)
+ return 1;
+ break;
}
return -1;
Index: llvm/trunk/lib/IR/DIBuilder.cpp
===================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp
+++ llvm/trunk/lib/IR/DIBuilder.cpp
@@ -145,7 +145,7 @@
DebugEmissionKind Kind,
bool EmitDebugInfo) {
- assert(((Lang <= dwarf::DW_LANG_OCaml && Lang >= dwarf::DW_LANG_C89) ||
+ assert(((Lang <= dwarf::DW_LANG_Fortran08 && Lang >= dwarf::DW_LANG_C89) ||
(Lang <= dwarf::DW_LANG_hi_user && Lang >= dwarf::DW_LANG_lo_user)) &&
"Invalid Language tag");
assert(!Filename.empty() &&
Index: llvm/trunk/include/llvm/Support/Dwarf.def
===================================================================
--- llvm/trunk/include/llvm/Support/Dwarf.def
+++ llvm/trunk/include/llvm/Support/Dwarf.def
@@ -144,6 +144,14 @@
HANDLE_DW_LANG(0x0019, C_plus_plus_03)
HANDLE_DW_LANG(0x001a, C_plus_plus_11)
HANDLE_DW_LANG(0x001b, OCaml)
+HANDLE_DW_LANG(0x001c, Rust)
+HANDLE_DW_LANG(0x001d, C11)
+HANDLE_DW_LANG(0x001e, Swift)
+HANDLE_DW_LANG(0x001f, Julia)
+HANDLE_DW_LANG(0x0020, Dylan)
+HANDLE_DW_LANG(0x0021, C_plus_plus_14)
+HANDLE_DW_LANG(0x0022, Fortran03)
+HANDLE_DW_LANG(0x0023, Fortran08)
HANDLE_DW_LANG(0x8001, Mips_Assembler)
// DWARF attribute type encodings.
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7430.19528.patch
Type: text/x-patch
Size: 2346 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150207/9468945c/attachment.bin>
More information about the llvm-commits
mailing list