diff options
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 9ca76b5..3e6abac 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -7997,7 +7997,16 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { case bitc::FS_STACK_IDS: { // [n x stackid] // Save stack ids in the reader to consult when adding stack ids from the // lists in the stack node and alloc node entries. - StackIds = ArrayRef<uint64_t>(Record); + if (Version <= 11) { + StackIds = ArrayRef<uint64_t>(Record); + break; + } + // This is an array of 32-bit fixed-width values, holding each 64-bit + // context id as a pair of adjacent (most significant first) 32-bit words. + assert(Record.size() % 2 == 0); + StackIds.reserve(Record.size() / 2); + for (auto R = Record.begin(); R != Record.end(); R += 2) + StackIds.push_back(*R << 32 | *(R + 1)); break; } |