Expand the pass to unify all of the unwind blocks as well
[oota-llvm.git] / include / llvm / Analysis / FindUnsafePointerTypes.h
index cd34676727e89927a366e54d75020dd8ae8eead8..e4e33df6b089ebf2f7b0dc704e86464080d0f4b8 100644 (file)
@@ -1,4 +1,4 @@
-//===- llvm/Analysis/SafePointerAccess.h - Check pointer safety ---*- C++ -*-=//
+//===- llvm/Analysis/FindUnsafePointerTypes.h - Unsafe pointers ---*- C++ -*-=//
 //
 // This file defines a pass that can be used to determine, interprocedurally, 
 // which pointer types are accessed unsafely in a program.  If there is an
 //
 // Additionally, this analysis exports a hidden command line argument that (when
 // enabled) prints out the reasons a type was determined to be unsafe.  Just add
-// -unsafeptrinst to the command line of the tool you want to get it.
+// -printunsafeptrinst to the command line of the tool you want to get it.
 // 
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_ANALYSIS_SAFEPOINTERACCESS_H
-#define LLVM_ANALYSIS_SAFEPOINTERACCESS_H
+#ifndef LLVM_ANALYSIS_UNSAFEPOINTERTYPES_H
+#define LLVM_ANALYSIS_UNSAFEPOINTERTYPES_H
 
 #include "llvm/Pass.h"
 #include <set>
@@ -26,10 +26,6 @@ struct FindUnsafePointerTypes : public Pass {
   // UnsafeTypes - Set of types that are not safe to transform.
   std::set<PointerType*> UnsafeTypes;
 public:
-  static AnalysisID ID;    // We are an analysis, we must have an ID
-
-  FindUnsafePointerTypes(AnalysisID id) { assert(ID == id); }
-
   // Accessor for underlying type set...
   inline const std::set<PointerType*> &getUnsafeTypes() const {
     return UnsafeTypes;
@@ -39,18 +35,17 @@ public:
   // values of various types.  If they are deemed to be 'unsafe' note that the
   // type is not safe to transform.
   //
-  virtual bool run(Module *M);
+  virtual bool run(Module &M);
 
-  // printResults - Loop over the results of the analysis, printing out unsafe
-  // types.
+  // print - Loop over the results of the analysis, printing out unsafe types.
   //
-  void printResults(const Module *Mod, std::ostream &o) const;
+  void print(std::ostream &o, const Module *Mod) const;
 
-  // getAnalysisUsageInfo - This function needs FindUsedTypes to do its job...
+  // getAnalysisUsage - Of course, we provide ourself...
   //
-  virtual void getAnalysisUsageInfo(Pass::AnalysisSet &Required,
-                                    Pass::AnalysisSet &Destroyed,
-                                    Pass::AnalysisSet &Provided);
+  virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+    AU.setPreservesAll();
+  }
 };
 
 #endif