diff options
| author | Michael Buch <michaelbuch12@gmail.com> | 2025-10-10 09:54:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-10 09:54:04 +0100 |
| commit | c32753a77a724244bfac60405390a14c93fd92fa (patch) | |
| tree | af2fad6b109654261e4ac286d3571dc334e59dd2 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
| parent | 51eee2010d3184f21502d12d69c0234549ee3fb4 (diff) | |
| download | llvm-c32753a77a724244bfac60405390a14c93fd92fa.zip llvm-c32753a77a724244bfac60405390a14c93fd92fa.tar.gz llvm-c32753a77a724244bfac60405390a14c93fd92fa.tar.bz2 | |
[llvm][DebugInfo] Add 'sourceLanguageName' field support to DICompileUnit (#162445)
Depends on:
* https://github.com/llvm/llvm-project/pull/162255
* https://github.com/llvm/llvm-project/pull/162434
Part of a patch series to support the DWARFv6
`DW_AT_language_name`/`DW_AT_language_version` attributes.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
| -rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 7ed140d..0ca55a26 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -2108,7 +2108,13 @@ void ModuleBitcodeWriter::writeDICompileUnit(const DICompileUnit *N, assert(N->isDistinct() && "Expected distinct compile units"); Record.push_back(/* IsDistinct */ true); - Record.push_back(N->getSourceLanguage().getUnversionedName()); + auto Lang = N->getSourceLanguage(); + Record.push_back(Lang.getName()); + // Set bit so the MetadataLoader can distniguish between versioned and + // unversioned names. + if (Lang.hasVersionedName()) + Record.back() ^= (uint64_t(1) << 63); + Record.push_back(VE.getMetadataOrNullID(N->getFile())); Record.push_back(VE.getMetadataOrNullID(N->getRawProducer())); Record.push_back(N->isOptimized()); |
