summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2011-12-20 11:04:23 +0000
committerManuel Klimek <klimek@google.com>2011-12-20 11:04:23 +0000
commitfe198ced31e9d055e8d27fa992423d59af4f1535 (patch)
tree99c1c42e2ea58df3c7af1a02a14464d689e7e129
parenta187964bacba696372c612ea8377a204b8d2f273 (diff)
downloadbcm5719-llvm-fe198ced31e9d055e8d27fa992423d59af4f1535.tar.gz
bcm5719-llvm-fe198ced31e9d055e8d27fa992423d59af4f1535.zip
Fixes a potential compilation error.
Pulling the template implementation into the header to guarantee that it's visible to all possible instantiations. llvm-svn: 146973
-rw-r--r--llvm/include/llvm/Support/JSONParser.h11
-rw-r--r--llvm/lib/Support/JSONParser.cpp12
2 files changed, 10 insertions, 13 deletions
diff --git a/llvm/include/llvm/Support/JSONParser.h b/llvm/include/llvm/Support/JSONParser.h
index 0150646bc37..f4cdfa56088 100644
--- a/llvm/include/llvm/Support/JSONParser.h
+++ b/llvm/include/llvm/Support/JSONParser.h
@@ -128,7 +128,16 @@ private:
/// \brief Skips all elements in the given container.
template <typename ContainerT>
- bool skipContainer(const ContainerT &Container);
+ bool skipContainer(const ContainerT &Container) {
+ for (typename ContainerT::const_iterator I = Container.current(),
+ E = Container.end();
+ I != E; ++I) {
+ assert(*I != 0);
+ if (!skip(**I))
+ return false;
+ }
+ return !failed();
+ }
/// \brief Skips to the next position behind the given JSON atom.
bool skip(const JSONAtom &Atom);
diff --git a/llvm/lib/Support/JSONParser.cpp b/llvm/lib/Support/JSONParser.cpp
index 02187409cbf..994ca9fc966 100644
--- a/llvm/lib/Support/JSONParser.cpp
+++ b/llvm/lib/Support/JSONParser.cpp
@@ -43,18 +43,6 @@ bool JSONParser::validate() {
return skip(*parseRoot());
}
-template <typename ContainerT>
-bool JSONParser::skipContainer(const ContainerT &Container) {
- for (typename ContainerT::const_iterator I = Container.current(),
- E = Container.end();
- I != E; ++I) {
- assert(*I != 0);
- if (!skip(**I))
- return false;
- }
- return !failed();
-}
-
bool JSONParser::skip(const JSONAtom &Atom) {
switch(Atom.getKind()) {
case JSONAtom::JK_Array: return skipContainer(*cast<JSONArray>(&Atom));
OpenPOWER on IntegriCloud