diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2025-07-07 11:57:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-07 11:57:46 +0100 |
commit | c995c5035567a0d5f3c9bcd6d07cdc3e5651099a (patch) | |
tree | 8bbaffa15674ec44242899f8a12e53540539e51a /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 7a6435bec59010e4bb2e1e52a9ba840ed152b4ce (diff) | |
download | llvm-c995c5035567a0d5f3c9bcd6d07cdc3e5651099a.zip llvm-c995c5035567a0d5f3c9bcd6d07cdc3e5651099a.tar.gz llvm-c995c5035567a0d5f3c9bcd6d07cdc3e5651099a.tar.bz2 |
[KeyInstr] Add bitcode support (#147260)
Serialise key-instruction fields of DILocations and DISubprograms into
and outof bitcode, add tests. debug-info bitcode sizes grow, but it
balances out given an earlier size optimisation in 51f4e2c.
Co-authored-by: Orlando Cazalet-Hyams <orlando.hyams@sony.com>
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 13cec54..66ecc69 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -5084,7 +5084,9 @@ Error BitcodeReader::parseFunctionBody(Function *F) { unsigned Line = Record[0], Col = Record[1]; unsigned ScopeID = Record[2], IAID = Record[3]; - bool isImplicitCode = Record.size() == 5 && Record[4]; + bool isImplicitCode = Record.size() >= 5 && Record[4]; + uint64_t AtomGroup = Record.size() == 7 ? Record[5] : 0; + uint8_t AtomRank = Record.size() == 7 ? Record[6] : 0; MDNode *Scope = nullptr, *IA = nullptr; if (ScopeID) { @@ -5099,8 +5101,9 @@ Error BitcodeReader::parseFunctionBody(Function *F) { if (!IA) return error("Invalid record"); } + LastLoc = DILocation::get(Scope->getContext(), Line, Col, Scope, IA, - isImplicitCode); + isImplicitCode, AtomGroup, AtomRank); I->setDebugLoc(LastLoc); I = nullptr; continue; |