diff options
author | Kazu Hirata <kazu@google.com> | 2022-12-03 11:54:46 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-12-03 11:54:46 -0800 |
commit | 5891420e6848e86a069dc6b7b73f175e22388f4a (patch) | |
tree | 99d82aa1d75dbd2abc6df791b87c384c49277431 /clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp | |
parent | 0c2f6e36f9b2d26a2665e38a76ae8a95c158c4c7 (diff) | |
download | llvm-5891420e6848e86a069dc6b7b73f175e22388f4a.zip llvm-5891420e6848e86a069dc6b7b73f175e22388f4a.tar.gz llvm-5891420e6848e86a069dc6b7b73f175e22388f4a.tar.bz2 |
[clang] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.
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
Diffstat (limited to 'clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp')
-rw-r--r-- | clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp index b74cf5b..91dc252 100644 --- a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp +++ b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp @@ -60,7 +60,7 @@ void serializeArray(Object &Paren, StringRef Key, Optional<Array> Array) { /// the semantic version representation of \p V. Optional<Object> serializeSemanticVersion(const VersionTuple &V) { if (V.empty()) - return None; + return std::nullopt; Object Version; Version["major"] = V.getMajor(); @@ -146,7 +146,7 @@ Object serializeSourceRange(const PresumedLoc &BeginLoc, /// an \c Array containing the formatted availability information. Optional<Array> serializeAvailability(const AvailabilitySet &Availabilities) { if (Availabilities.isDefault()) - return None; + return std::nullopt; Array AvailabilityArray; @@ -232,7 +232,7 @@ Object serializeIdentifier(const APIRecord &Record, Language Lang) { /// formatted lines. Optional<Object> serializeDocComment(const DocComment &Comment) { if (Comment.empty()) - return None; + return std::nullopt; Object DocComment; Array LinesArray; @@ -284,7 +284,7 @@ Optional<Object> serializeDocComment(const DocComment &Comment) { /// declaration fragments array. Optional<Array> serializeDeclarationFragments(const DeclarationFragments &DF) { if (DF.getFragments().empty()) - return None; + return std::nullopt; Array Fragments; for (const auto &F : DF.getFragments()) { @@ -412,7 +412,7 @@ Optional<Object> serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::true_type) { const auto &FS = Record.Signature; if (FS.empty()) - return None; + return std::nullopt; Object Signature; serializeArray(Signature, "returns", @@ -436,7 +436,7 @@ Optional<Object> serializeFunctionSignatureMixinImpl(const RecordTy &Record, template <typename RecordTy> Optional<Object> serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) { - return None; + return std::nullopt; } /// Serialize the function signature field, as specified by the @@ -501,7 +501,7 @@ template <typename RecordTy> Optional<Object> SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const { if (shouldSkip(Record)) - return None; + return std::nullopt; Object Obj; serializeObject(Obj, "identifier", |