aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Support/YAMLParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Support/YAMLParser.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Support/YAMLParser.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/contrib/llvm-project/llvm/lib/Support/YAMLParser.cpp b/contrib/llvm-project/llvm/lib/Support/YAMLParser.cpp
index 578ce228079b..b85b1eb83ef8 100644
--- a/contrib/llvm-project/llvm/lib/Support/YAMLParser.cpp
+++ b/contrib/llvm-project/llvm/lib/Support/YAMLParser.cpp
@@ -13,7 +13,6 @@
#include "llvm/Support/YAMLParser.h"
#include "llvm/ADT/AllocatorList.h"
#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/None.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
@@ -259,8 +258,9 @@ public:
Token getNext();
void printError(SMLoc Loc, SourceMgr::DiagKind Kind, const Twine &Message,
- ArrayRef<SMRange> Ranges = None) {
- SM.PrintMessage(Loc, Kind, Message, Ranges, /* FixIts= */ None, ShowColors);
+ ArrayRef<SMRange> Ranges = std::nullopt) {
+ SM.PrintMessage(Loc, Kind, Message, Ranges, /* FixIts= */ std::nullopt,
+ ShowColors);
}
void setError(const Twine &Message, StringRef::iterator Position) {
@@ -760,7 +760,7 @@ std::string yaml::escape(StringRef Input, bool EscapePrintable) {
return EscapedInput;
}
-llvm::Optional<bool> yaml::parseBool(StringRef S) {
+std::optional<bool> yaml::parseBool(StringRef S) {
switch (S.size()) {
case 1:
switch (S.front()) {
@@ -771,78 +771,78 @@ llvm::Optional<bool> yaml::parseBool(StringRef S) {
case 'N':
return false;
default:
- return None;
+ return std::nullopt;
}
case 2:
switch (S.front()) {
case 'O':
if (S[1] == 'N') // ON
return true;
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case 'o':
if (S[1] == 'n') //[Oo]n
return true;
- return None;
+ return std::nullopt;
case 'N':
if (S[1] == 'O') // NO
return false;
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case 'n':
if (S[1] == 'o') //[Nn]o
return false;
- return None;
+ return std::nullopt;
default:
- return None;
+ return std::nullopt;
}
case 3:
switch (S.front()) {
case 'O':
if (S.drop_front() == "FF") // OFF
return false;
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case 'o':
if (S.drop_front() == "ff") //[Oo]ff
return false;
- return None;
+ return std::nullopt;
case 'Y':
if (S.drop_front() == "ES") // YES
return true;
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case 'y':
if (S.drop_front() == "es") //[Yy]es
return true;
- return None;
+ return std::nullopt;
default:
- return None;
+ return std::nullopt;
}
case 4:
switch (S.front()) {
case 'T':
if (S.drop_front() == "RUE") // TRUE
return true;
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case 't':
if (S.drop_front() == "rue") //[Tt]rue
return true;
- return None;
+ return std::nullopt;
default:
- return None;
+ return std::nullopt;
}
case 5:
switch (S.front()) {
case 'F':
if (S.drop_front() == "ALSE") // FALSE
return false;
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case 'f':
if (S.drop_front() == "alse") //[Ff]alse
return false;
- return None;
+ return std::nullopt;
default:
- return None;
+ return std::nullopt;
}
default:
- return None;
+ return std::nullopt;
}
}
@@ -2285,7 +2285,7 @@ void MappingNode::increment() {
break;
default:
setError("Unexpected token. Expected Key or Block End", T);
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case Token::TK_Error:
IsAtEnd = true;
CurrentEntry = nullptr;
@@ -2298,7 +2298,7 @@ void MappingNode::increment() {
return increment();
case Token::TK_FlowMappingEnd:
getNext();
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case Token::TK_Error:
// Set this to end iterator.
IsAtEnd = true;
@@ -2341,7 +2341,7 @@ void SequenceNode::increment() {
default:
setError( "Unexpected token. Expected Block Entry or Block End."
, T);
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case Token::TK_Error:
IsAtEnd = true;
CurrentEntry = nullptr;
@@ -2370,7 +2370,7 @@ void SequenceNode::increment() {
return increment();
case Token::TK_FlowSequenceEnd:
getNext();
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case Token::TK_Error:
// Set this to end iterator.
IsAtEnd = true;