[llvm] bcf2402 - [BinaryFormat] Use std::optional instead of llvm::Optional (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 16 23:20:17 PST 2022
Author: Kazu Hirata
Date: 2022-12-16T23:20:12-08:00
New Revision: bcf24026b9fe4bf019471b921138148ab78e1284
URL: https://github.com/llvm/llvm-project/commit/bcf24026b9fe4bf019471b921138148ab78e1284
DIFF: https://github.com/llvm/llvm-project/commit/bcf24026b9fe4bf019471b921138148ab78e1284.diff
LOG: [BinaryFormat] Use std::optional instead of llvm::Optional (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/BinaryFormat/AMDGPUMetadataVerifier.h
llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h b/llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
index 345c3370f77c3..f6268b48e6b29 100644
--- a/llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
+++ b/llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
@@ -16,12 +16,12 @@
#ifndef LLVM_BINARYFORMAT_AMDGPUMETADATAVERIFIER_H
#define LLVM_BINARYFORMAT_AMDGPUMETADATAVERIFIER_H
-#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLFunctionalExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/MsgPackReader.h"
#include <cstddef>
+#include <optional>
namespace llvm {
@@ -49,7 +49,7 @@ class MetadataVerifier {
bool verifyInteger(msgpack::DocNode &Node);
bool verifyArray(msgpack::DocNode &Node,
function_ref<bool(msgpack::DocNode &)> verifyNode,
- Optional<size_t> Size = std::nullopt);
+ std::optional<size_t> Size = std::nullopt);
bool verifyEntry(msgpack::MapDocNode &MapNode, StringRef Key, bool Required,
function_ref<bool(msgpack::DocNode &)> verifyNode);
bool
diff --git a/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp b/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp
index 64d2c979b28d1..c451da27d7eab 100644
--- a/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp
+++ b/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp
@@ -56,7 +56,7 @@ bool MetadataVerifier::verifyInteger(msgpack::DocNode &Node) {
bool MetadataVerifier::verifyArray(
msgpack::DocNode &Node, function_ref<bool(msgpack::DocNode &)> verifyNode,
- Optional<size_t> Size) {
+ std::optional<size_t> Size) {
if (!Node.isArray())
return false;
auto &Array = Node.getArray();
More information about the llvm-commits
mailing list