diff options
-rw-r--r-- | llvm/include/llvm/Support/YAMLTraits.h | 2 | ||||
-rw-r--r-- | llvm/lib/Support/YAMLTraits.cpp | 10 |
2 files changed, 1 insertions, 11 deletions
diff --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h index 6860eef9a22..cbba9c08275 100644 --- a/llvm/include/llvm/Support/YAMLTraits.h +++ b/llvm/include/llvm/Support/YAMLTraits.h @@ -1198,8 +1198,6 @@ private: typedef llvm::StringMap<std::unique_ptr<HNode>> NameToNode; - bool isValidKey(StringRef key); - NameToNode Mapping; llvm::SmallVector<std::string, 6> ValidKeys; }; diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp index 51c016b1d55..9849b3aa1ce 100644 --- a/llvm/lib/Support/YAMLTraits.cpp +++ b/llvm/lib/Support/YAMLTraits.cpp @@ -175,7 +175,7 @@ void Input::endMapping() { if (!MN) return; for (const auto &NN : MN->Mapping) { - if (!MN->isValidKey(NN.first())) { + if (!is_contained(MN->ValidKeys, NN.first())) { setError(NN.second.get(), Twine("unknown key '") + NN.first() + "'"); break; } @@ -385,14 +385,6 @@ std::unique_ptr<Input::HNode> Input::createHNodes(Node *N) { } } -bool Input::MapHNode::isValidKey(StringRef Key) { - for (std::string &K : ValidKeys) { - if (Key == K) - return true; - } - return false; -} - void Input::setError(const Twine &Message) { this->setError(CurrentNode, Message); } |