diff --git a/bolt/include/bolt/Profile/BoltAddressTranslation.h b/bolt/include/bolt/Profile/BoltAddressTranslation.h --- a/bolt/include/bolt/Profile/BoltAddressTranslation.h +++ b/bolt/include/bolt/Profile/BoltAddressTranslation.h @@ -9,11 +9,11 @@ #ifndef BOLT_PROFILE_BOLTADDRESSTRANSLATION_H #define BOLT_PROFILE_BOLTADDRESSTRANSLATION_H -#include "llvm/ADT/Optional.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include #include +#include #include namespace llvm { @@ -98,9 +98,9 @@ /// taken in the path started at FirstLBR.To and ending at SecondLBR.From. /// Return std::nullopt if trace is invalid or the list of fall-throughs /// otherwise. - Optional getFallthroughsInTrace(uint64_t FuncAddress, - uint64_t From, - uint64_t To) const; + std::optional getFallthroughsInTrace(uint64_t FuncAddress, + uint64_t From, + uint64_t To) const; /// If available, fetch the address of the hot part linked to the cold part /// at \p Address. Return 0 otherwise. diff --git a/bolt/include/bolt/Profile/DataAggregator.h b/bolt/include/bolt/Profile/DataAggregator.h --- a/bolt/include/bolt/Profile/DataAggregator.h +++ b/bolt/include/bolt/Profile/DataAggregator.h @@ -206,7 +206,7 @@ /// Return a vector of offsets corresponding to a trace in a function /// (see recordTrace() above). - Optional, 16>> + std::optional, 16>> getFallthroughsInTrace(BinaryFunction &BF, const LBREntry &First, const LBREntry &Second, uint64_t Count = 1) const; diff --git a/bolt/lib/Profile/BoltAddressTranslation.cpp b/bolt/lib/Profile/BoltAddressTranslation.cpp --- a/bolt/lib/Profile/BoltAddressTranslation.cpp +++ b/bolt/lib/Profile/BoltAddressTranslation.cpp @@ -248,7 +248,7 @@ return Offset - KeyVal->first + Val; } -Optional +std::optional BoltAddressTranslation::getFallthroughsInTrace(uint64_t FuncAddress, uint64_t From, uint64_t To) const { diff --git a/bolt/lib/Profile/DataAggregator.cpp b/bolt/lib/Profile/DataAggregator.cpp --- a/bolt/lib/Profile/DataAggregator.cpp +++ b/bolt/lib/Profile/DataAggregator.cpp @@ -831,7 +831,7 @@ return false; } - Optional FTs = + std::optional FTs = BAT ? BAT->getFallthroughsInTrace(FromFunc->getAddress(), First.To, Second.From) : getFallthroughsInTrace(*FromFunc, First, Second, Count); @@ -943,7 +943,7 @@ return true; } -Optional, 16>> +std::optional, 16>> DataAggregator::getFallthroughsInTrace(BinaryFunction &BF, const LBREntry &FirstLBR, const LBREntry &SecondLBR,