[llvm] [llvm][Dwarf] Add LanguageDescription API that accounts for version (PR #162048)

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 7 10:25:57 PDT 2025


================
@@ -472,6 +472,117 @@ StringRef llvm::dwarf::LanguageDescription(dwarf::SourceLanguageName lname) {
   return "Unknown";
 }
 
+StringRef llvm::dwarf::LanguageDescription(dwarf::SourceLanguageName Name,
+                                           uint32_t Version) {
+  switch (Name) {
+  // YYYY
+  case DW_LNAME_Ada: {
+    if (Version <= 1983)
+      return "Ada 83";
+    if (Version <= 1995)
+      return "Ada 95";
+    if (Version <= 2005)
+      return "Ada 2005";
+    if (Version <= 2012)
+      return "Ada 2012";
----------------
adrian-prantl wrote:

Seems like a reasonable way to deal with pre-release compilers that guess the final date of the standard incorrectly. The other alternative would be put the raw version in the string.

https://github.com/llvm/llvm-project/pull/162048


More information about the llvm-commits mailing list