summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-11-12 01:59:26 +0000
committerDan Gohman <gohman@apple.com>2009-11-12 01:59:26 +0000
commita9b40a6eb411de5e5a7ba04ed46f45e02880f9b1 (patch)
tree4c6688515338a5f11bba0a30b6167d7487945ec0 /llvm/lib/CodeGen/BranchFolding.cpp
parente2a63f27988d792621223d486a063c0f15c77471 (diff)
downloadbcm5719-llvm-a9b40a6eb411de5e5a7ba04ed46f45e02880f9b1.tar.gz
bcm5719-llvm-a9b40a6eb411de5e5a7ba04ed46f45e02880f9b1.zip
Make the BranchFolderPass class local to BranchFolding.cpp.
llvm-svn: 86928
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index f7d57b1c74f..dd17d881c51 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/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) {
OpenPOWER on IntegriCloud