diff options
author | Kazu Hirata <kazu@google.com> | 2022-11-26 14:52:33 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-11-26 14:52:33 -0800 |
commit | 3ff6ed810381846c37be960e13d7f71596226a3f (patch) | |
tree | ab72784a09f3cefcde205936c8a35ae9ff1fd70c /llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | |
parent | 5076bdf6e9c244fee08831b9409cb5474625ab6f (diff) | |
download | llvm-3ff6ed810381846c37be960e13d7f71596226a3f.zip llvm-3ff6ed810381846c37be960e13d7f71596226a3f.tar.gz llvm-3ff6ed810381846c37be960e13d7f71596226a3f.tar.bz2 |
[LiveDebugValues] Use std::optional in InstrRefBasedImpl.cpp (NFC)
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/LiveDebugValues/InstrRefBasedImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp index f6a55db..11bb3ee 100644 --- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp @@ -127,6 +127,7 @@ #include "InstrRefBasedImpl.h" #include "LiveDebugValues.h" +#include <optional> using namespace llvm; using namespace LiveDebugValues; @@ -740,7 +741,7 @@ public: // Examine the remaining variable locations: if we can find the same value // again, we can recover the location. - Optional<LocIdx> NewLoc; + std::optional<LocIdx> NewLoc; for (auto Loc : MTracker->locations()) if (Loc.Value == OldValue) NewLoc = Loc.Idx; @@ -1560,7 +1561,7 @@ bool InstrRefBasedLDV::transferDebugInstrRef(MachineInstr &MI, // Pick a location for the machine value number, if such a location exists. // (This information could be stored in TransferTracker to make it faster). - Optional<LocIdx> FoundLoc; + std::optional<LocIdx> FoundLoc; for (auto Location : MTracker->locations()) { LocIdx CurL = Location.Idx; ValueIDNum ID = MTracker->readMLoc(CurL); @@ -1913,7 +1914,7 @@ bool InstrRefBasedLDV::transferSpillOrRestoreInst(MachineInstr &MI) { // continue past this store. for (unsigned SlotIdx = 0; SlotIdx < MTracker->NumSlotIdxes; ++SlotIdx) { unsigned SpillID = MTracker->getSpillIDWithIdx(*Loc, SlotIdx); - Optional<LocIdx> MLoc = MTracker->getSpillMLoc(SpillID); + std::optional<LocIdx> MLoc = MTracker->getSpillMLoc(SpillID); if (!MLoc) continue; |