[llvm][Bitcode] Add bitcode reader/writer for DSOLocalEquivalent

This is necessary for compilation with [thin]lto.

Differential Revision: https://reviews.llvm.org/D96170
This commit is contained in:
Leonard Chan
2021-02-10 10:48:22 -08:00
parent f6b58c5553
commit 1cfc220073
5 changed files with 108 additions and 2 deletions
+4
View File
@@ -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();