[llvm] ae634b1 - [Analysis] Use std::optional in TensorSpec.h (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 27 12:18:53 PST 2022
Author: Kazu Hirata
Date: 2022-11-27T12:18:28-08:00
New Revision: ae634b16e901f3e13ed917771957c30e15b7f1b2
URL: https://github.com/llvm/llvm-project/commit/ae634b16e901f3e13ed917771957c30e15b7f1b2
DIFF: https://github.com/llvm/llvm-project/commit/ae634b16e901f3e13ed917771957c30e15b7f1b2.diff
LOG: [Analysis] Use std::optional in TensorSpec.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/Analysis/TensorSpec.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/TensorSpec.h b/llvm/include/llvm/Analysis/TensorSpec.h
index 382ab3f10445..13c72568cd57 100644
--- a/llvm/include/llvm/Analysis/TensorSpec.h
+++ b/llvm/include/llvm/Analysis/TensorSpec.h
@@ -16,6 +16,7 @@
#include "llvm/Support/JSON.h"
#include <memory>
+#include <optional>
#include <vector>
namespace llvm {
@@ -107,7 +108,7 @@ Optional<TensorSpec> getTensorSpecFromJSON(LLVMContext &Ctx,
struct LoggedFeatureSpec {
TensorSpec Spec;
- Optional<std::string> LoggingName;
+ std::optional<std::string> LoggingName;
const std::string &getLoggingName() const {
return LoggingName ? *LoggingName : Spec.name();
}
More information about the llvm-commits
mailing list