diff options
author | Andrew Trick <atrick@apple.com> | 2012-02-08 21:23:13 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-02-08 21:23:13 +0000 |
commit | 1fa5bcbe2ae447344d6cbba3f19daa9a5bed5de8 (patch) | |
tree | aa75a14f62673ecf5b1e2c4e17c1289336597211 /llvm/lib/CodeGen/CodePlacementOpt.cpp | |
parent | c40815de62286ee6e324cb0a342db85e0a5a3c23 (diff) | |
download | bcm5719-llvm-1fa5bcbe2ae447344d6cbba3f19daa9a5bed5de8.tar.gz bcm5719-llvm-1fa5bcbe2ae447344d6cbba3f19daa9a5bed5de8.zip |
Codegen pass definition cleanup. No functionality.
Moving toward a uniform style of pass definition to allow easier target configuration.
Globally declare Pass ID.
Globally declare pass initializer.
Use INITIALIZE_PASS consistently.
Add a call to the initializer from CodeGen.cpp.
Remove redundant "createPass" functions and "getPassName" methods.
While cleaning up declarations, cleaned up comments (sorry for large diff).
llvm-svn: 150100
Diffstat (limited to 'llvm/lib/CodeGen/CodePlacementOpt.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodePlacementOpt.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/CodePlacementOpt.cpp b/llvm/lib/CodeGen/CodePlacementOpt.cpp index 270c337ef67..c13c05e26a2 100644 --- a/llvm/lib/CodeGen/CodePlacementOpt.cpp +++ b/llvm/lib/CodeGen/CodePlacementOpt.cpp @@ -39,9 +39,6 @@ namespace { CodePlacementOpt() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); - virtual const char *getPassName() const { - return "Code Placement Optimizer"; - } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<MachineLoopInfo>(); @@ -69,9 +66,9 @@ namespace { char CodePlacementOpt::ID = 0; } // end anonymous namespace -FunctionPass *llvm::createCodePlacementOptPass() { - return new CodePlacementOpt(); -} +char &llvm::CodePlacementOptID = CodePlacementOpt::ID; +INITIALIZE_PASS(CodePlacementOpt, "code-placement", + "Code Placement Optimizer", false, false) /// HasFallthrough - Test whether the given branch has a fallthrough, either as /// a plain fallthrough or as a fallthrough case of a conditional branch. |