GlobalIFunc: Make ifunc respect function address spaces

This commit is contained in:
Matt Arsenault
2022-11-22 21:02:20 -05:00
parent 6463961941
commit 0d527e56a5
3 changed files with 36 additions and 3 deletions

View File

@@ -2873,8 +2873,8 @@ Error BitcodeReader::resolveGlobalAndIndirectSymbolInits() {
Type *ResolverFTy =
GlobalIFunc::getResolverFunctionType(GI->getValueType());
// Transparently fix up the type for compatibility with older bitcode
GI->setResolver(
ConstantExpr::getBitCast(C, ResolverFTy->getPointerTo()));
GI->setResolver(ConstantExpr::getBitCast(
C, ResolverFTy->getPointerTo(GI->getAddressSpace())));
} else {
return error("Expected an alias or an ifunc");
}