We're not doing automake any more
[oota-llvm.git] / tools / opt / AnalysisWrappers.cpp
index 7a811ce7d733d2ed22e397514b9f73545ce700ee..46ede0a15342c21dbe08d71f55b80b31f32e9e24 100644 (file)
 
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
-#include "llvm/Analysis/InstForest.h"
 #include "llvm/Support/CallSite.h"
-
+#include <iostream>
 using namespace llvm;
 
-namespace {
-  struct InstForestHelper : public FunctionPass {
-    Function *F;
-    virtual bool runOnFunction(Function &Func) { F = &Func; return false; }
-
-    void print(std::ostream &OS) const {
-      std::cout << InstForest<char>(F);
-    }
-    
-    virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-      AU.setPreservesAll();
-    }
-  };
-
-  RegisterAnalysis<InstForestHelper> P1("instforest", "InstForest Printer");
-}
-
 namespace {
   /// ExternalFunctionsPassedConstants - This pass prints out call sites to
   /// external functions that are called with constant arguments.  This can be
   /// useful when looking for standard library functions we should constant fold
   /// or handle in alias analyses.
-  struct ExternalFunctionsPassedConstants : public Pass {
-    virtual bool run(Module &M) {
+  struct ExternalFunctionsPassedConstants : public ModulePass {
+    virtual bool runOnModule(Module &M) {
       for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
         if (I->isExternal()) {
           bool PrintedFn = false;
@@ -58,7 +40,7 @@ namespace {
               if (CS.getInstruction()) {
                 for (CallSite::arg_iterator AI = CS.arg_begin(),
                        E = CS.arg_end(); AI != E; ++AI)
-                  if (isa<Constant>(*AI) || isa<GlobalValue>(*AI)) {
+                  if (isa<Constant>(*AI)) {
                     if (!PrintedFn) {
                       std::cerr << "Function '" << I->getName() << "':\n";
                       PrintedFn = true;