IRGen: create InternalWeakODR named IRLinkage (NFC)

Create a new named IRLinkage type: `InternalWeakODR`.  This just gives
the IRLinkage a semantic name rather than the computed value.  NFC.
This commit is contained in:
Saleem Abdulrasool
2019-01-04 09:25:44 -08:00
parent 50d6b19e98
commit a6df0469cf
3 changed files with 8 additions and 4 deletions

View File

@@ -975,10 +975,7 @@ void IRGenModule::addLinkLibrary(const LinkLibrary &linkLib) {
/*isConstant=*/true,
llvm::GlobalValue::WeakODRLinkage,
ForceImportThunk, buf.str());
ApplyIRLinkage({llvm::GlobalValue::WeakODRLinkage,
llvm::GlobalValue::HiddenVisibility,
llvm::GlobalValue::DefaultStorageClass})
.to(ref);
ApplyIRLinkage(IRLinkage::InternalWeakODR).to(ref);
auto casted = llvm::ConstantExpr::getBitCast(ref, Int8PtrTy);
LLVMUsed.push_back(casted);
}