diff options
author | Dan Gohman <gohman@apple.com> | 2009-11-12 01:59:26 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-11-12 01:59:26 +0000 |
commit | 72b2990a7495b9df89e151eb711c1e7abdd5f2e5 (patch) | |
tree | 205be8e83fb1ed12ad5d586bd4b618df8c5176bf /lib/CodeGen/BranchFolding.cpp | |
parent | a5810add9c94fd2faa037162d23b91348b55ea08 (diff) |
Make the BranchFolderPass class local to BranchFolding.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86928 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r-- | lib/CodeGen/BranchFolding.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index f7d57b1c74..dd17d881c5 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/lib/CodeGen/BranchFolding.cpp @@ -56,6 +56,20 @@ TailMergeSize("tail-merge-size", cl::desc("Min number of instructions to consider tail merging"), cl::init(3), cl::Hidden); +namespace { + /// BranchFolderPass - Wrap branch folder in a machine function pass. + class BranchFolderPass : public MachineFunctionPass, + public BranchFolder { + public: + static char ID; + explicit BranchFolderPass(bool defaultEnableTailMerge) + : MachineFunctionPass(&ID), BranchFolder(defaultEnableTailMerge) {} + + virtual bool runOnMachineFunction(MachineFunction &MF); + virtual const char *getPassName() const { return "Control Flow Optimizer"; } + }; +} + char BranchFolderPass::ID = 0; FunctionPass *llvm::createBranchFoldingPass(bool DefaultEnableTailMerge) { |