[llvm] e8a60b7 - [Linker] Use std::optional in IRMover.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 25 12:18:28 PST 2022
Author: Kazu Hirata
Date: 2022-11-25T12:18:23-08:00
New Revision: e8a60b75d7e8f33ca113caf9efa29dc305b64017
URL: https://github.com/llvm/llvm-project/commit/e8a60b75d7e8f33ca113caf9efa29dc305b64017
DIFF: https://github.com/llvm/llvm-project/commit/e8a60b75d7e8f33ca113caf9efa29dc305b64017.diff
LOG: [Linker] Use std::optional in IRMover.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/Linker/IRMover.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp
index f9b46550e0ac7..d9dcd613bd7cd 100644
--- a/llvm/lib/Linker/IRMover.cpp
+++ b/llvm/lib/Linker/IRMover.cpp
@@ -27,6 +27,7 @@
#include "llvm/Support/Error.h"
#include "llvm/Support/Path.h"
#include "llvm/Transforms/Utils/ValueMapper.h"
+#include <optional>
#include <utility>
using namespace llvm;
@@ -425,7 +426,7 @@ class IRLinker {
/// The Error encountered during materialization. We use an Optional here to
/// avoid needing to manage an unconsumed success value.
- Optional<Error> FoundError;
+ std::optional<Error> FoundError;
void setError(Error E) {
if (E)
FoundError = std::move(E);
More information about the llvm-commits
mailing list