Switch StmtVisitor from using dynamic to static dispatch.  This makes it 
significantly faster and actually reduces the amount of code in the system.
This also allows for future visitor changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41211 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/StmtDumper.cpp b/AST/StmtDumper.cpp
index 7b0d794..87d4e33 100644
--- a/AST/StmtDumper.cpp
+++ b/AST/StmtDumper.cpp
@@ -25,7 +25,7 @@
 //===----------------------------------------------------------------------===//
 
 namespace  {
-  class VISIBILITY_HIDDEN StmtDumper : public StmtVisitor {
+  class VISIBILITY_HIDDEN StmtDumper : public StmtVisitor<StmtDumper> {
     FILE *F;
     unsigned IndentLevel;
     
@@ -43,7 +43,7 @@
       
       ++IndentLevel;
       if (S) {
-        S->visit(*this);
+        Visit(S);
       } else {
         Indent();
         fprintf(F, "<<<NULL>>>\n");
@@ -78,9 +78,9 @@
       DumpType(Node->getType());
     }
     
-    virtual void VisitStmt(Stmt *Node);
+    void VisitStmt(Stmt *Node);
 #define STMT(N, CLASS, PARENT) \
-    virtual void Visit##CLASS(CLASS *Node);
+    void Visit##CLASS(CLASS *Node);
 #include "clang/AST/StmtNodes.def"
   };
 }
@@ -502,13 +502,13 @@
 /// This is useful in a debugger.
 void Stmt::dump() const {
   StmtDumper P(stderr, 4);
-  const_cast<Stmt*>(this)->visit(P);
+  P.Visit(const_cast<Stmt*>(this));
   fprintf(stderr, "\n");
 }
 
 /// dumpAll - This does a dump of the specified AST fragment and all subtrees.
 void Stmt::dumpAll() const {
   StmtDumper P(stderr, ~0U);
-  const_cast<Stmt*>(this)->visit(P);
+  P.Visit(const_cast<Stmt*>(this));
   fprintf(stderr, "\n");
 }