Skip to content

Commit

Permalink
[CodeGen] Use std::optional in BasicBlockSections.cpp (NFC)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kazutakahirata committed Nov 26, 2022
1 parent 644159e commit 07ce3b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/CodeGen/BasicBlockSections.cpp
Expand Up @@ -79,6 +79,7 @@
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/InitializePasses.h"
#include "llvm/Target/TargetMachine.h"
#include <optional>

using namespace llvm;

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 07ce3b8

Please sign in to comment.