From 1c932baeaafbd4c9051ed4836f320db9003f4068 Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Wed, 10 Feb 2021 10:48:22 -0800 Subject: [llvm][Bitcode] Add bitcode reader/writer for DSOLocalEquivalent This is necessary for compilation with [thin]lto. Differential Revision: https://reviews.llvm.org/D96170 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp') 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(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(); -- cgit v1.1