[CodeGen] Avoid nullptr arg to CreateStructGEP (NFC)

For now just make the getPointerElementType() explicit.
This commit is contained in:
Nikita Popov 2021-07-08 21:20:17 +02:00
parent 9e225a2a71
commit a0ea367562
1 changed files with 2 additions and 1 deletions

View File

@ -3437,7 +3437,8 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI,
--EI;
llvm::Value *ArgStruct = &*EI;
llvm::Value *SRet = Builder.CreateStructGEP(
nullptr, ArgStruct, RetAI.getInAllocaFieldIndex());
EI->getType()->getPointerElementType(), ArgStruct,
RetAI.getInAllocaFieldIndex());
llvm::Type *Ty =
cast<llvm::GetElementPtrInst>(SRet)->getResultElementType();
RV = Builder.CreateAlignedLoad(Ty, SRet, getPointerAlign(), "sret");