[lld] ef70f9f - [COFF] Use std::optional in InputFiles.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 26 20:54:41 PST 2022
Author: Kazu Hirata
Date: 2022-11-26T20:54:36-08:00
New Revision: ef70f9f12e57b4c6aa4db8a077073f0f0bbc513b
URL: https://github.com/llvm/llvm-project/commit/ef70f9f12e57b4c6aa4db8a077073f0f0bbc513b
DIFF: https://github.com/llvm/llvm-project/commit/ef70f9f12e57b4c6aa4db8a077073f0f0bbc513b.diff
LOG: [COFF] Use std::optional in InputFiles.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:
lld/COFF/InputFiles.cpp
Removed:
################################################################################
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index ea95648f7e61..10ff860c97b7 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -37,6 +37,7 @@
#include "llvm/Support/Path.h"
#include "llvm/Target/TargetOptions.h"
#include <cstring>
+#include <optional>
#include <system_error>
#include <utility>
@@ -840,8 +841,8 @@ static std::string normalizePdbPath(StringRef path) {
}
// If existing, return the actual PDB path on disk.
-static Optional<std::string> findPdbPath(StringRef pdbPath,
- ObjFile *dependentFile) {
+static std::optional<std::string> findPdbPath(StringRef pdbPath,
+ ObjFile *dependentFile) {
// Ensure the file exists before anything else. In some cases, if the path
// points to a removable device, Driver::enqueuePath() would fail with an
// error (EAGAIN, "resource unavailable try again") which we want to skip
More information about the llvm-commits
mailing list