From 3e7b44f0dc8aba390af3bb29e1de60293493fe4e Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Tue, 13 Jul 2021 09:25:28 -0700 Subject: [PATCH] [OpaquePtr] Use AllocaInst::getAllocatedType() --- lib/Target/NVPTX/NVPTXLowerAlloca.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Target/NVPTX/NVPTXLowerAlloca.cpp b/lib/Target/NVPTX/NVPTXLowerAlloca.cpp index cf488b06f06..1bd02552b66 100644 --- a/lib/Target/NVPTX/NVPTXLowerAlloca.cpp +++ b/lib/Target/NVPTX/NVPTXLowerAlloca.cpp @@ -70,7 +70,7 @@ bool NVPTXLowerAlloca::runOnFunction(Function &F) { for (auto &I : BB) { if (auto allocaInst = dyn_cast(&I)) { Changed = true; - auto ETy = cast(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);