From 72b2990a7495b9df89e151eb711c1e7abdd5f2e5 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 12 Nov 2009 01:59:26 +0000 Subject: [PATCH] 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 --- lib/CodeGen/BranchFolding.cpp | 14 ++++++++++++++ lib/CodeGen/BranchFolding.h | 15 +-------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index f7d57b1c74f..dd17d881c51 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) { diff --git a/lib/CodeGen/BranchFolding.h b/lib/CodeGen/BranchFolding.h index 864358c9c8a..648ec92b1eb 100644 --- a/lib/CodeGen/BranchFolding.h +++ b/lib/CodeGen/BranchFolding.h @@ -11,7 +11,6 @@ #define LLVM_CODEGEN_BRANCHFOLDING_HPP #include "llvm/CodeGen/MachineBasicBlock.h" -#include "llvm/CodeGen/MachineFunctionPass.h" #include namespace llvm { @@ -20,6 +19,7 @@ namespace llvm { class RegScavenger; class TargetInstrInfo; class TargetRegisterInfo; + template class SmallVectorImpl; class BranchFolder { public: @@ -119,19 +119,6 @@ namespace llvm { MachineBasicBlock *TBB, MachineBasicBlock *FBB, const SmallVectorImpl &Cond); }; - - - /// 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"; } - }; } #endif /* LLVM_CODEGEN_BRANCHFOLDING_HPP */ -- 2.11.0