[llvm] 171b749 - [IR] Use std::optional in IntrinsicInst.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 25 12:03:46 PST 2022
Author: Kazu Hirata
Date: 2022-11-25T12:03:40-08:00
New Revision: 171b749dc130bd01ab5c716417c120918c4e6372
URL: https://github.com/llvm/llvm-project/commit/171b749dc130bd01ab5c716417c120918c4e6372
DIFF: https://github.com/llvm/llvm-project/commit/171b749dc130bd01ab5c716417c120918c4e6372.diff
LOG: [IR] Use std::optional in IntrinsicInst.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/IR/IntrinsicInst.cpp
Removed:
################################################################################
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp
index f91b148bfe74..2cdebae52a95 100644
--- a/llvm/lib/IR/IntrinsicInst.cpp
+++ b/llvm/lib/IR/IntrinsicInst.cpp
@@ -29,6 +29,7 @@
#include "llvm/IR/Operator.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/IR/Statepoint.h"
+#include <optional>
using namespace llvm;
@@ -682,7 +683,7 @@ static ICmpInst::Predicate getIntPredicateFromMD(const Value *Op) {
CmpInst::Predicate VPCmpIntrinsic::getPredicate() const {
bool IsFP = true;
- Optional<unsigned> CCArgIdx;
+ std::optional<unsigned> CCArgIdx;
switch (getIntrinsicID()) {
default:
break;
More information about the llvm-commits
mailing list