if (LinkerSubsectionsViaSymbols) {
BAI->ByteArray->replaceAllUsesWith(GEP);
} else {
- GlobalAlias *Alias = GlobalAlias::create(
- Int8Ty, 0, GlobalValue::PrivateLinkage, "bits", GEP, M);
+ GlobalAlias *Alias =
+ GlobalAlias::create(PointerType::getUnqual(Int8Ty),
+ GlobalValue::PrivateLinkage, "bits", GEP, M);
BAI->ByteArray->replaceAllUsesWith(Alias);
}
BAI->ByteArray->eraseFromParent();
// Each use of the byte array uses a different alias. This makes the
// backend less likely to reuse previously computed byte array addresses,
// improving the security of the CFI mechanism based on this pass.
- ByteArray = GlobalAlias::create(BAI->ByteArray->getValueType(), 0,
+ ByteArray = GlobalAlias::create(BAI->ByteArray->getType(),
GlobalValue::PrivateLinkage, "bits_use",
ByteArray, M);
}
if (LinkerSubsectionsViaSymbols) {
Globals[I]->replaceAllUsesWith(CombinedGlobalElemPtr);
} else {
- GlobalAlias *GAlias = GlobalAlias::create(
- Globals[I]->getType()->getElementType(),
- Globals[I]->getType()->getAddressSpace(), Globals[I]->getLinkage(),
- "", CombinedGlobalElemPtr, M);
+ GlobalAlias *GAlias =
+ GlobalAlias::create(Globals[I]->getType(), Globals[I]->getLinkage(),
+ "", CombinedGlobalElemPtr, M);
GAlias->takeName(Globals[I]);
Globals[I]->replaceAllUsesWith(GAlias);
}