Change operator<< for raw_ostream and NamedDecl to take a reference instead of a pointer.

Passing a pointer was a bad idea as it collides with the overload for void*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141971 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp
index 6f94aaa..54bb282 100644
--- a/lib/Frontend/ASTConsumers.cpp
+++ b/lib/Frontend/ASTConsumers.cpp
@@ -118,7 +118,7 @@
   case Decl::Namespace: {
     Out << "[namespace] ";
     const NamespaceDecl* ND = cast<NamespaceDecl>(DC);
-    Out << ND;
+    Out << *ND;
     break;
   }
   case Decl::Enum: {
@@ -127,7 +127,7 @@
       Out << "[enum] ";
     else
       Out << "<enum> ";
-    Out << ED;
+    Out << *ED;
     break;
   }
   case Decl::Record: {
@@ -136,7 +136,7 @@
       Out << "[struct] ";
     else
       Out << "<struct> ";
-    Out << RD;
+    Out << *RD;
     break;
   }
   case Decl::CXXRecord: {
@@ -145,7 +145,7 @@
       Out << "[class] ";
     else
       Out << "<class> ";
-    Out << RD << ' ' << DC;
+    Out << *RD << ' ' << DC;
     break;
   }
   case Decl::ObjCMethod:
@@ -178,7 +178,7 @@
       Out << "[function] ";
     else
       Out << "<function> ";
-    Out << FD;
+    Out << *FD;
     // Print the parameters.
     Out << "(";
     bool PrintComma = false;
@@ -188,7 +188,7 @@
         Out << ", ";
       else
         PrintComma = true;
-      Out << *I;
+      Out << **I;
     }
     Out << ")";
     break;
@@ -201,7 +201,7 @@
       Out << "(c++ method) ";
     else
       Out << "<c++ method> ";
-    Out << D;
+    Out << *D;
     // Print the parameters.
     Out << "(";
     bool PrintComma = false;
@@ -211,7 +211,7 @@
         Out << ", ";
       else
         PrintComma = true;
-      Out << *I;
+      Out << **I;
     }
     Out << ")";
 
@@ -231,7 +231,7 @@
       Out << "(c++ ctor) ";
     else
       Out << "<c++ ctor> ";
-    Out << D;
+    Out << *D;
     // Print the parameters.
     Out << "(";
     bool PrintComma = false;
@@ -241,7 +241,7 @@
         Out << ", ";
       else
         PrintComma = true;
-      Out << *I;
+      Out << **I;
     }
     Out << ")";
 
@@ -260,7 +260,7 @@
       Out << "(c++ dtor) ";
     else
       Out << "<c++ dtor> ";
-    Out << D;
+    Out << *D;
     // Check the semantic DC.
     const DeclContext* SemaDC = D->getDeclContext();
     const DeclContext* LexicalDC = D->getLexicalDeclContext();
@@ -276,7 +276,7 @@
       Out << "(c++ conversion) ";
     else
       Out << "<c++ conversion> ";
-    Out << D;
+    Out << *D;
     // Check the semantic DC.
     const DeclContext* SemaDC = D->getDeclContext();
     const DeclContext* LexicalDC = D->getLexicalDeclContext();
@@ -323,53 +323,53 @@
     }
     case Decl::IndirectField: {
       IndirectFieldDecl* IFD = cast<IndirectFieldDecl>(*I);
-      Out << "<IndirectField> " << IFD << '\n';
+      Out << "<IndirectField> " << *IFD << '\n';
       break;
     }
     case Decl::Label: {
       LabelDecl *LD = cast<LabelDecl>(*I);
-      Out << "<Label> " << LD << '\n';
+      Out << "<Label> " << *LD << '\n';
       break;
     }
     case Decl::Field: {
       FieldDecl *FD = cast<FieldDecl>(*I);
-      Out << "<field> " << FD << '\n';
+      Out << "<field> " << *FD << '\n';
       break;
     }
     case Decl::Typedef:
     case Decl::TypeAlias: {
       TypedefNameDecl* TD = cast<TypedefNameDecl>(*I);
-      Out << "<typedef> " << TD << '\n';
+      Out << "<typedef> " << *TD << '\n';
       break;
     }
     case Decl::EnumConstant: {
       EnumConstantDecl* ECD = cast<EnumConstantDecl>(*I);
-      Out << "<enum constant> " << ECD << '\n';
+      Out << "<enum constant> " << *ECD << '\n';
       break;
     }
     case Decl::Var: {
       VarDecl* VD = cast<VarDecl>(*I);
-      Out << "<var> " << VD << '\n';
+      Out << "<var> " << *VD << '\n';
       break;
     }
     case Decl::ImplicitParam: {
       ImplicitParamDecl* IPD = cast<ImplicitParamDecl>(*I);
-      Out << "<implicit parameter> " << IPD << '\n';
+      Out << "<implicit parameter> " << *IPD << '\n';
       break;
     }
     case Decl::ParmVar: {
       ParmVarDecl* PVD = cast<ParmVarDecl>(*I);
-      Out << "<parameter> " << PVD << '\n';
+      Out << "<parameter> " << *PVD << '\n';
       break;
     }
     case Decl::ObjCProperty: {
       ObjCPropertyDecl* OPD = cast<ObjCPropertyDecl>(*I);
-      Out << "<objc property> " << OPD << '\n';
+      Out << "<objc property> " << *OPD << '\n';
       break;
     }
     case Decl::FunctionTemplate: {
       FunctionTemplateDecl* FTD = cast<FunctionTemplateDecl>(*I);
-      Out << "<function template> " << FTD << '\n';
+      Out << "<function template> " << *FTD << '\n';
       break;
     }
     case Decl::FileScopeAsm: {
@@ -382,12 +382,12 @@
     }
     case Decl::NamespaceAlias: {
       NamespaceAliasDecl* NAD = cast<NamespaceAliasDecl>(*I);
-      Out << "<namespace alias> " << NAD << '\n';
+      Out << "<namespace alias> " << *NAD << '\n';
       break;
     }
     case Decl::ClassTemplate: {
       ClassTemplateDecl *CTD = cast<ClassTemplateDecl>(*I);
-      Out << "<class template> " << CTD << '\n';
+      Out << "<class template> " << *CTD << '\n';
       break;
     }
     default: