aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/BasicBlockSections.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-12-20 15:42:32 -0800
committerKazu Hirata <kazu@google.com>2022-12-20 15:42:32 -0800
commit77c90c8ce0fe763b6ee2809a6dc437d6f18e1af2 (patch)
tree15a121e20136c30cacf9258d23b34d61c46a79bd /llvm/lib/CodeGen/BasicBlockSections.cpp
parent0b401ba71325c06a61f948c801685de021455b13 (diff)
downloadllvm-77c90c8ce0fe763b6ee2809a6dc437d6f18e1af2.zip
llvm-77c90c8ce0fe763b6ee2809a6dc437d6f18e1af2.tar.gz
llvm-77c90c8ce0fe763b6ee2809a6dc437d6f18e1af2.tar.bz2
[llvm] Use std::optional instead of Optional
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/BasicBlockSections.cpp')
-rw-r--r--llvm/lib/CodeGen/BasicBlockSections.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/BasicBlockSections.cpp b/llvm/lib/CodeGen/BasicBlockSections.cpp
index 776ab634..67db95b 100644
--- a/llvm/lib/CodeGen/BasicBlockSections.cpp
+++ b/llvm/lib/CodeGen/BasicBlockSections.cpp
@@ -167,7 +167,7 @@ static void updateBranches(
bool getBBClusterInfoForFunction(
const MachineFunction &MF,
BasicBlockSectionsProfileReader *BBSectionsProfileReader,
- std::vector<Optional<BBClusterInfo>> &V) {
+ std::vector<std::optional<BBClusterInfo>> &V) {
// Find the assoicated cluster information.
std::pair<bool, SmallVector<BBClusterInfo, 4>> P =
@@ -201,9 +201,9 @@ bool getBBClusterInfoForFunction(
// and "Cold" succeeding all other clusters.
// FuncBBClusterInfo represent the cluster information for basic blocks. If this
// is empty, it means unique sections for all basic blocks in the function.
-static void
-assignSections(MachineFunction &MF,
- const std::vector<Optional<BBClusterInfo>> &FuncBBClusterInfo) {
+static void assignSections(
+ MachineFunction &MF,
+ const std::vector<std::optional<BBClusterInfo>> &FuncBBClusterInfo) {
assert(MF.hasBBSections() && "BB Sections is not set for function.");
// This variable stores the section ID of the cluster containing eh_pads (if
// all eh_pads are one cluster). If more than one cluster contain eh_pads, we
@@ -331,7 +331,7 @@ bool BasicBlockSections::runOnMachineFunction(MachineFunction &MF) {
BBSectionsProfileReader = &getAnalysis<BasicBlockSectionsProfileReader>();
- std::vector<Optional<BBClusterInfo>> FuncBBClusterInfo;
+ std::vector<std::optional<BBClusterInfo>> FuncBBClusterInfo;
if (BBSectionsType == BasicBlockSection::List &&
!getBBClusterInfoForFunction(MF, BBSectionsProfileReader,
FuncBBClusterInfo))