llvm.org GIT mirror llvm / ae73dc1
Tidy up several unbeseeming casts from pointer to intptr_t. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 11 years ago
137 changed file(s) with 171 addition(s) and 170 deletion(s). Raw diff Collapse all Expand all
719719 static char ID; // Pass ID, replacement for typeid
720720 DominatorTreeBase* DT;
721721
722 DominatorTree() : FunctionPass(intptr_t(&ID)) {
722 DominatorTree() : FunctionPass(&ID) {
723723 DT = new DominatorTreeBase(false);
724724 }
725725
910910 const bool IsPostDominators;
911911
912912 public:
913 DominanceFrontierBase(intptr_t ID, bool isPostDom)
913 DominanceFrontierBase(void *ID, bool isPostDom)
914914 : FunctionPass(ID), IsPostDominators(isPostDom) {}
915915
916916 /// getRoots - Return the root blocks of the current CFG. This may include
10291029 public:
10301030 static char ID; // Pass ID, replacement for typeid
10311031 DominanceFrontier() :
1032 DominanceFrontierBase(intptr_t(&ID), false) {}
1032 DominanceFrontierBase(&ID, false) {}
10331033
10341034 BasicBlock *getRoot() const {
10351035 assert(Roots.size() == 1 && "Should always have entry node!");
2424 std::set UsedTypes;
2525 public:
2626 static char ID; // Pass identification, replacement for typeid
27 FindUsedTypes() : ModulePass((intptr_t)&ID) {}
27 FindUsedTypes() : ModulePass(&ID) {}
2828
2929 /// getTypes - After the pass has been run, return the set containing all of
3030 /// the types used in the module.
4747 public:
4848 static char ID; // Pass identification, replacement for typeid
4949
50 IntervalPartition() : FunctionPass((intptr_t)&ID), RootInterval(0) {}
50 IntervalPartition() : FunctionPass(&ID), RootInterval(0) {}
5151
5252 // run - Calculate the interval partition for this function
5353 virtual bool runOnFunction(Function &F);
2929
3030 public:
3131 explicit LoopPass(intptr_t pid) : Pass(pid) {}
32 explicit LoopPass(void *pid) : Pass(pid) {}
3233
3334 // runOnLoop - This method should be implemented by the subclass to perform
3435 // whatever action is necessary for the specified Loop.
6565 static Instruction* const Dirty;
6666
6767 static char ID; // Class identification, replacement for typeinfo
68 MemoryDependenceAnalysis() : FunctionPass((intptr_t)&ID) {}
68 MemoryDependenceAnalysis() : FunctionPass(&ID) {}
6969
7070 /// Pass Implementation stuff. This doesn't do any analysis.
7171 ///
2424 static char ID; // Pass identification, replacement for typeid
2525 DominatorTreeBase* DT;
2626
27 PostDominatorTree() : FunctionPass((intptr_t)&ID) {
27 PostDominatorTree() : FunctionPass(&ID) {
2828 DT = new DominatorTreeBase(true);
2929 }
3030
6969 struct PostDominanceFrontier : public DominanceFrontierBase {
7070 static char ID;
7171 PostDominanceFrontier()
72 : DominanceFrontierBase((intptr_t) &ID, true) {}
72 : DominanceFrontierBase(&ID, true) {}
7373
7474 virtual bool runOnFunction(Function &) {
7575 Frontiers.clear();
190190 void *Impl; // ScalarEvolution uses the pimpl pattern
191191 public:
192192 static char ID; // Pass identification, replacement for typeid
193 ScalarEvolution() : FunctionPass((intptr_t)&ID), Impl(0) {}
193 ScalarEvolution() : FunctionPass(&ID), Impl(0) {}
194194
195195 /// getSCEV - Return a SCEV expression handle for the full generality of the
196196 /// specified expression.
3131 struct CallGraphSCCPass : public Pass {
3232
3333 explicit CallGraphSCCPass(intptr_t pid) : Pass(pid) {}
34 explicit CallGraphSCCPass(void *pid) : Pass(pid) {}
3435
3536 /// doInitialization - This method is called before the SCC's of the program
3637 /// has been processed, allowing the pass to do initialization as necessary.
9393
9494 public:
9595 static char ID; // Pass identification, replacement for typeid
96 LiveIntervals() : MachineFunctionPass((intptr_t)&ID) {}
96 LiveIntervals() : MachineFunctionPass(&ID) {}
9797
9898 struct InstrSlots {
9999 enum {
3434
3535 public:
3636 static char ID; // Pass identification, replacement for typeid
37 LiveStacks() : MachineFunctionPass((intptr_t)&ID) {}
37 LiveStacks() : MachineFunctionPass(&ID) {}
3838
3939 typedef SS2IntervalMap::iterator iterator;
4040 typedef SS2IntervalMap::const_iterator const_iterator;
4242 class LiveVariables : public MachineFunctionPass {
4343 public:
4444 static char ID; // Pass identification, replacement for typeid
45 LiveVariables() : MachineFunctionPass((intptr_t)&ID) {}
45 LiveVariables() : MachineFunctionPass(&ID) {}
4646
4747 /// VarInfo - This represents the regions where a virtual register is live in
4848 /// the program. We represent this with three different pieces of
2626 struct MachineFunctionPass : public FunctionPass {
2727
2828 explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {}
29 explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {}
2930
3031 protected:
3132 /// runOnMachineFunction - This method must be overloaded to perform the
2525 /// perform the inlining operations that does not depend on the policy.
2626 ///
2727 struct Inliner : public CallGraphSCCPass {
28 explicit Inliner(const void *ID);
29 explicit Inliner(const void *ID, int Threshold);
28 explicit Inliner(void *ID);
29 explicit Inliner(void *ID, int Threshold);
3030
3131 /// getAnalysisUsage - For this class, we declare that we require and preserve
3232 /// the call graph. If the derived class implements this method, it should
2626 /// multiple profilers can be support simultaniously.
2727 struct RSProfilers : public ModulePass {
2828 static char ID; // Pass identification, replacement for typeinfo
29 RSProfilers() : ModulePass((intptr_t)&ID) {}
29 RSProfilers() : ModulePass(&ID) {}
3030
3131 /// isProfiling - This method returns true if the value passed it was
3232 /// inserted by the profiler.
2525 BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock;
2626 public:
2727 static char ID; // Pass identification, replacement for typeid
28 UnifyFunctionExitNodes() : FunctionPass((intptr_t)&ID),
28 UnifyFunctionExitNodes() : FunctionPass(&ID),
2929 ReturnBlock(0), UnwindBlock(0) {}
3030
3131 // We can preserve non-critical-edgeness when we unify function exit nodes
3434 Module *M;
3535 public:
3636 static char ID; // Class identification, replacement for typeinfo
37 AliasAnalysisCounter() : ModulePass((intptr_t) &ID) {
37 AliasAnalysisCounter() : ModulePass(&ID) {
3838 No = May = Must = 0;
3939 NoMR = JustRef = JustMod = MR = 0;
4040 }
5151
5252 public:
5353 static char ID; // Pass identification, replacement for typeid
54 AAEval() : FunctionPass((intptr_t)&ID) {}
54 AAEval() : FunctionPass(&ID) {}
5555
5656 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
5757 AU.addRequired();
4040
4141 public:
4242 static char ID; // Class identification, replacement for typeinfo
43 AliasDebugger() : ModulePass((intptr_t)&ID) {}
43 AliasDebugger() : ModulePass(&ID) {}
4444
4545 bool runOnModule(Module &M) {
4646 InitializeAliasAnalysis(this); // set up super class
563563 AliasSetTracker *Tracker;
564564 public:
565565 static char ID; // Pass identification, replacement for typeid
566 AliasSetPrinter() : FunctionPass((intptr_t)&ID) {}
566 AliasSetPrinter() : FunctionPass(&ID) {}
567567
568568 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
569569 AU.setPreservesAll();
207207 ///
208208 struct VISIBILITY_HIDDEN NoAA : public ImmutablePass, public AliasAnalysis {
209209 static char ID; // Class identification, replacement for typeinfo
210 NoAA() : ImmutablePass((intptr_t)&ID) {}
211 explicit NoAA(intptr_t PID) : ImmutablePass(PID) { }
210 NoAA() : ImmutablePass(&ID) {}
211 explicit NoAA(void *PID) : ImmutablePass(PID) { }
212212
213213 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
214214 AU.addRequired();
268268 /// derives from the NoAA class.
269269 struct VISIBILITY_HIDDEN BasicAliasAnalysis : public NoAA {
270270 static char ID; // Class identification, replacement for typeinfo
271 BasicAliasAnalysis() : NoAA((intptr_t)&ID) { }
271 BasicAliasAnalysis() : NoAA(&ID) {}
272272 AliasResult alias(const Value *V1, unsigned V1Size,
273273 const Value *V2, unsigned V2Size);
274274
9191 namespace {
9292 struct VISIBILITY_HIDDEN CFGViewer : public FunctionPass {
9393 static char ID; // Pass identifcation, replacement for typeid
94 CFGViewer() : FunctionPass((intptr_t)&ID) {}
94 CFGViewer() : FunctionPass(&ID) {}
9595
9696 virtual bool runOnFunction(Function &F) {
9797 F.viewCFG();
113113 namespace {
114114 struct VISIBILITY_HIDDEN CFGOnlyViewer : public FunctionPass {
115115 static char ID; // Pass identifcation, replacement for typeid
116 CFGOnlyViewer() : FunctionPass((intptr_t)&ID) {}
116 CFGOnlyViewer() : FunctionPass(&ID) {}
117117
118118 virtual bool runOnFunction(Function &F) {
119119 CFGOnly = true;
138138 namespace {
139139 struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass {
140140 static char ID; // Pass identification, replacement for typeid
141 CFGPrinter() : FunctionPass((intptr_t)&ID) {}
142 explicit CFGPrinter(intptr_t pid) : FunctionPass(pid) {}
141 CFGPrinter() : FunctionPass(&ID) {}
142 explicit CFGPrinter(void *pid) : FunctionPass(pid) {}
143143
144144 virtual bool runOnFunction(Function &F) {
145145 std::string Filename = "cfg." + F.getName() + ".dot";
169169 namespace {
170170 struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter {
171171 static char ID; // Pass identification, replacement for typeid
172 CFGOnlyPrinter() : CFGPrinter((intptr_t)&ID) {}
172 CFGOnlyPrinter() : CFGPrinter(&ID) {}
173173 virtual bool runOnFunction(Function &F) {
174174 bool OldCFGOnly = CFGOnly;
175175 CFGOnly = true;
430430
431431 public:
432432 static char ID;
433 Andersens() : ModulePass((intptr_t)&ID) {}
433 Andersens() : ModulePass(&ID) {}
434434
435435 bool runOnModule(Module &M) {
436436 InitializeAliasAnalysis(this);
4949
5050 public:
5151 static char ID; // Class identification, replacement for typeinfo
52 BasicCallGraph() : ModulePass((intptr_t)&ID), Root(0),
52 BasicCallGraph() : ModulePass(&ID), Root(0),
5353 ExternalCallingNode(0), CallsExternalNode(0) {}
5454
5555 // runOnModule - Compute the call graph for the specified module.
3333 public:
3434 static char ID;
3535 explicit CGPassManager(int Depth)
36 : ModulePass((intptr_t)&ID), PMDataManager(Depth) { }
36 : ModulePass(&ID), PMDataManager(Depth) { }
3737
3838 /// run - Execute all of the passes scheduled for execution. Keep track of
3939 /// whether any of the passes modifies the module, and if so, return true.
8787
8888 public:
8989 static char ID;
90 GlobalsModRef() : ModulePass((intptr_t)&ID) {}
90 GlobalsModRef() : ModulePass(&ID) {}
9191
9292 bool runOnModule(Module &M) {
9393 InitializeAliasAnalysis(this); // set up super class
5151 }
5252 public:
5353 static char ID; // Pass identification, replacement for typeid
54 InstCount() : FunctionPass((intptr_t)&ID) {}
54 InstCount() : FunctionPass(&ID) {}
5555
5656 virtual bool runOnFunction(Function &F);
5757
9090 // distinguish it from a copy constructor. Always pass in false for now.
9191 //
9292 IntervalPartition::IntervalPartition(IntervalPartition &IP, bool)
93 : FunctionPass((intptr_t) &ID) {
93 : FunctionPass(&ID) {
9494 assert(IP.getRootInterval() && "Cannot operate on empty IntervalPartitions!");
9595
9696 // Pass false to intervals_begin because we take ownership of it's memory
2424 /// LPPassManager manages FPPassManagers and CalLGraphSCCPasses.
2525
2626 LPPassManager::LPPassManager(int Depth)
27 : FunctionPass((intptr_t)&ID), PMDataManager(Depth) {
27 : FunctionPass(&ID), PMDataManager(Depth) {
2828 skipThisLoop = false;
2929 redoThisLoop = false;
3030 LI = NULL;
8484 struct VISIBILITY_HIDDEN NoProfileInfo
8585 : public ImmutablePass, public ProfileInfo {
8686 static char ID; // Class identification, replacement for typeinfo
87 NoProfileInfo() : ImmutablePass((intptr_t)&ID) {}
87 NoProfileInfo() : ImmutablePass(&ID) {}
8888 };
8989 } // End of anonymous namespace
9090
3333 public:
3434 static char ID; // Class identification, replacement for typeinfo
3535 explicit LoaderPass(const std::string &filename = "")
36 : ModulePass((intptr_t)&ID), Filename(filename) {
36 : ModulePass(&ID), Filename(filename) {
3737 if (filename.empty()) Filename = ProfileInfoFilename;
3838 }
3939
2020 public:
2121 static char ID; // Pass identifcation, replacement for typeid
2222 explicit WriteBitcodePass(std::ostream &o)
23 : ModulePass((intptr_t) &ID), Out(o) {}
23 : ModulePass(&ID), Out(o) {}
2424
2525 const char *getPassName() const { return "Bitcode Writer"; }
2626
3636 char AsmPrinter::ID = 0;
3737 AsmPrinter::AsmPrinter(raw_ostream &o, TargetMachine &tm,
3838 const TargetAsmInfo *T)
39 : MachineFunctionPass((intptr_t)&ID), FunctionNumber(0), O(o),
39 : MachineFunctionPass(&ID), FunctionNumber(0), O(o),
4040 TM(tm), TAI(T), TRI(tm.getRegisterInfo()),
4141 IsInTextSection(false)
4242 {}
4747 struct VISIBILITY_HIDDEN BranchFolder : public MachineFunctionPass {
4848 static char ID;
4949 explicit BranchFolder(bool defaultEnableTailMerge) :
50 MachineFunctionPass((intptr_t)&ID) {
50 MachineFunctionPass(&ID) {
5151 switch (FlagEnableTailMerge) {
5252 case cl::BOU_UNSET: EnableTailMerge = defaultEnableTailMerge; break;
5353 case cl::BOU_TRUE: EnableTailMerge = true; break;
194194 //===----------------------------------------------------------------------===//
195195
196196 ELFWriter::ELFWriter(raw_ostream &o, TargetMachine &tm)
197 : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) {
197 : MachineFunctionPass(&ID), O(o), TM(tm) {
198198 e_flags = 0; // e_flags defaults to 0, no flags.
199199
200200 is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
6565 char GCModuleInfo::ID = 0;
6666
6767 GCModuleInfo::GCModuleInfo()
68 : ImmutablePass((intptr_t)&ID) {}
68 : ImmutablePass(&ID) {}
6969
7070 GCModuleInfo::~GCModuleInfo() {
7171 clear();
126126 char LowerIntrinsics::ID = 0;
127127
128128 LowerIntrinsics::LowerIntrinsics()
129 : FunctionPass((intptr_t)&ID) {}
129 : FunctionPass(&ID) {}
130130
131131 const char *LowerIntrinsics::getPassName() const {
132132 return "Lower Garbage Collection Instructions";
145145 bool MadeChange;
146146 public:
147147 static char ID;
148 IfConverter() : MachineFunctionPass((intptr_t)&ID) {}
148 IfConverter() : MachineFunctionPass(&ID) {}
149149
150150 virtual bool runOnMachineFunction(MachineFunction &MF);
151151 virtual const char *getPassName() const { return "If Converter"; }
2525 class LoopAligner : public MachineFunctionPass {
2626 public:
2727 static char ID;
28 LoopAligner() : MachineFunctionPass((intptr_t)&ID) {}
28 LoopAligner() : MachineFunctionPass(&ID) {}
2929
3030 virtual bool runOnMachineFunction(MachineFunction &MF);
3131 virtual const char *getPassName() const { return "Loop aligner"; }
2323 struct VISIBILITY_HIDDEN LowerSubregsInstructionPass
2424 : public MachineFunctionPass {
2525 static char ID; // Pass identification, replacement for typeid
26 LowerSubregsInstructionPass() : MachineFunctionPass((intptr_t)&ID) {}
26 LowerSubregsInstructionPass() : MachineFunctionPass(&ID) {}
2727
2828 const char *getPassName() const {
2929 return "Subregister lowering instruction pass";
335335
336336 char MachOWriter::ID = 0;
337337 MachOWriter::MachOWriter(raw_ostream &o, TargetMachine &tm)
338 : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) {
338 : MachineFunctionPass(&ID), O(o), TM(tm) {
339339 is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
340340 isLittleEndian = TM.getTargetData()->isLittleEndian();
341341
4848 const std::string Banner;
4949
5050 Printer (std::ostream *os, const std::string &banner)
51 : MachineFunctionPass((intptr_t)&ID), OS(os), Banner(banner) {}
51 : MachineFunctionPass(&ID), OS(os), Banner(banner) {}
5252
5353 const char *getPassName() const { return "MachineFunction Printer"; }
5454
7676 namespace {
7777 struct VISIBILITY_HIDDEN Deleter : public MachineFunctionPass {
7878 static char ID;
79 Deleter() : MachineFunctionPass((intptr_t)&ID) {}
79 Deleter() : MachineFunctionPass(&ID) {}
8080
8181 const char *getPassName() const { return "Machine Code Deleter"; }
8282
4444 MachineLoop *CurLoop; // The current loop we are working on.
4545 public:
4646 static char ID; // Pass identification, replacement for typeid
47 MachineLICM() : MachineFunctionPass((intptr_t)&ID) {}
47 MachineLICM() : MachineFunctionPass(&ID) {}
4848
4949 virtual bool runOnMachineFunction(MachineFunction &MF);
5050
16111611 //===----------------------------------------------------------------------===//
16121612
16131613 MachineModuleInfo::MachineModuleInfo()
1614 : ImmutablePass((intptr_t)&ID)
1614 : ImmutablePass(&ID)
16151615 , DR()
16161616 , VR()
16171617 , CompileUnits()
20102010
20112011 struct DebugLabelFolder : public MachineFunctionPass {
20122012 static char ID;
2013 DebugLabelFolder() : MachineFunctionPass((intptr_t)&ID) {}
2013 DebugLabelFolder() : MachineFunctionPass(&ID) {}
20142014
20152015 virtual bool runOnMachineFunction(MachineFunction &MF);
20162016 virtual const char *getPassName() const { return "Label Folder"; }
3535
3636 public:
3737 static char ID; // Pass identification
38 MachineSinking() : MachineFunctionPass((intptr_t)&ID) {}
38 MachineSinking() : MachineFunctionPass(&ID) {}
3939
4040 virtual bool runOnMachineFunction(MachineFunction &MF);
4141
3737
3838 public:
3939 static char ID; // Pass identification, replacement for typeid
40 PNE() : MachineFunctionPass((intptr_t)&ID) {}
40 PNE() : MachineFunctionPass(&ID) {}
4141
4242 virtual bool runOnMachineFunction(MachineFunction &Fn);
4343
2828 class VISIBILITY_HIDDEN SchedulePostRATDList : public MachineFunctionPass {
2929 public:
3030 static char ID;
31 SchedulePostRATDList() : MachineFunctionPass((intptr_t)&ID) {}
31 SchedulePostRATDList() : MachineFunctionPass(&ID) {}
3232 private:
3333 MachineFunction *MF;
3434 const TargetMachine *TM;
3434 namespace {
3535 struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass {
3636 static char ID;
37 PEI() : MachineFunctionPass((intptr_t)&ID) {}
37 PEI() : MachineFunctionPass(&ID) {}
3838
3939 const char *getPassName() const {
4040 return "Prolog/Epilog Insertion & Frame Finalization";
8181 class VISIBILITY_HIDDEN RABigBlock : public MachineFunctionPass {
8282 public:
8383 static char ID;
84 RABigBlock() : MachineFunctionPass((intptr_t)&ID) {}
84 RABigBlock() : MachineFunctionPass(&ID) {}
8585 private:
8686 /// TM - For getting at TargetMachine info
8787 ///
5454 namespace {
5555 struct VISIBILITY_HIDDEN RALinScan : public MachineFunctionPass {
5656 static char ID;
57 RALinScan() : MachineFunctionPass((intptr_t)&ID) {}
57 RALinScan() : MachineFunctionPass(&ID) {}
5858
5959 typedef std::pair IntervalPtr;
6060 typedef SmallVector IntervalPtrs;
4343 class VISIBILITY_HIDDEN RALocal : public MachineFunctionPass {
4444 public:
4545 static char ID;
46 RALocal() : MachineFunctionPass((intptr_t)&ID),
47 StackSlotForVirtReg(-1) {}
46 RALocal() : MachineFunctionPass(&ID), StackSlotForVirtReg(-1) {}
4847 private:
4948 const TargetMachine *TM;
5049 MachineFunction *MF;
4040 class VISIBILITY_HIDDEN RegAllocSimple : public MachineFunctionPass {
4141 public:
4242 static char ID;
43 RegAllocSimple() : MachineFunctionPass((intptr_t)&ID) {}
43 RegAllocSimple() : MachineFunctionPass(&ID) {}
4444 private:
4545 MachineFunction *MF;
4646 const TargetMachine *TM;
157157 //===----------------------------------------------------------------------===//
158158
159159 SelectionDAGISel::SelectionDAGISel(TargetLowering &tli, bool fast) :
160 FunctionPass((intptr_t)&ID), TLI(tli),
160 FunctionPass(&ID), TLI(tli),
161161 FuncInfo(new FunctionLoweringInfo(TLI)),
162162 CurDAG(new SelectionDAG(TLI, *FuncInfo)),
163163 SDL(new SelectionDAGLowering(*CurDAG, TLI, *FuncInfo)),
101101
102102 public:
103103 static char ID; // Pass identifcation, replacement for typeid
104 SimpleRegisterCoalescing() : MachineFunctionPass((intptr_t)&ID) {}
104 SimpleRegisterCoalescing() : MachineFunctionPass(&ID) {}
105105
106106 struct InstrSlots {
107107 enum {
6161
6262 public:
6363 static char ID; // Pass identification
64 StackSlotColoring() : MachineFunctionPass((intptr_t)&ID), NextColor(-1) {}
64 StackSlotColoring() : MachineFunctionPass(&ID), NextColor(-1) {}
6565
6666 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
6767 AU.addRequired();
3737 namespace {
3838 struct VISIBILITY_HIDDEN StrongPHIElimination : public MachineFunctionPass {
3939 static char ID; // Pass identification, replacement for typeid
40 StrongPHIElimination() : MachineFunctionPass((intptr_t)&ID) {}
40 StrongPHIElimination() : MachineFunctionPass(&ID) {}
4141
4242 // Waiting stores, for each MBB, the set of copies that need to
4343 // be inserted into that MBB
6969 DenseMap &DistanceMap);
7070 public:
7171 static char ID; // Pass identification, replacement for typeid
72 TwoAddressInstructionPass() : MachineFunctionPass((intptr_t)&ID) {}
72 TwoAddressInstructionPass() : MachineFunctionPass(&ID) {}
7373
7474 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
7575 AU.addPreserved();
3939 virtual bool runOnFunction(Function &F);
4040 public:
4141 static char ID; // Pass identification, replacement for typeid
42 UnreachableBlockElim() : FunctionPass((intptr_t)&ID) {}
42 UnreachableBlockElim() : FunctionPass(&ID) {}
4343 };
4444 }
4545 char UnreachableBlockElim::ID = 0;
8989
9090 public:
9191 static char ID; // Pass identification, replacement for typeid
92 UnreachableMachineBlockElim() : MachineFunctionPass((intptr_t)&ID) {}
92 UnreachableMachineBlockElim() : MachineFunctionPass(&ID) {}
9393 };
9494 }
9595 char UnreachableMachineBlockElim::ID = 0;
3838 public:
3939 static char ID;
4040 explicit ARMCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce)
41 : MachineFunctionPass((intptr_t)&ID), II(0), TD(0), TM(tm),
41 : MachineFunctionPass(&ID), II(0), TD(0), TM(tm),
4242 MCE(mce) {}
4343 ARMCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce,
4444 const ARMInstrInfo &ii, const TargetData &td)
45 : MachineFunctionPass((intptr_t)&ID), II(&ii), TD(&td), TM(tm),
45 : MachineFunctionPass(&ID), II(&ii), TD(&td), TM(tm),
4646 MCE(mce) {}
4747
4848 bool runOnMachineFunction(MachineFunction &MF);
128128 bool isThumb;
129129 public:
130130 static char ID;
131 ARMConstantIslands() : MachineFunctionPass((intptr_t)&ID) {}
131 ARMConstantIslands() : MachineFunctionPass(&ID) {}
132132
133133 virtual bool runOnMachineFunction(MachineFunction &Fn);
134134
3838 namespace {
3939 struct VISIBILITY_HIDDEN ARMLoadStoreOpt : public MachineFunctionPass {
4040 static char ID;
41 ARMLoadStoreOpt() : MachineFunctionPass((intptr_t)&ID) {}
41 ARMLoadStoreOpt() : MachineFunctionPass(&ID) {}
4242
4343 const TargetInstrInfo *TII;
4444 const TargetRegisterInfo *TRI;
2222 namespace {
2323 struct VISIBILITY_HIDDEN AlphaBSel : public MachineFunctionPass {
2424 static char ID;
25 AlphaBSel() : MachineFunctionPass((intptr_t)&ID) {}
25 AlphaBSel() : MachineFunctionPass(&ID) {}
2626
2727 virtual bool runOnMachineFunction(MachineFunction &Fn);
2828
3838 public:
3939 static char ID;
4040 explicit AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce)
41 : MachineFunctionPass((intptr_t)&ID), II(0), TM(tm), MCE(mce) {}
41 : MachineFunctionPass(&ID), II(0), TM(tm), MCE(mce) {}
4242 AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce,
4343 const AlphaInstrInfo& ii)
44 : MachineFunctionPass((intptr_t)&ID), II(&ii), TM(tm), MCE(mce) {}
44 : MachineFunctionPass(&ID), II(&ii), TM(tm), MCE(mce) {}
4545
4646 bool runOnMachineFunction(MachineFunction &MF);
4747
3838
3939 static char ID;
4040 AlphaLLRPPass(AlphaTargetMachine &tm)
41 : MachineFunctionPass((intptr_t)&ID), TM(tm) { }
41 : MachineFunctionPass(&ID), TM(tm) { }
4242
4343 virtual const char *getPassName() const {
4444 return "Alpha NOP inserter";
5959 public:
6060 static char ID;
6161 CBackendNameAllUsedStructsAndMergeFunctions()
62 : ModulePass((intptr_t)&ID) {}
62 : ModulePass(&ID) {}
6363 void getAnalysisUsage(AnalysisUsage &AU) const {
6464 AU.addRequired();
6565 }
9191 public:
9292 static char ID;
9393 explicit CWriter(raw_ostream &o)
94 : FunctionPass((intptr_t)&ID), Out(o), IL(0), Mang(0), LI(0),
94 : FunctionPass(&ID), Out(o), IL(0), Mang(0), LI(0),
9595 TheModule(0), TAsm(0), TD(0) {}
9696
9797 virtual const char *getPassName() const { return "C backend"; }
102102 public:
103103 static char ID;
104104 explicit CppWriter(raw_ostream &o) :
105 ModulePass((intptr_t)&ID), Out(o), uniqueNum(0), is_inline(false) {}
105 ModulePass(&ID), Out(o), uniqueNum(0), is_inline(false) {}
106106
107107 virtual const char *getPassName() const { return "C++ backend"; }
108108
4242 IA64TargetMachine &TM;
4343
4444 IA64BundlingPass(IA64TargetMachine &tm)
45 : MachineFunctionPass((intptr_t)&ID), TM(tm) { }
45 : MachineFunctionPass(&ID), TM(tm) { }
4646
4747 virtual const char *getPassName() const {
4848 return "IA64 (Itanium) Bundling Pass";
4141 static char ID;
4242 MSILModule(const std::set*& _UsedTypes,
4343 const TargetData*& _TD)
44 : ModulePass((intptr_t)&ID), UsedTypes(_UsedTypes), TD(_TD) {}
44 : ModulePass(&ID), UsedTypes(_UsedTypes), TD(_TD) {}
4545
4646 void getAnalysisUsage(AnalysisUsage &AU) const {
4747 AU.addRequired();
8585 StaticInitList;
8686 const std::set* UsedTypes;
8787 static char ID;
88 MSILWriter(raw_ostream &o) : FunctionPass((intptr_t)&ID), Out(o) {
88 MSILWriter(raw_ostream &o) : FunctionPass(&ID), Out(o) {
8989 UniqID = 0;
9090 }
9191
3131
3232 static char ID;
3333 Filler(TargetMachine &tm)
34 : MachineFunctionPass((intptr_t)&ID), TM(tm), TII(tm.getInstrInfo()) { }
34 : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { }
3535
3636 virtual const char *getPassName() const {
3737 return "Mips Delay Slot Filler";
3131 namespace {
3232 struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass {
3333 static char ID;
34 PPCBSel() : MachineFunctionPass((intptr_t)&ID) {}
34 PPCBSel() : MachineFunctionPass(&ID) {}
3535
3636 /// BlockSizes - The sizes of the basic blocks in the function.
3737 std::vector BlockSizes;
4747 public:
4848 static char ID;
4949 PPCCodeEmitter(TargetMachine &T, MachineCodeEmitter &M)
50 : MachineFunctionPass((intptr_t)&ID), TM(T), MCE(M) {}
50 : MachineFunctionPass(&ID), TM(T), MCE(M) {}
5151
5252 const char *getPassName() const { return "PowerPC Machine Code Emitter"; }
5353
3131
3232 static char ID;
3333 Filler(TargetMachine &tm)
34 : MachineFunctionPass((intptr_t)&ID), TM(tm), TII(tm.getInstrInfo()) { }
34 : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { }
3535
3636 virtual const char *getPassName() const {
3737 return "SPARC Delay Slot Filler";
3333
3434 static char ID;
3535 FPMover(TargetMachine &tm)
36 : MachineFunctionPass((intptr_t)&ID), TM(tm) { }
36 : MachineFunctionPass(&ID), TM(tm) { }
3737
3838 virtual const char *getPassName() const {
3939 return "Sparc Double-FP Move Fixer";
231231 }
232232
233233 TargetData::TargetData(const Module *M)
234 : ImmutablePass((intptr_t)&ID) {
234 : ImmutablePass(&ID) {
235235 init(M->getDataLayout());
236236 }
237237
4545 public:
4646 static char ID;
4747 explicit Emitter(X86TargetMachine &tm, MachineCodeEmitter &mce)
48 : MachineFunctionPass((intptr_t)&ID), II(0), TD(0), TM(tm),
48 : MachineFunctionPass(&ID), II(0), TD(0), TM(tm),
4949 MCE(mce), PICBaseOffset(0), Is64BitMode(false),
5050 IsPIC(TM.getRelocationModel() == Reloc::PIC_) {}
5151 Emitter(X86TargetMachine &tm, MachineCodeEmitter &mce,
5252 const X86InstrInfo &ii, const TargetData &td, bool is64)
53 : MachineFunctionPass((intptr_t)&ID), II(&ii), TD(&td), TM(tm),
53 : MachineFunctionPass(&ID), II(&ii), TD(&td), TM(tm),
5454 MCE(mce), PICBaseOffset(0), Is64BitMode(is64),
5555 IsPIC(TM.getRelocationModel() == Reloc::PIC_) {}
5656
5252 namespace {
5353 struct VISIBILITY_HIDDEN FPS : public MachineFunctionPass {
5454 static char ID;
55 FPS() : MachineFunctionPass((intptr_t)&ID) {}
55 FPS() : MachineFunctionPass(&ID) {}
5656
5757 virtual bool runOnMachineFunction(MachineFunction &MF);
5858
11171117 namespace {
11181118 struct VISIBILITY_HIDDEN MSAC : public MachineFunctionPass {
11191119 static char ID;
1120 MSAC() : MachineFunctionPass((intptr_t)&ID) {}
1120 MSAC() : MachineFunctionPass(&ID) {}
11211121
11221122 virtual bool runOnMachineFunction(MachineFunction &MF) {
11231123 MachineFrameInfo *FFI = MF.getFrameInfo();
2525 // Hello - The first implementation, without getAnalysisUsage.
2626 struct Hello : public FunctionPass {
2727 static char ID; // Pass identification, replacement for typeid
28 Hello() : FunctionPass((intptr_t)&ID) {}
28 Hello() : FunctionPass(&ID) {}
2929
3030 virtual bool runOnFunction(Function &F) {
3131 HelloCounter++;
4444 // Hello2 - The second implementation with getAnalysisUsage implemented.
4545 struct Hello2 : public FunctionPass {
4646 static char ID; // Pass identification, replacement for typeid
47 Hello2() : FunctionPass((intptr_t)&ID) {}
47 Hello2() : FunctionPass(&ID) {}
4848
4949 virtual bool runOnFunction(Function &F) {
5050 HelloCounter++;
6565
6666 virtual bool runOnSCC(const std::vector &SCC);
6767 static char ID; // Pass identification, replacement for typeid
68 ArgPromotion(unsigned maxElements = 3) : CallGraphSCCPass((intptr_t)&ID),
68 ArgPromotion(unsigned maxElements = 3) : CallGraphSCCPass(&ID),
6969 maxElements(maxElements) {}
7070
7171 /// A vector used to hold the indices of a single GEP instruction
3030 namespace {
3131 struct VISIBILITY_HIDDEN ConstantMerge : public ModulePass {
3232 static char ID; // Pass identification, replacement for typeid
33 ConstantMerge() : ModulePass((intptr_t)&ID) {}
33 ConstantMerge() : ModulePass(&ID) {}
3434
3535 // run - For this pass, process all of the globals in the module,
3636 // eliminating duplicate constants.
120120
121121 public:
122122 static char ID; // Pass identification, replacement for typeid
123 DAE() : ModulePass((intptr_t)&ID) {}
123 DAE() : ModulePass(&ID) {}
124124 bool runOnModule(Module &M);
125125
126126 virtual bool ShouldHackArguments() const { return false; }
2626 namespace {
2727 struct VISIBILITY_HIDDEN DTE : public ModulePass {
2828 static char ID; // Pass identification, replacement for typeid
29 DTE() : ModulePass((intptr_t)&ID) {}
29 DTE() : ModulePass(&ID) {}
3030
3131 // doPassInitialization - For this pass, it removes global symbol table
3232 // entries for primitive types. These are never used for linking in GCC and
3434 ///
3535 explicit GVExtractorPass(std::vector& GVs, bool deleteS = true,
3636 bool relinkCallees = false)
37 : ModulePass((intptr_t)&ID), Named(GVs), deleteStuff(deleteS),
37 : ModulePass(&ID), Named(GVs), deleteStuff(deleteS),
3838 reLink(relinkCallees) {}
3939
4040 bool runOnModule(Module &M) {
3030 namespace {
3131 struct VISIBILITY_HIDDEN GlobalDCE : public ModulePass {
3232 static char ID; // Pass identification, replacement for typeid
33 GlobalDCE() : ModulePass((intptr_t)&ID) {}
33 GlobalDCE() : ModulePass(&ID) {}
3434
3535 // run - Do the GlobalDCE pass on the specified module, optionally updating
3636 // the specified callgraph to reflect the changes.
5656 AU.addRequired();
5757 }
5858 static char ID; // Pass identification, replacement for typeid
59 GlobalOpt() : ModulePass((intptr_t)&ID) {}
59 GlobalOpt() : ModulePass(&ID) {}
6060
6161 bool runOnModule(Module &M);
6262
3535 ///
3636 struct VISIBILITY_HIDDEN IPCP : public ModulePass {
3737 static char ID; // Pass identification, replacement for typeid
38 IPCP() : ModulePass((intptr_t)&ID) {}
38 IPCP() : ModulePass(&ID) {}
3939
4040 bool runOnModule(Module &M);
4141 private:
3232 class VISIBILITY_HIDDEN IndMemRemPass : public ModulePass {
3333 public:
3434 static char ID; // Pass identification, replacement for typeid
35 IndMemRemPass() : ModulePass((intptr_t)&ID) {}
35 IndMemRemPass() : ModulePass(&ID) {}
3636
3737 virtual bool runOnModule(Module &M);
3838 };
3333 InlineLimit("inline-threshold", cl::Hidden, cl::init(200),
3434 cl::desc("Control the amount of inlining to perform (default = 200)"));
3535
36 Inliner::Inliner(const void *ID)
37 : CallGraphSCCPass((intptr_t)ID), InlineThreshold(InlineLimit) {}
38
39 Inliner::Inliner(const void *ID, int Threshold)
40 : CallGraphSCCPass((intptr_t)ID), InlineThreshold(Threshold) {}
36 Inliner::Inliner(void *ID)
37 : CallGraphSCCPass(ID), InlineThreshold(InlineLimit) {}
38
39 Inliner::Inliner(void *ID, int Threshold)
40 : CallGraphSCCPass(ID), InlineThreshold(Threshold) {}
4141
4242 /// getAnalysisUsage - For this class, we declare that we require and preserve
4343 /// the call graph. If the derived class implements this method, it should
5959 X("internalize", "Internalize Global Symbols");
6060
6161 InternalizePass::InternalizePass(bool AllButMain)
62 : ModulePass((intptr_t)&ID), AllButMain(AllButMain){
62 : ModulePass(&ID), AllButMain(AllButMain){
6363 if (!APIFile.empty()) // If a filename is specified, use it.
6464 LoadFile(APIFile.c_str());
6565 if (!APIList.empty()) // If a list is specified, use it as well.
6767 }
6868
6969 InternalizePass::InternalizePass(const std::vector&exportList)
70 : ModulePass((intptr_t)&ID), AllButMain(false){
70 : ModulePass(&ID), AllButMain(false){
7171 for(std::vector::const_iterator itr = exportList.begin();
7272 itr != exportList.end(); itr++) {
7373 ExternalNames.insert(*itr);
4040 unsigned NumLoops;
4141
4242 explicit LoopExtractor(unsigned numLoops = ~0)
43 : FunctionPass((intptr_t)&ID), NumLoops(numLoops) {}
43 : FunctionPass(&ID), NumLoops(numLoops) {}
4444
4545 virtual bool runOnFunction(Function &F);
4646
166166 public:
167167 static char ID; // Pass identification, replacement for typeid
168168 explicit BlockExtractorPass(const std::vector &B)
169 : ModulePass((intptr_t)&ID), BlocksToNotExtract(B) {
169 : ModulePass(&ID), BlocksToNotExtract(B) {
170170 if (!BlockFile.empty())
171171 LoadFile(BlockFile.c_str());
172172 }
173 BlockExtractorPass() : ModulePass((intptr_t)&ID) {}
173 BlockExtractorPass() : ModulePass(&ID) {}
174174
175175 bool runOnModule(Module &M);
176176 };
111111 bool IsTransformableFunction(const std::string& Name);
112112 public:
113113 static char ID; // Pass identification, replacement for typeid
114 LowerSetJmp() : ModulePass((intptr_t)&ID) {}
114 LowerSetJmp() : ModulePass(&ID) {}
115115
116116 void visitCallInst(CallInst& CI);
117117 void visitInvokeInst(InvokeInst& II);
4444 int scanDistribution(Function&, int, std::map&);
4545 public :
4646 static char ID; // Pass identification, replacement for typeid
47 PartSpec() : ModulePass((intptr_t)&ID) {}
47 PartSpec() : ModulePass(&ID) {}
4848 bool runOnModule(Module &M);
4949 };
5050 }
3434 namespace {
3535 struct VISIBILITY_HIDDEN PruneEH : public CallGraphSCCPass {
3636 static char ID; // Pass identification, replacement for typeid
37 PruneEH() : CallGraphSCCPass((intptr_t)&ID) {}
37 PruneEH() : CallGraphSCCPass(&ID) {}
3838
3939 // runOnSCC - Analyze the SCC, performing the transformation if possible.
4040 bool runOnSCC(const std::vector &SCC);
3636 public:
3737 static char ID; // Pass identification, replacement for typeid
3838 RaiseAllocations()
39 : ModulePass((intptr_t)&ID), MallocFunc(0), FreeFunc(0) {}
39 : ModulePass(&ID), MallocFunc(0), FreeFunc(0) {}
4040
4141 // doPassInitialization - For the raise allocations pass, this finds a
4242 // declaration for malloc and free if they exist.
2929 class VISIBILITY_HIDDEN StripDeadPrototypesPass : public ModulePass {
3030 public:
3131 static char ID; // Pass identification, replacement for typeid
32 StripDeadPrototypesPass() : ModulePass((intptr_t)&ID) { }
32 StripDeadPrototypesPass() : ModulePass(&ID) { }
3333 virtual bool runOnModule(Module &M);
3434 };
3535
3737 public:
3838 static char ID; // Pass identification, replacement for typeid
3939 explicit StripSymbols(bool ODI = false)
40 : ModulePass((intptr_t)&ID), OnlyDebugInfo(ODI) {}
40 : ModulePass(&ID), OnlyDebugInfo(ODI) {}
4141
4242 virtual bool runOnModule(Module &M);
4343
4848
4949 virtual bool runOnSCC(const std::vector &SCC);
5050 static char ID; // Pass identification, replacement for typeid
51 SRETPromotion() : CallGraphSCCPass((intptr_t)&ID) {}
51 SRETPromotion() : CallGraphSCCPass(&ID) {}
5252
5353 private:
5454 bool PromoteReturn(CallGraphNode *CGN);
3333 bool runOnModule(Module &M);
3434 public:
3535 static char ID; // Pass identification, replacement for typeid
36 EdgeProfiler() : ModulePass((intptr_t)&ID) {}
36 EdgeProfiler() : ModulePass(&ID) {}
3737 };
3838 }
3939
143143 /// ProfilerRS - Insert the random sampling framework
144144 struct VISIBILITY_HIDDEN ProfilerRS : public FunctionPass {
145145 static char ID; // Pass identification, replacement for typeid
146 ProfilerRS() : FunctionPass((intptr_t)&ID) {}
146 ProfilerRS() : FunctionPass(&ID) {}
147147
148148 std::map TransCache;
149149 std::set ChoicePoints;
3434 namespace {
3535 struct VISIBILITY_HIDDEN ADCE : public FunctionPass {
3636 static char ID; // Pass identification, replacement for typeid
37 ADCE() : FunctionPass((intptr_t)&ID) {}
37 ADCE() : FunctionPass(&ID) {}
3838
3939 virtual bool runOnFunction(Function& F);
4040
4141 namespace {
4242 struct VISIBILITY_HIDDEN BlockPlacement : public FunctionPass {
4343 static char ID; // Pass identification, replacement for typeid
44 BlockPlacement() : FunctionPass((intptr_t)&ID) {}
44 BlockPlacement() : FunctionPass(&ID) {}
4545
4646 virtual bool runOnFunction(Function &F);
4747
4242 public:
4343 static char ID; // Pass identification, replacement for typeid
4444 explicit CodeGenPrepare(const TargetLowering *tli = 0)
45 : FunctionPass((intptr_t)&ID), TLI(tli) {}
45 : FunctionPass(&ID), TLI(tli) {}
4646 bool runOnFunction(Function &F);
4747
4848 private:
3131 namespace {
3232 struct VISIBILITY_HIDDEN CondProp : public FunctionPass {
3333 static char ID; // Pass identification, replacement for typeid
34 CondProp() : FunctionPass((intptr_t)&ID) {}
34 CondProp() : FunctionPass(&ID) {}
3535
3636 virtual bool runOnFunction(Function &F);
3737
3434 namespace {
3535 struct VISIBILITY_HIDDEN ConstantPropagation : public FunctionPass {
3636 static char ID; // Pass identification, replacement for typeid
37 ConstantPropagation() : FunctionPass((intptr_t)&ID) {}
37 ConstantPropagation() : FunctionPass(&ID) {}
3838
3939 bool runOnFunction(Function &F);
4040
6868 //
6969 struct DCE : public FunctionPass {
7070 static char ID; // Pass identification, replacement for typeid
71 DCE() : FunctionPass((intptr_t)&ID) {}
71 DCE() : FunctionPass(&ID) {}
7272
7373 virtual bool runOnFunction(Function &F);
7474
3838 namespace {
3939 struct VISIBILITY_HIDDEN DSE : public FunctionPass {
4040 static char ID; // Pass identification, replacement for typeid
41 DSE() : FunctionPass((intptr_t)&ID) {}
41 DSE() : FunctionPass(&ID) {}
4242
4343 virtual bool runOnFunction(Function &F) {
4444 bool Changed = false;
696696 bool runOnFunction(Function &F);
697697 public:
698698 static char ID; // Pass identification, replacement for typeid
699 GVN() : FunctionPass((intptr_t)&ID) { }
699 GVN() : FunctionPass(&ID) { }
700700
701701 private:
702702 ValueTable VN;
671671 bool runOnFunction(Function &F);
672672 public:
673673 static char ID; // Pass identification, replacement for typeid
674 GVNPRE() : FunctionPass((intptr_t)&ID) { }
674 GVNPRE() : FunctionPass(&ID) {}
675675
676676 private:
677677 ValueTable VN;
6969 public:
7070
7171 static char ID; // Pass identification, replacement for typeid
72 IndVarSimplify() : LoopPass((intptr_t)&ID) {}
72 IndVarSimplify() : LoopPass(&ID) {}
7373
7474 bool runOnLoop(Loop *L, LPPassManager &LPM);
7575 bool doInitialization(Loop *L, LPPassManager &LPM);
7979 bool MustPreserveLCSSA;
8080 public:
8181 static char ID; // Pass identification, replacement for typeid
82 InstCombiner() : FunctionPass((intptr_t)&ID) {}
82 InstCombiner() : FunctionPass(&ID) {}
8383
8484 /// AddToWorkList - Add the specified instruction to the worklist if it
8585 /// isn't already in it.
5151 class VISIBILITY_HIDDEN JumpThreading : public FunctionPass {
5252 public:
5353 static char ID; // Pass identification
54 JumpThreading() : FunctionPass((intptr_t)&ID) {}
54 JumpThreading() : FunctionPass(&ID) {}
5555
5656 bool runOnFunction(Function &F);
5757 bool ThreadBlock(BasicBlock *BB);
7373 namespace {
7474 struct VISIBILITY_HIDDEN LICM : public LoopPass {
7575 static char ID; // Pass identification, replacement for typeid
76 LICM() : LoopPass((intptr_t)&ID) {}
76 LICM() : LoopPass(&ID) {}
7777
7878 virtual bool runOnLoop(Loop *L, LPPassManager &LPM);
7979
2929 class VISIBILITY_HIDDEN LoopDeletion : public LoopPass {
3030 public:
3131 static char ID; // Pass ID, replacement for typeid
32 LoopDeletion() : LoopPass((intptr_t)&ID) { }
32 LoopDeletion() : LoopPass(&ID) {}
3333
3434 // Possibly eliminate loop L if it is dead.
3535 bool runOnLoop(Loop* L, LPPassManager& LPM);
3232
3333 public:
3434 static char ID; // Pass ID, replacement for typeid
35 LoopIndexSplit() : LoopPass((intptr_t)&ID) {}
35 LoopIndexSplit() : LoopPass(&ID) {}
3636
3737 // Index split Loop L. Return true if loop is split.
3838 bool runOnLoop(Loop *L, LPPassManager &LPM);
4747
4848 public:
4949 static char ID; // Pass ID, replacement for typeid
50 LoopRotate() : LoopPass((intptr_t)&ID) {}
50 LoopRotate() : LoopPass(&ID) {}
5151
5252 // Rotate Loop L as many times as possible. Return true if
5353 // loop is rotated at least once.
147147 public:
148148 static char ID; // Pass ID, replacement for typeid
149149 explicit LoopStrengthReduce(const TargetLowering *tli = NULL) :
150 LoopPass((intptr_t)&ID), TLI(tli) {
150 LoopPass(&ID), TLI(tli) {
151151 }
152152
153153 bool runOnLoop(Loop *L, LPPassManager &LPM);
4141 class VISIBILITY_HIDDEN LoopUnroll : public LoopPass {
4242 public:
4343 static char ID; // Pass ID, replacement for typeid
44 LoopUnroll() : LoopPass((intptr_t)&ID) {}
44 LoopUnroll() : LoopPass(&ID) {}
4545
4646 /// A magic value for use with the Threshold parameter to indicate
4747 /// that the loop unroll should be performed regardless of how much
8686 public:
8787 static char ID; // Pass ID, replacement for typeid
8888 explicit LoopUnswitch(bool Os = false) :
89 LoopPass((intptr_t)&ID), OptimizeForSize(Os), redoLoop(false),
89 LoopPass(&ID), OptimizeForSize(Os), redoLoop(false),
9090 currentLoop(NULL), DF(NULL), DT(NULL), loopHeader(NULL),
9191 loopPreheader(NULL) {}
9292
2727 namespace {
2828 struct VISIBILITY_HIDDEN MarkModRef : public FunctionPass {
2929 static char ID; // Pass identification, replacement for typeid
30 MarkModRef() : FunctionPass((intptr_t)&ID) {}
30 MarkModRef() : FunctionPass(&ID) {}
3131
3232 bool runOnFunction(Function &F);
3333
299299 bool runOnFunction(Function &F);
300300 public:
301301 static char ID; // Pass identification, replacement for typeid
302 MemCpyOpt() : FunctionPass((intptr_t)&ID) { }
302 MemCpyOpt() : FunctionPass(&ID) {}
303303
304304 private:
305305 // This transformation requires dominator postdominator info
22482248
22492249 public:
22502250 static char ID; // Pass identification, replacement for typeid
2251 PredicateSimplifier() : FunctionPass((intptr_t)&ID) {}
2251 PredicateSimplifier() : FunctionPass(&ID) {}
22522252
22532253 bool runOnFunction(Function &F);
22542254
7171 bool MadeChange;
7272 public:
7373 static char ID; // Pass identification, replacement for typeid
74 Reassociate() : FunctionPass((intptr_t)&ID) {}
74 Reassociate() : FunctionPass(&ID) {}
7575
7676 bool runOnFunction(Function &F);
7777
3535 namespace {
3636 struct VISIBILITY_HIDDEN RegToMem : public FunctionPass {
3737 static char ID; // Pass identification, replacement for typeid
38 RegToMem() : FunctionPass((intptr_t)&ID) {}
38 RegToMem() : FunctionPass(&ID) {}
3939
4040 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
4141 AU.addRequiredID(BreakCriticalEdgesID);
14961496 ///
14971497 struct VISIBILITY_HIDDEN SCCP : public FunctionPass {
14981498 static char ID; // Pass identification, replacement for typeid
1499 SCCP() : FunctionPass((intptr_t)&ID) {}
1499 SCCP() : FunctionPass(&ID) {}
15001500
15011501 // runOnFunction - Run the Sparse Conditional Constant Propagation
15021502 // algorithm, and return true if the function was modified.
16101610 ///
16111611 struct VISIBILITY_HIDDEN IPSCCP : public ModulePass {
16121612 static char ID;
1613 IPSCCP() : ModulePass((intptr_t)&ID) {}
1613 IPSCCP() : ModulePass(&ID) {}
16141614 bool runOnModule(Module &M);
16151615 };
16161616 } // end anonymous namespace
4747 namespace {
4848 struct VISIBILITY_HIDDEN SROA : public FunctionPass {
4949 static char ID; // Pass identification, replacement for typeid
50 explicit SROA(signed T = -1) : FunctionPass((intptr_t)&ID) {
50 explicit SROA(signed T = -1) : FunctionPass(&ID) {
5151 if (T == -1)
5252 SRThreshold = 128;
5353 else
4040 namespace {
4141 struct VISIBILITY_HIDDEN CFGSimplifyPass : public FunctionPass {
4242 static char ID; // Pass identification, replacement for typeid
43 CFGSimplifyPass() : FunctionPass((intptr_t)&ID) {}
43 CFGSimplifyPass() : FunctionPass(&ID) {}
4444
4545 virtual bool runOnFunction(Function &F);
4646 };
12051205 FWriteOpt FWrite; FPutsOpt FPuts; FPrintFOpt FPrintF;
12061206 public:
12071207 static char ID; // Pass identification
1208 SimplifyLibCalls() : FunctionPass((intptr_t)&ID) {}
1208 SimplifyLibCalls() : FunctionPass(&ID) {}
12091209
12101210 void InitOptimizations();
12111211 bool runOnFunction(Function &F);
4747 bool runOnFunction(Function &F);
4848 public:
4949 static char ID; // Pass identification, replacement for typeid
50 TailDup() : FunctionPass((intptr_t)&ID) {}
50 TailDup() : FunctionPass(&ID) {}
5151
5252 private:
5353 inline bool shouldEliminateUnconditionalBranch(TerminatorInst *, unsigned);
6767 namespace {
6868 struct VISIBILITY_HIDDEN TailCallElim : public FunctionPass {
6969 static char ID; // Pass identification, replacement for typeid
70 TailCallElim() : FunctionPass((intptr_t)&ID) {}
70 TailCallElim() : FunctionPass(&ID) {}
7171
7272 virtual bool runOnFunction(Function &F);
7373
3434 namespace {
3535 struct VISIBILITY_HIDDEN BreakCriticalEdges : public FunctionPass {
3636 static char ID; // Pass identification, replacement for typeid
37 BreakCriticalEdges() : FunctionPass((intptr_t)&ID) {}
37 BreakCriticalEdges() : FunctionPass(&ID) {}
3838
3939 virtual bool runOnFunction(Function &F);
4040
4848 namespace {
4949 struct VISIBILITY_HIDDEN LCSSA : public LoopPass {
5050 static char ID; // Pass identification, replacement for typeid
51 LCSSA() : LoopPass((intptr_t)&ID) {}
51 LCSSA() : LoopPass(&ID) {}
5252
5353 // Cached analysis information for the current function.
5454 LoopInfo *LI;
5555 namespace {
5656 struct VISIBILITY_HIDDEN LoopSimplify : public FunctionPass {
5757 static char ID; // Pass identification, replacement for typeid
58 LoopSimplify() : FunctionPass((intptr_t)&ID) {}
58 LoopSimplify() : FunctionPass(&ID) {}
5959
6060 // AA - If we have an alias analysis object to update, this is it, otherwise
6161 // this is null.
3737 public:
3838 static char ID; // Pass ID, replacement for typeid
3939 explicit LowerAllocations(bool LowerToInt = false)
40 : BasicBlockPass((intptr_t)&ID), MallocFunc(0), FreeFunc(0),
40 : BasicBlockPass(&ID), MallocFunc(0), FreeFunc(0),
4141 LowerMallocArgToInteger(LowerToInt) {}
4242
4343 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
7777 public:
7878 static char ID; // Pass identification, replacement for typeid
7979 explicit LowerInvoke(const TargetLowering *tli = NULL)
80 : FunctionPass((intptr_t)&ID), TLI(tli) { }
80 : FunctionPass(&ID), TLI(tli) { }
8181 bool doInitialization(Module &M);
8282 bool runOnFunction(Function &F);
8383
3232 class VISIBILITY_HIDDEN LowerSwitch : public FunctionPass {
3333 public:
3434 static char ID; // Pass identification, replacement for typeid
35 LowerSwitch() : FunctionPass((intptr_t) &ID) {}
35 LowerSwitch() : FunctionPass(&ID) {}
3636
3737 virtual bool runOnFunction(Function &F);
3838
2727 namespace {
2828 struct VISIBILITY_HIDDEN PromotePass : public FunctionPass {
2929 static char ID; // Pass identification, replacement for typeid
30 PromotePass() : FunctionPass((intptr_t)&ID) {}
30 PromotePass() : FunctionPass(&ID) {}
3131
3232 // runOnFunction - To run this pass, first we calculate the alloca
3333 // instructions that are safe for promotion, then we promote each one.
7272 public:
7373 static char ID;
7474 explicit BBPassManager(int Depth)
75 : PMDataManager(Depth), FunctionPass((intptr_t)&ID) {}
75 : PMDataManager(Depth), FunctionPass(&ID) {}
7676
7777 /// Execute all of the passes scheduled for execution. Keep track of
7878 /// whether any of the passes modifies the function, and if so, return true.
128128 public:
129129 static char ID;
130130 explicit FunctionPassManagerImpl(int Depth) :
131 Pass((intptr_t)&ID), PMDataManager(Depth),
131 Pass(&ID), PMDataManager(Depth),
132132 PMTopLevelManager(TLM_Function) { }
133133
134134 /// add - Add a pass to the queue of passes to run. This passes ownership of
192192 public:
193193 static char ID;
194194 explicit MPPassManager(int Depth) :
195 Pass((intptr_t)&ID), PMDataManager(Depth) { }
195 Pass(&ID), PMDataManager(Depth) { }
196196
197197 // Delete on the fly managers.
198198 virtual ~MPPassManager() {
268268 public:
269269 static char ID;
270270 explicit PassManagerImpl(int Depth) :
271 Pass((intptr_t)&ID), PMDataManager(Depth),
272 PMTopLevelManager(TLM_Pass) { }
271 Pass(&ID), PMDataManager(Depth), PMTopLevelManager(TLM_Pass) { }
273272
274273 /// add - Add a pass to the queue of passes to run. This passes ownership of
275274 /// the Pass to the PassManager. When the PassManager is destroyed, the pass
6969 struct VISIBILITY_HIDDEN PreVerifier : public FunctionPass {
7070 static char ID; // Pass ID, replacement for typeid
7171
72 PreVerifier() : FunctionPass((intptr_t)&ID) { }
72 PreVerifier() : FunctionPass(&ID) { }
7373
7474 // Check that the prerequisites for successful DominatorTree construction
7575 // are satisfied.
117117 SmallPtrSet InstsInThisBlock;
118118
119119 Verifier()
120 : FunctionPass((intptr_t)&ID),
120 : FunctionPass(&ID),
121121 Broken(false), RealPass(true), action(AbortProcessAction),
122122 DT(0), msgs( std::ios::app | std::ios::out ) {}
123123 explicit Verifier(VerifierFailureAction ctn)
124 : FunctionPass((intptr_t)&ID),
124 : FunctionPass(&ID),
125125 Broken(false), RealPass(true), action(ctn), DT(0),
126126 msgs( std::ios::app | std::ios::out ) {}
127127 explicit Verifier(bool AB)
128 : FunctionPass((intptr_t)&ID),
128 : FunctionPass(&ID),
129129 Broken(false), RealPass(true),
130130 action( AB ? AbortProcessAction : PrintMessageAction), DT(0),
131131 msgs( std::ios::app | std::ios::out ) {}
132132 explicit Verifier(DominatorTree &dt)
133 : FunctionPass((intptr_t)&ID),
133 : FunctionPass(&ID),
134134 Broken(false), RealPass(false), action(PrintMessageAction),
135135 DT(&dt), msgs( std::ios::app | std::ios::out ) {}
136136