Add a newline to the end of this file.
[oota-llvm.git] / lib / Analysis / IPA / FindUsedTypes.cpp
index 725cec4c01826d9ea26e93cc868d2004e8255497..a954414b43952e9a177f43daa2459edaf9ff7b1d 100644 (file)
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
-#include "llvm/Assembly/CachedWriter.h"
+#include "llvm/Assembly/Writer.h"
 #include "llvm/Support/InstIterator.h"
 using namespace llvm;
 
-static RegisterAnalysis<FindUsedTypes>
+char FindUsedTypes::ID = 0;
+static RegisterPass<FindUsedTypes>
 X("printusedtypes", "Find Used Types");
 
 // IncorporateType - Incorporate one type and all of its subtypes into the
@@ -91,15 +92,9 @@ bool FindUsedTypes::runOnModule(Module &m) {
 //
 void FindUsedTypes::print(std::ostream &o, const Module *M) const {
   o << "Types in use by this module:\n";
-  if (M) {
-    CachedWriter CW(M, o);
-    for (std::set<const Type *>::const_iterator I = UsedTypes.begin(),
-           E = UsedTypes.end(); I != E; ++I)
-      CW << "  " << **I << "\n";
-  } else
-    for (std::set<const Type *>::const_iterator I = UsedTypes.begin(),
-           E = UsedTypes.end(); I != E; ++I)
-      o << "  " << **I << "\n";
+  for (std::set<const Type *>::const_iterator I = UsedTypes.begin(),
+       E = UsedTypes.end(); I != E; ++I)
+    WriteTypeSymbolic(o << "  ", *I, M) << "\n";
 }
 
 // Ensure that this file gets linked in when FindUsedTypes.h is used.