diff options
author | Stephen Hines <srhines@google.com> | 2015-04-01 18:49:24 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-01 18:49:26 +0000 |
commit | 3fa16bd6062e23bcdb82ed4dd965674792e6b761 (patch) | |
tree | 9348fc507292f7e8715d22d64ce5a32131b4f875 /lib/Support/YAMLTraits.cpp | |
parent | beed47390a60f6f0c77532b3d3f76bb47ef49423 (diff) | |
parent | ebe69fe11e48d322045d5949c83283927a0d790b (diff) | |
download | external_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.zip external_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.tar.gz external_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.tar.bz2 |
Merge "Update aosp/master LLVM for rebase to r230699."
Diffstat (limited to 'lib/Support/YAMLTraits.cpp')
-rw-r--r-- | lib/Support/YAMLTraits.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/Support/YAMLTraits.cpp b/lib/Support/YAMLTraits.cpp index 81edca2..43a0e10 100644 --- a/lib/Support/YAMLTraits.cpp +++ b/lib/Support/YAMLTraits.cpp @@ -8,12 +8,12 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/Errc.h" -#include "llvm/Support/YAMLTraits.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/Casting.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Format.h" #include "llvm/Support/YAMLParser.h" +#include "llvm/Support/YAMLTraits.h" #include "llvm/Support/raw_ostream.h" #include <cctype> #include <cstring> @@ -233,6 +233,13 @@ bool Input::matchEnumScalar(const char *Str, bool) { return false; } +bool Input::matchEnumFallback() { + if (ScalarMatchFound) + return false; + ScalarMatchFound = true; + return true; +} + void Input::endEnumScalar() { if (!ScalarMatchFound) { setError(CurrentNode, "unknown enumerated scalar"); @@ -508,6 +515,13 @@ bool Output::matchEnumScalar(const char *Str, bool Match) { return false; } +bool Output::matchEnumFallback() { + if (EnumerationMatchFound) + return false; + EnumerationMatchFound = true; + return true; +} + void Output::endEnumScalar() { if (!EnumerationMatchFound) llvm_unreachable("bad runtime enum value"); @@ -669,7 +683,7 @@ StringRef ScalarTraits<StringRef>::input(StringRef Scalar, void *, Val = Scalar; return StringRef(); } - + void ScalarTraits<std::string>::output(const std::string &Val, void *, raw_ostream &Out) { Out << Val; |