aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-12-02 20:36:08 -0800
committerKazu Hirata <kazu@google.com>2022-12-02 20:36:08 -0800
commit998960ee1f2c8bc3830df4849ab89ec9d6217f26 (patch)
tree19bdc0c4beff9b937cc849d7c50f31c2f3fc5742 /llvm/lib/CodeGen/MachineInstr.cpp
parent20cde15415d2b2d1b489b4cd5c520c6a8d7f8f54 (diff)
downloadllvm-998960ee1f2c8bc3830df4849ab89ec9d6217f26.zip
llvm-998960ee1f2c8bc3830df4849ab89ec9d6217f26.tar.gz
llvm-998960ee1f2c8bc3830df4849ab89ec9d6217f26.tar.bz2
[CodeGen] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 19a1ede..138eb3c 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -2338,7 +2338,7 @@ MachineInstr::getSpillSize(const TargetInstrInfo *TII) const {
if (MFI.isSpillSlotObjectIndex(FI))
return (*memoperands_begin())->getSize();
}
- return None;
+ return std::nullopt;
}
Optional<unsigned>
@@ -2346,7 +2346,7 @@ MachineInstr::getFoldedSpillSize(const TargetInstrInfo *TII) const {
MMOList Accesses;
if (TII->hasStoreToStackSlot(*this, Accesses))
return getSpillSlotSize(Accesses, getMF()->getFrameInfo());
- return None;
+ return std::nullopt;
}
Optional<unsigned>
@@ -2357,7 +2357,7 @@ MachineInstr::getRestoreSize(const TargetInstrInfo *TII) const {
if (MFI.isSpillSlotObjectIndex(FI))
return (*memoperands_begin())->getSize();
}
- return None;
+ return std::nullopt;
}
Optional<unsigned>
@@ -2365,7 +2365,7 @@ MachineInstr::getFoldedRestoreSize(const TargetInstrInfo *TII) const {
MMOList Accesses;
if (TII->hasLoadFromStackSlot(*this, Accesses))
return getSpillSlotSize(Accesses, getMF()->getFrameInfo());
- return None;
+ return std::nullopt;
}
unsigned MachineInstr::getDebugInstrNum() {