diff --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h --- a/llvm/include/llvm/Support/YAMLTraits.h +++ b/llvm/include/llvm/Support/YAMLTraits.h @@ -9,6 +9,7 @@ #ifndef LLVM_SUPPORT_YAMLTRAITS_H #define LLVM_SUPPORT_YAMLTRAITS_H +#include "llvm/ADT/BitVector.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" @@ -1519,7 +1520,7 @@ std::error_code EC; BumpPtrAllocator StringAllocator; document_iterator DocIterator; - std::vector BitValuesUsed; + llvm::BitVector BitValuesUsed; HNode *CurrentNode = nullptr; bool ScalarMatchFound = false; bool AllowUnknownKeys = false; diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp --- a/llvm/lib/Support/YAMLTraits.cpp +++ b/llvm/lib/Support/YAMLTraits.cpp @@ -298,7 +298,7 @@ bool Input::beginBitSetScalar(bool &DoClear) { BitValuesUsed.clear(); if (SequenceHNode *SQ = dyn_cast(CurrentNode)) { - BitValuesUsed.insert(BitValuesUsed.begin(), SQ->Entries.size(), false); + BitValuesUsed.resize(SQ->Entries.size(), false); } else { setError(CurrentNode, "expected sequence of bit values"); }