diff options
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
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<unsigned> +std::optional<unsigned> 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. |