From a18ca456342267039edb693850595137169c99dd Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 27 Nov 2022 14:40:07 -0800 Subject: [PATCH] [IR] Use std::optional in Instructions.h (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 --- llvm/include/llvm/IR/Instructions.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/IR/Instructions.h b/llvm/include/llvm/IR/Instructions.h index 5dfe0d1..725ee74 100644 --- a/llvm/include/llvm/IR/Instructions.h +++ b/llvm/include/llvm/IR/Instructions.h @@ -38,6 +38,7 @@ #include #include #include +#include namespace llvm { @@ -3618,7 +3619,7 @@ public: /// their prof branch_weights metadata. class SwitchInstProfUpdateWrapper { SwitchInst &SI; - Optional > Weights = None; + std::optional> Weights = None; bool Changed = false; protected: @@ -3629,7 +3630,7 @@ protected: void init(); public: - using CaseWeightOpt = Optional; + using CaseWeightOpt = std::optional; SwitchInst *operator->() { return &SI; } SwitchInst &operator*() { return SI; } operator SwitchInst *() { return &SI; } @@ -5412,7 +5413,7 @@ inline Type *getLoadStoreType(Value *I) { /// A helper function that returns an atomic operation's sync scope; returns /// None if it is not an atomic operation. -inline Optional getAtomicSyncScopeID(const Instruction *I) { +inline std::optional getAtomicSyncScopeID(const Instruction *I) { if (!I->isAtomic()) return None; if (auto *AI = dyn_cast(I)) -- 2.7.4