[llvm] 20d2432 - [llvm-profdata] Use std::optional in llvm-profdata.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 26 18:59:47 PST 2022
Author: Kazu Hirata
Date: 2022-11-26T18:59:41-08:00
New Revision: 20d243204011ae2e8ada7a1e4cf815757a372ea8
URL: https://github.com/llvm/llvm-project/commit/20d243204011ae2e8ada7a1e4cf815757a372ea8
DIFF: https://github.com/llvm/llvm-project/commit/20d243204011ae2e8ada7a1e4cf815757a372ea8.diff
LOG: [llvm-profdata] Use std::optional in llvm-profdata.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/tools/llvm-profdata/llvm-profdata.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp
index 5e2067e9fd716..c80d96913a6e5 100644
--- a/llvm/tools/llvm-profdata/llvm-profdata.cpp
+++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp
@@ -40,6 +40,7 @@
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cmath>
+#include <optional>
#include <queue>
using namespace llvm;
@@ -866,8 +867,8 @@ mergeSampleProfile(const WeightedFileVector &Inputs, SymbolRemapper *Remapper,
SmallVector<std::unique_ptr<sampleprof::SampleProfileReader>, 5> Readers;
LLVMContext Context;
sampleprof::ProfileSymbolList WriterList;
- Optional<bool> ProfileIsProbeBased;
- Optional<bool> ProfileIsCS;
+ std::optional<bool> ProfileIsProbeBased;
+ std::optional<bool> ProfileIsCS;
for (const auto &Input : Inputs) {
auto ReaderOrErr = SampleProfileReader::create(Input.Filename, Context,
FSDiscriminatorPassOption);
More information about the llvm-commits
mailing list