Remove the ASTContext parameter from the printing related methods of Decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74503 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp
index 2b06e93..d326830 100644
--- a/lib/AST/DeclPrinter.cpp
+++ b/lib/AST/DeclPrinter.cpp
@@ -74,14 +74,13 @@
   };
 }
 
-void Decl::print(llvm::raw_ostream &Out, ASTContext &Context, 
-                 unsigned Indentation) {
-  print(Out, Context, Context.PrintingPolicy, Indentation);
+void Decl::print(llvm::raw_ostream &Out, unsigned Indentation) {
+  print(Out, getASTContext().PrintingPolicy, Indentation);
 }
 
-void Decl::print(llvm::raw_ostream &Out, ASTContext &Context, 
-                 const PrintingPolicy &Policy, unsigned Indentation) {
-  DeclPrinter Printer(Out, Context, Policy, Indentation);
+void Decl::print(llvm::raw_ostream &Out, const PrintingPolicy &Policy,
+                 unsigned Indentation) {
+  DeclPrinter Printer(Out, getASTContext(), Policy, Indentation);
   Printer.Visit(this);
 }
 
@@ -112,11 +111,10 @@
 }
 
 void Decl::printGroup(Decl** Begin, unsigned NumDecls,
-                      llvm::raw_ostream &Out, ASTContext &Context, 
-                      const PrintingPolicy &Policy,
+                      llvm::raw_ostream &Out, const PrintingPolicy &Policy,
                       unsigned Indentation) {
   if (NumDecls == 1) {
-    (*Begin)->print(Out, Context, Policy, Indentation);
+    (*Begin)->print(Out, Policy, Indentation);
     return;
   }
 
@@ -127,7 +125,7 @@
 
   PrintingPolicy SubPolicy(Policy);
   if (TD && TD->isDefinition()) {
-    TD->print(Out, Context, Policy, Indentation);
+    TD->print(Out, Policy, Indentation);
     Out << " ";
     SubPolicy.SuppressTag = true;
   }
@@ -142,12 +140,12 @@
       SubPolicy.SuppressSpecifiers = true;
     }
 
-    (*Begin)->print(Out, Context, SubPolicy, Indentation);
+    (*Begin)->print(Out, SubPolicy, Indentation);
   }
 }
 
-void Decl::dump(ASTContext &Context) {
-  print(llvm::errs(), Context);
+void Decl::dump() {
+  print(llvm::errs());
 }
 
 llvm::raw_ostream& DeclPrinter::Indent() {
@@ -158,8 +156,7 @@
 
 void DeclPrinter::ProcessDeclGroup(llvm::SmallVectorImpl<Decl*>& Decls) {
   this->Indent();
-  Decl::printGroup(Decls.data(), Decls.size(), Out, Context,
-                   Policy, Indentation);
+  Decl::printGroup(Decls.data(), Decls.size(), Out, Policy, Indentation);
   Out << ";\n";
   Decls.clear();
 
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp
index 189400b..825a873 100644
--- a/lib/AST/StmtPrinter.cpp
+++ b/lib/AST/StmtPrinter.cpp
@@ -114,7 +114,7 @@
 }
 
 void StmtPrinter::PrintRawDecl(Decl *D) {
-  D->print(OS, Context, Policy, IndentLevel);
+  D->print(OS, Policy, IndentLevel);
 }
 
 void StmtPrinter::PrintRawDeclStmt(DeclStmt *S) {
@@ -123,8 +123,7 @@
   for ( ; Begin != End; ++Begin) 
     Decls.push_back(*Begin);
 
-  Decl::printGroup(Decls.data(), Decls.size(), OS, Context, Policy,
-                   IndentLevel);
+  Decl::printGroup(Decls.data(), Decls.size(), OS, Policy, IndentLevel);
 }
 
 void StmtPrinter::VisitNullStmt(NullStmt *Node) {