[llvm] 07ce3b8 - [CodeGen] Use std::optional in BasicBlockSections.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 26 14:24:43 PST 2022
Author: Kazu Hirata
Date: 2022-11-26T14:24:38-08:00
New Revision: 07ce3b8abd5ff1467d08cf53a4d1066da79ecc7d
URL: https://github.com/llvm/llvm-project/commit/07ce3b8abd5ff1467d08cf53a4d1066da79ecc7d
DIFF: https://github.com/llvm/llvm-project/commit/07ce3b8abd5ff1467d08cf53a4d1066da79ecc7d.diff
LOG: [CodeGen] Use std::optional in BasicBlockSections.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/BasicBlockSections.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/BasicBlockSections.cpp b/llvm/lib/CodeGen/BasicBlockSections.cpp
index 958212a0e448..3249022107a0 100644
--- a/llvm/lib/CodeGen/BasicBlockSections.cpp
+++ b/llvm/lib/CodeGen/BasicBlockSections.cpp
@@ -79,6 +79,7 @@
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/InitializePasses.h"
#include "llvm/Target/TargetMachine.h"
+#include <optional>
using namespace llvm;
@@ -208,7 +209,7 @@ assignSections(MachineFunction &MF,
// 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
// set it equal to ExceptionSectionID.
- Optional<MBBSectionID> EHPadsSectionID;
+ std::optional<MBBSectionID> EHPadsSectionID;
for (auto &MBB : MF) {
// With the 'all' option, every basic block is placed in a unique section.
More information about the llvm-commits
mailing list