Avoid creating a redundant zero APInt.
[oota-llvm.git] / include / llvm / Analysis / FindUsedTypes.h
index 92f3677502d78562636c2cb306fe302be71ea19b..d3e62e269654784606fce9752e91acbb324fcd19 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -24,6 +24,9 @@ class Type;
 class FindUsedTypes : public ModulePass {
   std::set<const Type *> UsedTypes;
 public:
+  static char ID; // Pass identification, replacement for typeid
+  FindUsedTypes() : ModulePass((intptr_t)&ID) {}
+
   /// getTypes - After the pass has been run, return the set containing all of
   /// the types used in the module.
   ///
@@ -34,6 +37,7 @@ public:
   /// symbol table from the module.
   ///
   void print(std::ostream &o, const Module *M) const;
+  void print(std::ostream *o, const Module *M) const { if (o) print(*o, M); }
 
 private:
   /// IncorporateType - Incorporate one type and all of its subtypes into the
@@ -53,15 +57,8 @@ public:
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
   }
-
-  // stub - dummy function, just ignore it
-  static void stub();
 };
 
-// Make sure that any clients of this file link in PostDominators.cpp
-static IncludeFile
-FIND_USED_TYPES_INCLUDE_FILE((void*)(&FindUsedTypes::stub));
-
 } // End llvm namespace
 
 #endif