[llvm] 38a2968 - [Scalar] Use std::optional in GVN.h (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 27 18:26:20 PST 2022
Author: Kazu Hirata
Date: 2022-11-27T18:24:43-08:00
New Revision: 38a29686d4e6609489aeea2132afd64b4251a224
URL: https://github.com/llvm/llvm-project/commit/38a29686d4e6609489aeea2132afd64b4251a224
DIFF: https://github.com/llvm/llvm-project/commit/38a29686d4e6609489aeea2132afd64b4251a224.diff
LOG: [Scalar] Use std::optional in GVN.h (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/include/llvm/Transforms/Scalar/GVN.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Transforms/Scalar/GVN.h b/llvm/include/llvm/Transforms/Scalar/GVN.h
index 16ab1a4901629..85d0cde3670b8 100644
--- a/llvm/include/llvm/Transforms/Scalar/GVN.h
+++ b/llvm/include/llvm/Transforms/Scalar/GVN.h
@@ -26,6 +26,7 @@
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Compiler.h"
#include <cstdint>
+#include <optional>
#include <utility>
#include <vector>
@@ -71,11 +72,11 @@ class GVNLegacyPass;
/// Intended use is to create a default object, modify parameters with
/// additional setters and then pass it to GVN.
struct GVNOptions {
- Optional<bool> AllowPRE = None;
- Optional<bool> AllowLoadPRE = None;
- Optional<bool> AllowLoadInLoopPRE = None;
- Optional<bool> AllowLoadPRESplitBackedge = None;
- Optional<bool> AllowMemDep = None;
+ std::optional<bool> AllowPRE = None;
+ std::optional<bool> AllowLoadPRE = None;
+ std::optional<bool> AllowLoadInLoopPRE = None;
+ std::optional<bool> AllowLoadPRESplitBackedge = None;
+ std::optional<bool> AllowMemDep = None;
GVNOptions() = default;
More information about the llvm-commits
mailing list