Add raw_ostream operators to NamedDecl for convenience. Switch over all users of getNameAsString on a stream.

The next step is to print the name directly into the stream, avoiding a temporary std::string copy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101632 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index c0366bf..2b6e581 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -896,7 +896,7 @@
   assert (CD && "Missing container decl in GetNameForMethod");
   OS << (MD->isInstanceMethod() ? '-' : '+') << '[' << CD->getName();
   if (const ObjCCategoryImplDecl *CID = dyn_cast<ObjCCategoryImplDecl>(CD))
-    OS << '(' << CID->getNameAsString() << ')';
+    OS << '(' << CID << ')';
   OS << ' ' << MD->getSelector().getAsString() << ']';
 
   Out << OS.str().size() << OS.str();