[BOLT] Use std::optional instead of None in comments (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 11 Dec 2022 00:57:33 +0000 (16:57 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 11 Dec 2022 00:57:33 +0000 (16:57 -0800)
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

bolt/include/bolt/Core/BinaryContext.h
bolt/include/bolt/Profile/BoltAddressTranslation.h
bolt/include/bolt/Rewrite/RewriteInstance.h
bolt/include/bolt/Utils/Utils.h

index f36c5e8..277d266 100644 (file)
@@ -1063,7 +1063,7 @@ public:
   /// segments was mapped. \p FileOffset is the offset in the file of the
   /// mapping. Note that \p FileOffset should be page-aligned and could be
   /// different from the file offset of the segment which could be unaligned.
-  /// If no segment is found that matches \p FileOffset, return NoneType().
+  /// If no segment is found that matches \p FileOffset, return std::nullopt.
   Optional<uint64_t> getBaseAddressForMapping(uint64_t MMapAddress,
                                               uint64_t FileOffset) const;
 
index 43988ad..41f819f 100644 (file)
@@ -96,7 +96,7 @@ public:
 
   /// Use the map keys containing basic block addresses to infer fall-throughs
   /// taken in the path started at FirstLBR.To and ending at SecondLBR.From.
-  /// Return NoneType if trace is invalid or the list of fall-throughs
+  /// Return std::nullopt if trace is invalid or the list of fall-throughs
   /// otherwise.
   Optional<FallthroughListTy> getFallthroughsInTrace(uint64_t FuncAddress,
                                                      uint64_t From,
index c50625f..1abad87 100644 (file)
@@ -79,7 +79,8 @@ public:
   void parseBuildID();
 
   /// The build-id is typically a stream of 20 bytes. Return these bytes in
-  /// printable hexadecimal form if they are available, or NoneType otherwise.
+  /// printable hexadecimal form if they are available, or std::nullopt
+  /// otherwise.
   Optional<std::string> getPrintableBuildID() const;
 
   /// If this instance uses a profile, return appropriate profile reader.
index 0f8122d..e550cd8 100644 (file)
@@ -42,7 +42,7 @@ std::string getEscapedName(const StringRef &Name);
 std::string getUnescapedName(const StringRef &Name);
 
 // Determines which register a given DWARF expression is being assigned to.
-// If the expression is defining the CFA, return NoneType.
+// If the expression is defining the CFA, return std::nullopt.
 Optional<uint8_t> readDWARFExpressionTargetReg(StringRef ExprBytes);
 
 } // namespace bolt