[llvm] fb2f3b3 - [AsmPrinter] Use std::optional in DbgEntityHistoryCalculator.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 26 14:13:52 PST 2022


Author: Kazu Hirata
Date: 2022-11-26T14:13:47-08:00
New Revision: fb2f3b30b2ab2494aedf54940f80258e073f0486

URL: https://github.com/llvm/llvm-project/commit/fb2f3b30b2ab2494aedf54940f80258e073f0486
DIFF: https://github.com/llvm/llvm-project/commit/fb2f3b30b2ab2494aedf54940f80258e073f0486.diff

LOG: [AsmPrinter] Use std::optional in DbgEntityHistoryCalculator.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

Added: 
    

Modified: 
    llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp b/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
index dabbfb45f687..d0c3e5e228a7 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
@@ -26,6 +26,7 @@
 #include "llvm/Support/raw_ostream.h"
 #include <cassert>
 #include <map>
+#include <optional>
 #include <utility>
 
 using namespace llvm;
@@ -110,7 +111,7 @@ void DbgValueHistoryMap::Entry::endEntry(EntryIndex Index) {
 /// range in Ranges. EndMI can be nullptr to indicate that the range is
 /// unbounded. Assumes Ranges is ordered and disjoint. Returns true and points
 /// to the first intersecting scope range if one exists.
-static Optional<ArrayRef<InsnRange>::iterator>
+static std::optional<ArrayRef<InsnRange>::iterator>
 intersects(const MachineInstr *StartMI, const MachineInstr *EndMI,
            const ArrayRef<InsnRange> &Ranges,
            const InstructionOrdering &Ordering) {


        


More information about the llvm-commits mailing list