From: Kazu Hirata Date: Sun, 27 Nov 2022 04:53:26 +0000 (-0800) Subject: [COFF] Use std::optional in Driver.cpp (NFC) X-Git-Tag: upstream/17.0.6~26360 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd8d0b03c9ee2b65d49badd4644ac58e8c80d8be;p=platform%2Fupstream%2Fllvm.git [COFF] Use std::optional in Driver.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 --- diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp index 164af3f..33ed55a 100644 --- a/lld/COFF/Driver.cpp +++ b/lld/COFF/Driver.cpp @@ -52,6 +52,7 @@ #include #include #include +#include using namespace llvm; using namespace llvm::object; @@ -1320,7 +1321,7 @@ void LinkerDriver::maybeExportMinGWSymbols(const opt::InputArgList &args) { AutoExporter exporter(excludedSymbols); for (auto *arg : args.filtered(OPT_wholearchive_file)) - if (Optional path = doFindFile(arg->getValue())) + if (std::optional path = doFindFile(arg->getValue())) exporter.addWholeArchive(*path); for (auto *arg : args.filtered(OPT_exclude_symbols)) { @@ -1733,7 +1734,7 @@ void LinkerDriver::linkerMain(ArrayRef argsArr) { // Handle /opt. bool doGC = debug == DebugKind::None || args.hasArg(OPT_profile); - Optional icfLevel; + std::optional icfLevel; if (args.hasArg(OPT_profile)) icfLevel = ICFLevel::None; unsigned tailMerge = 1; @@ -1951,7 +1952,7 @@ void LinkerDriver::linkerMain(ArrayRef argsArr) { std::set wholeArchives; for (auto *arg : args.filtered(OPT_wholearchive_file)) - if (Optional path = doFindFile(arg->getValue())) + if (std::optional path = doFindFile(arg->getValue())) if (Optional id = getUniqueID(*path)) wholeArchives.insert(*id);