diff options
Diffstat (limited to 'contrib/llvm-project/llvm/include/llvm/Support/YAMLParser.h')
-rw-r--r-- | contrib/llvm-project/llvm/include/llvm/Support/YAMLParser.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/contrib/llvm-project/llvm/include/llvm/Support/YAMLParser.h b/contrib/llvm-project/llvm/include/llvm/Support/YAMLParser.h index 53009d7ff4aa..759e11afd447 100644 --- a/contrib/llvm-project/llvm/include/llvm/Support/YAMLParser.h +++ b/contrib/llvm-project/llvm/include/llvm/Support/YAMLParser.h @@ -40,6 +40,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/SMLoc.h" +#include "llvm/Support/SourceMgr.h" #include <cassert> #include <cstddef> #include <iterator> @@ -51,7 +52,6 @@ namespace llvm { class MemoryBufferRef; -class SourceMgr; class raw_ostream; class Twine; @@ -78,6 +78,9 @@ bool scanTokens(StringRef Input); /// escaped, but emitted verbatim. std::string escape(StringRef Input, bool EscapePrintable = true); +/// Parse \p S as a bool according to https://yaml.org/type/bool.html. +llvm::Optional<bool> parseBool(StringRef S); + /// This class represents a YAML stream potentially containing multiple /// documents. class Stream { @@ -100,7 +103,10 @@ public: return !failed(); } - void printError(Node *N, const Twine &Msg); + void printError(Node *N, const Twine &Msg, + SourceMgr::DiagKind Kind = SourceMgr::DK_Error); + void printError(const SMRange &Range, const Twine &Msg, + SourceMgr::DiagKind Kind = SourceMgr::DK_Error); private: friend class Document; @@ -222,7 +228,7 @@ public: /// Gets the value of this node as a StringRef. /// - /// \param Storage is used to store the content of the returned StringRef iff + /// \param Storage is used to store the content of the returned StringRef if /// it requires any modification from how it appeared in the source. /// This happens with escaped characters and multi-line literals. StringRef getValue(SmallVectorImpl<char> &Storage) const; @@ -509,7 +515,6 @@ public: : Node(NK_Alias, D, StringRef(), StringRef()), Name(Val) {} StringRef getName() const { return Name; } - Node *getTarget(); static bool classof(const Node *N) { return N->getType() == NK_Alias; } |