[llvm-commits] [llvm] r146973 - in /llvm/trunk: include/llvm/Support/JSONParser.h lib/Support/JSONParser.cpp

Manuel Klimek klimek at google.com
Tue Dec 20 03:04:23 PST 2011


Author: klimek
Date: Tue Dec 20 05:04:23 2011
New Revision: 146973

URL: http://llvm.org/viewvc/llvm-project?rev=146973&view=rev
Log:
Fixes a potential compilation error.

Pulling the template implementation into the header to guarantee
that it's visible to all possible instantiations.

Modified:
    llvm/trunk/include/llvm/Support/JSONParser.h
    llvm/trunk/lib/Support/JSONParser.cpp

Modified: llvm/trunk/include/llvm/Support/JSONParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/JSONParser.h?rev=146973&r1=146972&r2=146973&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/JSONParser.h (original)
+++ llvm/trunk/include/llvm/Support/JSONParser.h Tue Dec 20 05:04:23 2011
@@ -128,7 +128,16 @@
 
   /// \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);

Modified: llvm/trunk/lib/Support/JSONParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/JSONParser.cpp?rev=146973&r1=146972&r2=146973&view=diff
==============================================================================
--- llvm/trunk/lib/Support/JSONParser.cpp (original)
+++ llvm/trunk/lib/Support/JSONParser.cpp Tue Dec 20 05:04:23 2011
@@ -43,18 +43,6 @@
   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));





More information about the llvm-commits mailing list