Don't send random junk to CachedWriter's. Also remove a cast that could be
authorChris Lattner <sabre@nondot.org>
Fri, 4 Jun 2004 20:25:55 +0000 (20:25 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 4 Jun 2004 20:25:55 +0000 (20:25 +0000)
problematic when Type does not derive from Value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14022 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/IPA/FindUnsafePointerTypes.cpp

index 98cbe7812b1493e482ba2c38c6a682e704441c72..25fcc8dfdf189c25c70e87bd17966877dc0c1a96 100644 (file)
@@ -71,8 +71,10 @@ bool FindUnsafePointerTypes::run(Module &Mod) {
 
           if (PrintFailures) {
             CachedWriter CW(F->getParent(), std::cerr);
-            CW << "FindUnsafePointerTypes: Type '" << ITy
-               << "' marked unsafe in '" << F->getName() << "' by:\n" << *I;
+            std::cerr << "FindUnsafePointerTypes: Type '";
+            CW << ITy;
+            std::cerr << "' marked unsafe in '" << F->getName() << "' by:\n";
+            CW << *I;
           }
         }
     }
@@ -93,13 +95,13 @@ void FindUnsafePointerTypes::print(std::ostream &o, const Module *M) const {
 
   CachedWriter CW(M, o);
 
-  CW << "SafePointerAccess Analysis: Found these unsafe types:\n";
+  o << "SafePointerAccess Analysis: Found these unsafe types:\n";
   unsigned Counter = 1;
   for (std::set<PointerType*>::const_iterator I = getUnsafeTypes().begin(), 
          E = getUnsafeTypes().end(); I != E; ++I, ++Counter) {
     
     o << " #" << Counter << ". ";
-    CW << (Value*)*I << "\n";
+    CW << (Type*)*I << "\n";
   }
 }