[llvm] 170666e - [llvm-dwp] Use std::optional in llvm-dwp.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 26 18:49:32 PST 2022
Author: Kazu Hirata
Date: 2022-11-26T18:49:27-08:00
New Revision: 170666eb4abc58f77da363fcd3688bd128fa5fae
URL: https://github.com/llvm/llvm-project/commit/170666eb4abc58f77da363fcd3688bd128fa5fae
DIFF: https://github.com/llvm/llvm-project/commit/170666eb4abc58f77da363fcd3688bd128fa5fae.diff
LOG: [llvm-dwp] Use std::optional in llvm-dwp.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-dwp/llvm-dwp.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp
index 7378e824e3b08..0a2c1c1ccc023 100644
--- a/llvm/tools/llvm-dwp/llvm-dwp.cpp
+++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp
@@ -29,6 +29,7 @@
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/ToolOutputFile.h"
+#include <optional>
using namespace llvm;
using namespace llvm::object;
@@ -187,7 +188,7 @@ int main(int argc, char **argv) {
// Create the output file.
std::error_code EC;
ToolOutputFile OutFile(OutputFilename, EC, sys::fs::OF_None);
- Optional<buffer_ostream> BOS;
+ std::optional<buffer_ostream> BOS;
raw_pwrite_stream *OS;
if (EC)
return error(Twine(OutputFilename) + ": " + EC.message(), Context);
More information about the llvm-commits
mailing list