diff options
author | Kazu Hirata <kazu@google.com> | 2022-11-25 10:22:33 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-11-25 10:22:33 -0800 |
commit | 4a124fd9d1272a6e06eb96ded9ae815304d462cc (patch) | |
tree | 0f9dab54d0d3839c9bad9ff0c61d0daf4996f56e /llvm/lib/Analysis/InlineCost.cpp | |
parent | d49613f4d8108f782c2dfdfa68b21a9e2489426c (diff) | |
download | llvm-4a124fd9d1272a6e06eb96ded9ae815304d462cc.zip llvm-4a124fd9d1272a6e06eb96ded9ae815304d462cc.tar.gz llvm-4a124fd9d1272a6e06eb96ded9ae815304d462cc.tar.bz2 |
[Analysis] Use std::optional in InlineCost.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
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index e17b908..96b733d 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -44,6 +44,7 @@ #include "llvm/Support/raw_ostream.h" #include <climits> #include <limits> +#include <optional> using namespace llvm; @@ -489,7 +490,7 @@ public: InlineResult analyze(); - Optional<Constant *> getSimplifiedValue(Instruction *I) { + std::optional<Constant *> getSimplifiedValue(Instruction *I) { if (SimplifiedValues.find(I) != SimplifiedValues.end()) return SimplifiedValues[I]; return None; @@ -814,7 +815,7 @@ class InlineCostCallAnalyzer final : public CallAnalyzer { // Determine whether we should inline the given call site, taking into account // both the size cost and the cycle savings. Return None if we don't have // suficient profiling information to determine. - Optional<bool> costBenefitAnalysis() { + std::optional<bool> costBenefitAnalysis() { if (!CostBenefitAnalysisEnabled) return None; |