X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FVMCore%2FPass.cpp;h=9afc540633219bb8ac6ff611f1682e7fa7a155ed;hb=b6777eae58392cb5e19282622996e81c72b72a3e;hp=fb23fbfbe15e5f52590074541ee216eb855f6636;hpb=90c579de5a383cee278acc3f7e7b9d0a656e6a35;p=oota-llvm.git diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index fb23fbfbe15..9afc5406332 100644 --- a/lib/VMCore/Pass.cpp +++ b/lib/VMCore/Pass.cpp @@ -14,22 +14,11 @@ //===----------------------------------------------------------------------===// #include "llvm/Pass.h" -#include "llvm/PassManager.h" #include "llvm/PassRegistry.h" -#include "llvm/Module.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/StringMap.h" #include "llvm/Assembly/PrintModulePass.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/PassNameParser.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/System/Atomic.h" -#include "llvm/System/Mutex.h" -#include "llvm/System/Threading.h" -#include -#include -#include using namespace llvm; //===----------------------------------------------------------------------===// @@ -146,30 +135,6 @@ Pass *FunctionPass::createPrinterPass(raw_ostream &O, return createPrintFunctionPass(Banner, &O); } -// run - On a module, we run this pass by initializing, runOnFunction'ing once -// for every function in the module, then by finalizing. -// -bool FunctionPass::runOnModule(Module &M) { - bool Changed = doInitialization(M); - - for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isDeclaration()) // Passes are not run on external functions! - Changed |= runOnFunction(*I); - - return Changed | doFinalization(M); -} - -// run - On a function, we simply initialize, run the function, then finalize. -// -bool FunctionPass::run(Function &F) { - // Passes are not run on external functions! - if (F.isDeclaration()) return false; - - bool Changed = doInitialization(*F.getParent()); - Changed |= runOnFunction(F); - return Changed | doFinalization(*F.getParent()); -} - bool FunctionPass::doInitialization(Module &) { // By default, don't do anything. return false; @@ -195,16 +160,6 @@ Pass *BasicBlockPass::createPrinterPass(raw_ostream &O, return 0; } -// To run this pass on a function, we simply call runOnBasicBlock once for each -// function. -// -bool BasicBlockPass::runOnFunction(Function &F) { - bool Changed = doInitialization(F); - for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) - Changed |= runOnBasicBlock(*I); - return Changed | doFinalization(F); -} - bool BasicBlockPass::doInitialization(Module &) { // By default, don't do anything. return false; @@ -258,7 +213,6 @@ RegisterAGBase::RegisterAGBase(const char *Name, const void *InterfaceID, *this, isDefault); } - //===----------------------------------------------------------------------===// // PassRegistrationListener implementation //