[llvm] b669a2c - [ObjectYAML] Use std::optional in MinidumpEmitter.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 25 12:34:15 PST 2022
Author: Kazu Hirata
Date: 2022-11-25T12:34:10-08:00
New Revision: b669a2ca455cf690efcaa6ef11df943082bb686e
URL: https://github.com/llvm/llvm-project/commit/b669a2ca455cf690efcaa6ef11df943082bb686e
DIFF: https://github.com/llvm/llvm-project/commit/b669a2ca455cf690efcaa6ef11df943082bb686e.diff
LOG: [ObjectYAML] Use std::optional in MinidumpEmitter.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/ObjectYAML/MinidumpEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ObjectYAML/MinidumpEmitter.cpp b/llvm/lib/ObjectYAML/MinidumpEmitter.cpp
index 9505473a2415..3affeea66fa6 100644
--- a/llvm/lib/ObjectYAML/MinidumpEmitter.cpp
+++ b/llvm/lib/ObjectYAML/MinidumpEmitter.cpp
@@ -10,6 +10,7 @@
#include "llvm/ObjectYAML/yaml2obj.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/raw_ostream.h"
+#include <optional>
using namespace llvm;
using namespace llvm::minidump;
@@ -173,7 +174,7 @@ static Directory layout(BlobAllocator &File, Stream &S) {
Directory Result;
Result.Type = S.Type;
Result.Location.RVA = File.tell();
- Optional<size_t> DataEnd;
+ std::optional<size_t> DataEnd;
switch (S.Kind) {
case Stream::StreamKind::Exception:
DataEnd = layout(File, cast<MinidumpYAML::ExceptionStream>(S));
More information about the llvm-commits
mailing list