Skip to content

Commit

Permalink
[BinaryFormat] Use std::optional instead of llvm::Optional (NFC)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kazutakahirata committed Dec 17, 2022
1 parent c9e121e commit bcf2402
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
Expand Up @@ -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 {

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit bcf2402

Please sign in to comment.