Finish converting SwitchStmt AST to source ranges.
Move DumpSourceRange() to DumpStmt().

Now -parse-ast-dump will display source range info for all stmts/exprs.

One day we should implement the source range protocol for Decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41670 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/StmtDumper.cpp b/AST/StmtDumper.cpp
index 73aef84..ea43ad7 100644
--- a/AST/StmtDumper.cpp
+++ b/AST/StmtDumper.cpp
@@ -78,7 +78,7 @@
         fprintf(F, "  ");
     }
     
-    void DumpType(QualType T) const {
+    void DumpType(QualType T) {
       fprintf(F, "'%s'", T.getAsString().c_str());
 
       // If the type is directly a typedef, strip off typedefness to give at
@@ -86,22 +86,18 @@
       if (TypedefType *TDT = dyn_cast<TypedefType>(T))
         fprintf(F, ":'%s'", TDT->LookThroughTypedefs().getAsString().c_str());
     }
-    
-    void DumpStmt(const Stmt *Node) const {
+    void DumpStmt(const Stmt *Node) {
       Indent();
       fprintf(F, "(%s %p", Node->getStmtClassName(), (void*)Node);
+      DumpSourceRange(Node);
     }
-    
-    void DumpExpr(Expr *Node) {
+    void DumpExpr(const Expr *Node) {
       DumpStmt(Node);
       fprintf(F, " ");
       DumpType(Node->getType());
-      DumpSourceRange(Node);
     }
-    
-    void DumpSourceRange(Expr *Node);
+    void DumpSourceRange(const Stmt *Node);
     void DumpLocation(SourceLocation Loc);
-
     
     // Stmts.
     void VisitStmt(Stmt *Node);
@@ -158,7 +154,7 @@
   }
 }
 
-void StmtDumper::DumpSourceRange(Expr *Node) {
+void StmtDumper::DumpSourceRange(const Stmt *Node) {
   // Can't translate locations if a SourceManager isn't available.
   if (SM == 0) return;