From c8e665431be235941eedfd0e6434fa5386d632d1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 27 Apr 2002 06:56:12 +0000 Subject: * Rename MethodPass class to FunctionPass - Rename runOnMethod to runOnFunction * Transform getAnalysisUsageInfo into getAnalysisUsage - Method is now const - It now takes one AnalysisUsage object to fill in instead of 3 vectors to fill in - Pass's now specify which other passes they _preserve_ not which ones they modify (be conservative!) - A pass can specify that it preserves all analyses (because it never modifies the underlying program) * s/Method/Function/g in other random places as well llvm-svn: 2333 --- llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'llvm/lib/CodeGen/RegAlloc') diff --git a/llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp b/llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp index 0b680ab9e49..c22ede96b33 100644 --- a/llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp +++ b/llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp @@ -40,14 +40,14 @@ cl::Enum DEBUG_RA("dregalloc", cl::NoFlags, // RegisterAllocation pass front end... //---------------------------------------------------------------------------- namespace { - class RegisterAllocator : public MethodPass { + class RegisterAllocator : public FunctionPass { TargetMachine &Target; public: inline RegisterAllocator(TargetMachine &T) : Target(T) {} - bool runOnMethod(Function *F) { + bool runOnFunction(Function *F) { if (DEBUG_RA) - cerr << "\n******************** Method "<< F->getName() + cerr << "\n******************** Function "<< F->getName() << " ********************\n"; PhyRegAlloc PRA(F, Target, &getAnalysis(), @@ -58,17 +58,14 @@ namespace { return false; } - virtual void getAnalysisUsageInfo(Pass::AnalysisSet &Requires, - Pass::AnalysisSet &Destroyed, - Pass::AnalysisSet &Provided) { - Requires.push_back(cfg::LoopInfo::ID); - Requires.push_back(MethodLiveVarInfo::ID); - Destroyed.push_back(MethodLiveVarInfo::ID); + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(cfg::LoopInfo::ID); + AU.addRequired(MethodLiveVarInfo::ID); } }; } -MethodPass *getRegisterAllocator(TargetMachine &T) { +Pass *getRegisterAllocator(TargetMachine &T) { return new RegisterAllocator(T); } -- cgit v1.2.3