diff options
author | Leonard Chan <leonardchan@google.com> | 2021-02-10 10:48:22 -0800 |
---|---|---|
committer | Leonard Chan <leonardchan@google.com> | 2021-02-22 10:37:57 -0800 |
commit | 1c932baeaafbd4c9051ed4836f320db9003f4068 (patch) | |
tree | 9fd0ca7b15020d56b3c2dd138842ccbdb6a5d323 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 95d13c01ecba5c9dba8ea1bd875c4179cbaea9e2 (diff) | |
download | llvm-1c932baeaafbd4c9051ed4836f320db9003f4068.zip llvm-1c932baeaafbd4c9051ed4836f320db9003f4068.tar.gz llvm-1c932baeaafbd4c9051ed4836f320db9003f4068.tar.bz2 |
[llvm][Bitcode] Add bitcode reader/writer for DSOLocalEquivalent
This is necessary for compilation with [thin]lto.
Differential Revision: https://reviews.llvm.org/D96170
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 9a4f724..c555b67 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -2609,6 +2609,10 @@ void ModuleBitcodeWriter::writeConstants(unsigned FirstVal, unsigned LastVal, Record.push_back(VE.getTypeID(BA->getFunction()->getType())); Record.push_back(VE.getValueID(BA->getFunction())); Record.push_back(VE.getGlobalBasicBlockID(BA->getBasicBlock())); + } else if (const auto *Equiv = dyn_cast<DSOLocalEquivalent>(C)) { + Code = bitc::CST_CODE_DSO_LOCAL_EQUIVALENT; + Record.push_back(VE.getTypeID(Equiv->getGlobalValue()->getType())); + Record.push_back(VE.getValueID(Equiv->getGlobalValue())); } else { #ifndef NDEBUG C->dump(); |