diff options
Diffstat (limited to 'llvm/lib/Support/YAMLTraits.cpp')
-rw-r--r-- | llvm/lib/Support/YAMLTraits.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp index aa6163a76161..8cdd03149bcf 100644 --- a/llvm/lib/Support/YAMLTraits.cpp +++ b/llvm/lib/Support/YAMLTraits.cpp @@ -18,13 +18,12 @@ #include "llvm/Support/Format.h" #include "llvm/Support/LineIterator.h" #include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/Unicode.h" +#include "llvm/Support/VersionTuple.h" #include "llvm/Support/YAMLParser.h" #include "llvm/Support/raw_ostream.h" #include <algorithm> #include <cassert> #include <cstdint> -#include <cstdlib> #include <cstring> #include <string> #include <vector> @@ -300,7 +299,7 @@ void Input::endEnumScalar() { bool Input::beginBitSetScalar(bool &DoClear) { BitValuesUsed.clear(); if (SequenceHNode *SQ = dyn_cast<SequenceHNode>(CurrentNode)) { - BitValuesUsed.insert(BitValuesUsed.begin(), SQ->Entries.size(), false); + BitValuesUsed.resize(SQ->Entries.size()); } else { setError(CurrentNode, "expected sequence of bit values"); } @@ -527,8 +526,9 @@ std::vector<StringRef> Output::keys() { } bool Output::preflightKey(const char *Key, bool Required, bool SameAsDefault, - bool &UseDefault, void *&) { + bool &UseDefault, void *&SaveInfo) { UseDefault = false; + SaveInfo = nullptr; if (Required || !SameAsDefault || WriteDefaultValues) { auto State = StateStack.back(); if (State == inFlowMapFirstKey || State == inFlowMapOtherKey) { @@ -599,7 +599,8 @@ void Output::endSequence() { StateStack.pop_back(); } -bool Output::preflightElement(unsigned, void *&) { +bool Output::preflightElement(unsigned, void *&SaveInfo) { + SaveInfo = nullptr; return true; } @@ -627,7 +628,7 @@ void Output::endFlowSequence() { outputUpToEndOfLine(" ]"); } -bool Output::preflightFlowElement(unsigned, void *&) { +bool Output::preflightFlowElement(unsigned, void *&SaveInfo) { if (NeedFlowSequenceComma) output(", "); if (WrapColumn && Column > WrapColumn) { @@ -637,6 +638,7 @@ bool Output::preflightFlowElement(unsigned, void *&) { Column = ColumnAtFlowStart; output(" "); } + SaveInfo = nullptr; return true; } |