[OpaquePtr] Use AllocaInst::getAllocatedType()

This commit is contained in:
Arthur Eubanks 2021-07-13 09:25:28 -07:00
parent 1893b630fe
commit b25aca503d
1 changed files with 1 additions and 1 deletions

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);