From e3b557809604d036af6e00c60f012c2025b59a5e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 11 Feb 2023 13:38:04 +0100 Subject: Vendor import of llvm-project main llvmorg-16-init-18548-gb0daacf58f41, the last commit before the upstream release/17.x branch was created. --- llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp') diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp index 01baa3d9389d..e60f1397b993 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp @@ -50,7 +50,7 @@ using namespace llvm; // SelectionDAGISel::runOnMachineFunction. We have to do it in two places // because we want to do it while building the selection DAG for uses of alloca, // but not all alloca instructions are used so we have to follow up afterwards. -Optional +std::optional WebAssemblyFrameLowering::getLocalForStackObject(MachineFunction &MF, int FrameIndex) { MachineFrameInfo &MFI = MF.getFrameInfo(); @@ -62,9 +62,8 @@ WebAssemblyFrameLowering::getLocalForStackObject(MachineFunction &MF, // If not allocated in the object address space, this object will be in // linear memory. const AllocaInst *AI = MFI.getObjectAllocation(FrameIndex); - if (!AI || - !WebAssembly::isWasmVarAddressSpace(AI->getType()->getAddressSpace())) - return None; + if (!AI || !WebAssembly::isWasmVarAddressSpace(AI->getAddressSpace())) + return std::nullopt; // Otherwise, allocate this object in the named value stack, outside of linear // memory. -- cgit v1.2.3