1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[OpaquePtr] Use AllocaInst::getAllocatedType()

This commit is contained in:
Arthur Eubanks 2021-07-13 09:25:28 -07:00
parent 7dbb7fdf61
commit 3e7b44f0dc

View File

@ -70,7 +70,7 @@ bool NVPTXLowerAlloca::runOnFunction(Function &F) {
for (auto &I : BB) {
if (auto allocaInst = dyn_cast<AllocaInst>(&I)) {
Changed = true;
auto ETy = cast<PointerType>(allocaInst->getType())->getElementType();
auto ETy = allocaInst->getAllocatedType();
auto LocalAddrTy = PointerType::get(ETy, ADDRESS_SPACE_LOCAL);
auto NewASCToLocal = new AddrSpaceCastInst(allocaInst, LocalAddrTy, "");
auto GenericAddrTy = PointerType::get(ETy, ADDRESS_SPACE_GENERIC);