[llvm] [llvm][Dwarf] Add LanguageDescription API that accounts for version (PR #162048)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 6 09:28:02 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";
----------------
dwblaikie wrote:
I'd have expected these to work the other way around - like if the Version is < 1995, then it's Ada 83.
Might be weird to say it's Ada95 when the version is 1990/before 1995? But I'm not sure if there's a clear general sense, or language-specific sense, of what the intermediate values should mean.
https://github.com/llvm/llvm-project/pull/162048
More information about the llvm-commits
mailing list