[llvm] f64505c - [llvm-cov] Use std::optional in CodeCoverage.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 26 18:42:52 PST 2022
Author: Kazu Hirata
Date: 2022-11-26T18:42:47-08:00
New Revision: f64505c0f2f280d38c368ddac648d4b053c29eac
URL: https://github.com/llvm/llvm-project/commit/f64505c0f2f280d38c368ddac648d4b053c29eac
DIFF: https://github.com/llvm/llvm-project/commit/f64505c0f2f280d38c368ddac648d4b053c29eac.diff
LOG: [llvm-cov] Use std::optional in CodeCoverage.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-cov/CodeCoverage.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp
index 9f19dd2856592..6380b7819ac55 100644
--- a/llvm/tools/llvm-cov/CodeCoverage.cpp
+++ b/llvm/tools/llvm-cov/CodeCoverage.cpp
@@ -41,6 +41,7 @@
#include <functional>
#include <map>
+#include <optional>
#include <system_error>
using namespace llvm;
@@ -157,7 +158,7 @@ class CodeCoverageTool {
/// The coverage data path to be remapped from, and the source path to be
/// remapped to, when using -path-equivalence.
- Optional<std::pair<std::string, std::string>> PathRemapping;
+ std::optional<std::pair<std::string, std::string>> PathRemapping;
/// File status cache used when finding the same file.
StringMap<Optional<sys::fs::file_status>> FileStatusCache;
More information about the llvm-commits
mailing list