aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-02-11 12:38:04 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-02-11 12:38:11 +0000
commite3b557809604d036af6e00c60f012c2025b59a5e (patch)
tree8a11ba2269a3b669601e2fd41145b174008f4da8 /llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
parent08e8dd7b9db7bb4a9de26d44c1cbfd24e869c014 (diff)
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp7
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.