[clang] [llvm] [mlir] [llvm][DebugInfo][NFC] Abstract DICompileUnit::SourceLanguage to allow alternate DWARF SourceLanguage encoding (PR #162255)
Adrian Prantl via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 7 10:15:49 PDT 2025
================
@@ -66,6 +66,44 @@ namespace dwarf {
enum Tag : uint16_t;
}
+/// Wrapper structure that holds a language name and its version.
+///
+/// Some debug-info formats, particularly DWARF, distniguish between
+/// language codes that include the version name and codes that don't.
+/// DISourceLanguageName may hold either of these.
+///
+class DISourceLanguageName {
+ /// Language name.
+ /// If \ref Version is not std::nullopt, then this name
+ /// is version independent (i.e., doesn't include the language
+ /// version in its name).
+ uint16_t Name;
+
+ /// Language version. The version scheme is language
+ /// dependent.
+ std::optional<uint32_t> Version;
----------------
adrian-prantl wrote:
possibly flip the order between these?
https://github.com/llvm/llvm-project/pull/162255
More information about the llvm-commits
mailing list