From 093147abf423428d338979a839273369810698cc Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Tue, 20 Dec 2011 11:04:23 +0000 Subject: [PATCH] Fixes a potential compilation error. Pulling the template implementation into the header to guarantee that it's visible to all possible instantiations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146973 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/JSONParser.h | 11 ++++++++++- lib/Support/JSONParser.cpp | 12 ------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/include/llvm/Support/JSONParser.h b/include/llvm/Support/JSONParser.h index 0150646bc37..f4cdfa56088 100644 --- a/include/llvm/Support/JSONParser.h +++ b/include/llvm/Support/JSONParser.h @@ -128,7 +128,16 @@ private: /// \brief Skips all elements in the given container. template - 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/lib/Support/JSONParser.cpp b/lib/Support/JSONParser.cpp index 02187409cbf..994ca9fc966 100644 --- a/lib/Support/JSONParser.cpp +++ b/lib/Support/JSONParser.cpp @@ -43,18 +43,6 @@ bool JSONParser::validate() { return skip(*parseRoot()); } -template -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(&Atom));