[llvm-commits] [llvm] r86928 - in /llvm/trunk/lib/CodeGen: BranchFolding.cpp BranchFolding.h
Dan Gohman
gohman at apple.com
Wed Nov 11 17:59:26 PST 2009
Author: djg
Date: Wed Nov 11 19:59:26 2009
New Revision: 86928
URL: http://llvm.org/viewvc/llvm-project?rev=86928&view=rev
Log:
Make the BranchFolderPass class local to BranchFolding.cpp.
Modified:
llvm/trunk/lib/CodeGen/BranchFolding.cpp
llvm/trunk/lib/CodeGen/BranchFolding.h
Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=86928&r1=86927&r2=86928&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original)
+++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Wed Nov 11 19:59:26 2009
@@ -56,6 +56,20 @@
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) {
Modified: llvm/trunk/lib/CodeGen/BranchFolding.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.h?rev=86928&r1=86927&r2=86928&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/BranchFolding.h (original)
+++ llvm/trunk/lib/CodeGen/BranchFolding.h Wed Nov 11 19:59:26 2009
@@ -11,7 +11,6 @@
#define LLVM_CODEGEN_BRANCHFOLDING_HPP
#include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
#include <vector>
namespace llvm {
@@ -20,6 +19,7 @@
class RegScavenger;
class TargetInstrInfo;
class TargetRegisterInfo;
+ template<typename T> class SmallVectorImpl;
class BranchFolder {
public:
@@ -119,19 +119,6 @@
MachineBasicBlock *TBB, MachineBasicBlock *FBB,
const SmallVectorImpl<MachineOperand> &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 */
More information about the llvm-commits
mailing list