[llvm] e03868a - [Coverage] Use std::optional in CoverageMapping.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 25 20:33:16 PST 2022


Author: Kazu Hirata
Date: 2022-11-25T20:33:10-08:00
New Revision: e03868a4274547d016e98047a489455fd73f009a

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

LOG: [Coverage] Use std::optional in CoverageMapping.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/ProfileData/Coverage/CoverageMapping.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
index 8c1eadbe82713..712dfc07ac264 100644
--- a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+++ b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
@@ -33,6 +33,7 @@
 #include <iterator>
 #include <map>
 #include <memory>
+#include <optional>
 #include <string>
 #include <system_error>
 #include <utility>
@@ -458,7 +459,7 @@ class SegmentBuilder {
   /// \p Loc: The start location of the next region. If None, all active
   /// regions are completed.
   /// \p FirstCompletedRegion: Index of the first completed region.
-  void completeRegionsUntil(Optional<LineColPair> Loc,
+  void completeRegionsUntil(std::optional<LineColPair> Loc,
                             unsigned FirstCompletedRegion) {
     // Sort the completed regions by end location. This makes it simple to
     // emit closing segments in sorted order.


        


More information about the llvm-commits mailing list