[llvm] 3583f4f - [X86] Use std::optional in X86SpeculativeLoadHardening.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 25 23:13:28 PST 2022
Author: Kazu Hirata
Date: 2022-11-25T23:13:23-08:00
New Revision: 3583f4ff4b1ea15779467506b36720437e1ab7c3
URL: https://github.com/llvm/llvm-project/commit/3583f4ff4b1ea15779467506b36720437e1ab7c3
DIFF: https://github.com/llvm/llvm-project/commit/3583f4ff4b1ea15779467506b36720437e1ab7c3.diff
LOG: [X86] Use std::optional in X86SpeculativeLoadHardening.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/Target/X86/X86SpeculativeLoadHardening.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp b/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp
index b813edf6a98b5..621da60aac923 100644
--- a/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp
+++ b/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp
@@ -57,6 +57,7 @@
#include <algorithm>
#include <cassert>
#include <iterator>
+#include <optional>
#include <utility>
using namespace llvm;
@@ -164,7 +165,7 @@ class X86SpeculativeLoadHardeningPass : public MachineFunctionPass {
const X86InstrInfo *TII = nullptr;
const TargetRegisterInfo *TRI = nullptr;
- Optional<PredState> PS;
+ std::optional<PredState> PS;
void hardenEdgesWithLFENCE(MachineFunction &MF);
More information about the llvm-commits
mailing list