[llvm] 940e819 - [ProfileData] Use std::optional in GCOV.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 25 20:35:48 PST 2022
Author: Kazu Hirata
Date: 2022-11-25T20:35:43-08:00
New Revision: 940e8190fba070d5b978185a578993e4fc64e535
URL: https://github.com/llvm/llvm-project/commit/940e8190fba070d5b978185a578993e4fc64e535
DIFF: https://github.com/llvm/llvm-project/commit/940e8190fba070d5b978185a578993e4fc64e535.diff
LOG: [ProfileData] Use std::optional in GCOV.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/ProfileData/GCOV.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ProfileData/GCOV.cpp b/llvm/lib/ProfileData/GCOV.cpp
index 76046ed98001..5af92799e05e 100644
--- a/llvm/lib/ProfileData/GCOV.cpp
+++ b/llvm/lib/ProfileData/GCOV.cpp
@@ -23,6 +23,7 @@
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
+#include <optional>
#include <system_error>
using namespace llvm;
@@ -878,7 +879,7 @@ void Context::print(StringRef filename, StringRef gcno, StringRef gcda,
if (options.NoOutput || options.Intermediate)
continue;
- Optional<raw_fd_ostream> os;
+ std::optional<raw_fd_ostream> os;
if (!options.UseStdout) {
std::error_code ec;
os.emplace(gcovName, ec, sys::fs::OF_TextWithCRLF);
More information about the llvm-commits
mailing list