Revert r110396 to fix buildbots.

llvm-svn: 110410
This commit is contained in:
Owen Anderson 2010-08-06 00:23:35 +00:00
parent 396e041f5e
commit bda59bd247
212 changed files with 476 additions and 480 deletions

View File

@ -22,7 +22,7 @@ template <class Analysis, bool Simple>
struct DOTGraphTraitsViewer : public FunctionPass { struct DOTGraphTraitsViewer : public FunctionPass {
std::string Name; std::string Name;
DOTGraphTraitsViewer(std::string GraphName, char &ID) : FunctionPass(ID) { DOTGraphTraitsViewer(std::string GraphName, const void *ID) : FunctionPass(ID) {
Name = GraphName; Name = GraphName;
} }
@ -48,7 +48,7 @@ struct DOTGraphTraitsPrinter : public FunctionPass {
std::string Name; std::string Name;
DOTGraphTraitsPrinter(std::string GraphName, char &ID) DOTGraphTraitsPrinter(std::string GraphName, const void *ID)
: FunctionPass(ID) { : FunctionPass(ID) {
Name = GraphName; Name = GraphName;
} }

View File

@ -702,7 +702,7 @@ public:
static char ID; // Pass ID, replacement for typeid static char ID; // Pass ID, replacement for typeid
DominatorTreeBase<BasicBlock>* DT; DominatorTreeBase<BasicBlock>* DT;
DominatorTree() : FunctionPass(ID) { DominatorTree() : FunctionPass(&ID) {
DT = new DominatorTreeBase<BasicBlock>(false); DT = new DominatorTreeBase<BasicBlock>(false);
} }
@ -890,7 +890,7 @@ protected:
const bool IsPostDominators; const bool IsPostDominators;
public: public:
DominanceFrontierBase(char &ID, bool isPostDom) DominanceFrontierBase(void *ID, bool isPostDom)
: FunctionPass(ID), IsPostDominators(isPostDom) {} : FunctionPass(ID), IsPostDominators(isPostDom) {}
/// getRoots - Return the root blocks of the current CFG. This may include /// getRoots - Return the root blocks of the current CFG. This may include
@ -1009,7 +1009,7 @@ class DominanceFrontier : public DominanceFrontierBase {
public: public:
static char ID; // Pass ID, replacement for typeid static char ID; // Pass ID, replacement for typeid
DominanceFrontier() : DominanceFrontier() :
DominanceFrontierBase(ID, false) {} DominanceFrontierBase(&ID, false) {}
BasicBlock *getRoot() const { BasicBlock *getRoot() const {
assert(Roots.size() == 1 && "Should always have entry node!"); assert(Roots.size() == 1 && "Should always have entry node!");

View File

@ -26,7 +26,7 @@ class FindUsedTypes : public ModulePass {
std::set<const Type *> UsedTypes; std::set<const Type *> UsedTypes;
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
FindUsedTypes() : ModulePass(ID) {} FindUsedTypes() : ModulePass(&ID) {}
/// getTypes - After the pass has been run, return the set containing all of /// getTypes - After the pass has been run, return the set containing all of
/// the types used in the module. /// the types used in the module.

View File

@ -48,7 +48,7 @@ class IntervalPartition : public FunctionPass {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
IntervalPartition() : FunctionPass(ID), RootInterval(0) {} IntervalPartition() : FunctionPass(&ID), RootInterval(0) {}
// run - Calculate the interval partition for this function // run - Calculate the interval partition for this function
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);

View File

@ -31,7 +31,7 @@ class LazyValueInfo : public FunctionPass {
void operator=(const LazyValueInfo&); // DO NOT IMPLEMENT. void operator=(const LazyValueInfo&); // DO NOT IMPLEMENT.
public: public:
static char ID; static char ID;
LazyValueInfo() : FunctionPass(ID), PImpl(0) {} LazyValueInfo() : FunctionPass(&ID), PImpl(0) {}
~LazyValueInfo() { assert(PImpl == 0 && "releaseMemory not called"); } ~LazyValueInfo() { assert(PImpl == 0 && "releaseMemory not called"); }
/// Tristate - This is used to return true/false/dunno results. /// Tristate - This is used to return true/false/dunno results.

View File

@ -28,9 +28,9 @@ namespace llvm {
LibCallInfo *LCI; LibCallInfo *LCI;
explicit LibCallAliasAnalysis(LibCallInfo *LC = 0) explicit LibCallAliasAnalysis(LibCallInfo *LC = 0)
: FunctionPass(ID), LCI(LC) { : FunctionPass(&ID), LCI(LC) {
} }
explicit LibCallAliasAnalysis(char &ID, LibCallInfo *LC) explicit LibCallAliasAnalysis(const void *ID, LibCallInfo *LC)
: FunctionPass(ID), LCI(LC) { : FunctionPass(ID), LCI(LC) {
} }
~LibCallAliasAnalysis(); ~LibCallAliasAnalysis();
@ -55,8 +55,8 @@ namespace llvm {
/// an analysis interface through multiple inheritance. If needed, it /// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the /// should override this to adjust the this pointer as needed for the
/// specified pass info. /// specified pass info.
virtual void *getAdjustedAnalysisPointer(const void *PI) { virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
if (PI == &AliasAnalysis::ID) if (PI->isPassID(&AliasAnalysis::ID))
return (AliasAnalysis*)this; return (AliasAnalysis*)this;
return this; return this;
} }

View File

@ -91,7 +91,7 @@ class LoopDependenceAnalysis : public LoopPass {
public: public:
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
LoopDependenceAnalysis() : LoopPass(ID) {} LoopDependenceAnalysis() : LoopPass(&ID) {}
/// isDependencePair - Check whether two values can possibly give rise to /// isDependencePair - Check whether two values can possibly give rise to
/// a data dependence: that is the case if both are instructions accessing /// a data dependence: that is the case if both are instructions accessing

View File

@ -940,7 +940,7 @@ class LoopInfo : public FunctionPass {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
LoopInfo() : FunctionPass(ID) {} LoopInfo() : FunctionPass(&ID) {}
LoopInfoBase<BasicBlock, Loop>& getBase() { return LI; } LoopInfoBase<BasicBlock, Loop>& getBase() { return LI; }

View File

@ -28,7 +28,8 @@ class PMStack;
class LoopPass : public Pass { class LoopPass : public Pass {
public: public:
explicit LoopPass(char &pid) : Pass(PT_Loop, pid) {} explicit LoopPass(intptr_t pid) : Pass(PT_Loop, pid) {}
explicit LoopPass(void *pid) : Pass(PT_Loop, pid) {}
/// getPrinterPass - Get a pass to print the function corresponding /// getPrinterPass - Get a pass to print the function corresponding
/// to a Loop. /// to a Loop.

View File

@ -92,7 +92,7 @@ namespace llvm {
// file. // file.
// //
ModulePass *createProfileLoaderPass(); ModulePass *createProfileLoaderPass();
extern char &ProfileLoaderPassID; extern const PassInfo *ProfileLoaderPassID;
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
// //
@ -106,7 +106,7 @@ namespace llvm {
// instead of loading it from a previous run. // instead of loading it from a previous run.
// //
FunctionPass *createProfileEstimatorPass(); FunctionPass *createProfileEstimatorPass();
extern char &ProfileEstimatorPassID; extern const PassInfo *ProfileEstimatorPassID;
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
// //

View File

@ -25,7 +25,7 @@ struct PostDominatorTree : public FunctionPass {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
DominatorTreeBase<BasicBlock>* DT; DominatorTreeBase<BasicBlock>* DT;
PostDominatorTree() : FunctionPass(ID) { PostDominatorTree() : FunctionPass(&ID) {
DT = new DominatorTreeBase<BasicBlock>(true); DT = new DominatorTreeBase<BasicBlock>(true);
} }
@ -106,7 +106,7 @@ template <> struct GraphTraits<PostDominatorTree*>
struct PostDominanceFrontier : public DominanceFrontierBase { struct PostDominanceFrontier : public DominanceFrontierBase {
static char ID; static char ID;
PostDominanceFrontier() PostDominanceFrontier()
: DominanceFrontierBase(ID, true) {} : DominanceFrontierBase(&ID, true) {}
virtual bool runOnFunction(Function &) { virtual bool runOnFunction(Function &) {
Frontiers.clear(); Frontiers.clear();

View File

@ -33,7 +33,8 @@ class CallGraphSCC;
class CallGraphSCCPass : public Pass { class CallGraphSCCPass : public Pass {
public: public:
explicit CallGraphSCCPass(char &pid) : Pass(PT_CallGraphSCC, pid) {} explicit CallGraphSCCPass(intptr_t pid) : Pass(PT_CallGraphSCC, pid) {}
explicit CallGraphSCCPass(void *pid) : Pass(PT_CallGraphSCC, pid) {}
/// createPrinterPass - Get a pass that prints the Module /// createPrinterPass - Get a pass that prints the Module
/// corresponding to a CallGraph. /// corresponding to a CallGraph.

View File

@ -23,7 +23,7 @@ namespace llvm {
public: public:
static char ID; static char ID;
CalculateSpillWeights() : MachineFunctionPass(ID) {} CalculateSpillWeights() : MachineFunctionPass(&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &au) const; virtual void getAnalysisUsage(AnalysisUsage &au) const;

View File

@ -68,7 +68,7 @@ namespace llvm {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
LiveIntervals() : MachineFunctionPass(ID) {} LiveIntervals() : MachineFunctionPass(&ID) {}
// Calculate the spill weight to assign to a single instruction. // Calculate the spill weight to assign to a single instruction.
static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth); static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth);

View File

@ -39,7 +39,7 @@ namespace llvm {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
LiveStacks() : MachineFunctionPass(ID) {} LiveStacks() : MachineFunctionPass(&ID) {}
typedef SS2IntervalMap::iterator iterator; typedef SS2IntervalMap::iterator iterator;
typedef SS2IntervalMap::const_iterator const_iterator; typedef SS2IntervalMap::const_iterator const_iterator;

View File

@ -46,7 +46,7 @@ class TargetRegisterInfo;
class LiveVariables : public MachineFunctionPass { class LiveVariables : public MachineFunctionPass {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
LiveVariables() : MachineFunctionPass(ID) {} LiveVariables() : MachineFunctionPass(&ID) {}
/// VarInfo - This represents the regions where a virtual register is live in /// VarInfo - This represents the regions where a virtual register is live in
/// the program. We represent this with three different pieces of /// the program. We represent this with three different pieces of

View File

@ -31,7 +31,8 @@ class MachineFunction;
/// override runOnMachineFunction. /// override runOnMachineFunction.
class MachineFunctionPass : public FunctionPass { class MachineFunctionPass : public FunctionPass {
protected: protected:
explicit MachineFunctionPass(char &ID) : FunctionPass(ID) {} explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {}
explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {}
/// runOnMachineFunction - This method must be overloaded to perform the /// runOnMachineFunction - This method must be overloaded to perform the
/// desired machine code transformation or analysis. /// desired machine code transformation or analysis.

View File

@ -67,7 +67,7 @@ class MachineLoopInfo : public MachineFunctionPass {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
MachineLoopInfo() : MachineFunctionPass(ID) {} MachineLoopInfo() : MachineFunctionPass(&ID) {}
LoopInfoBase<MachineBasicBlock, MachineLoop>& getBase() { return LI; } LoopInfoBase<MachineBasicBlock, MachineLoop>& getBase() { return LI; }

View File

@ -43,18 +43,18 @@ namespace llvm {
/// MachineLoopInfo pass - This pass is a loop analysis pass. /// MachineLoopInfo pass - This pass is a loop analysis pass.
/// ///
extern char &MachineLoopInfoID; extern const PassInfo *const MachineLoopInfoID;
/// MachineDominators pass - This pass is a machine dominators analysis pass. /// MachineDominators pass - This pass is a machine dominators analysis pass.
/// ///
extern char &MachineDominatorsID; extern const PassInfo *const MachineDominatorsID;
/// PHIElimination pass - This pass eliminates machine instruction PHI nodes /// PHIElimination pass - This pass eliminates machine instruction PHI nodes
/// by inserting copy instructions. This destroys SSA information, but is the /// by inserting copy instructions. This destroys SSA information, but is the
/// desired input for some register allocators. This pass is "required" by /// desired input for some register allocators. This pass is "required" by
/// these register allocator like this: AU.addRequiredID(PHIEliminationID); /// these register allocator like this: AU.addRequiredID(PHIEliminationID);
/// ///
extern char &PHIEliminationID; extern const PassInfo *const PHIEliminationID;
/// StrongPHIElimination pass - This pass eliminates machine instruction PHI /// StrongPHIElimination pass - This pass eliminates machine instruction PHI
/// nodes by inserting copy instructions. This destroys SSA information, but /// nodes by inserting copy instructions. This destroys SSA information, but
@ -62,23 +62,23 @@ namespace llvm {
/// "required" by these register allocator like this: /// "required" by these register allocator like this:
/// AU.addRequiredID(PHIEliminationID); /// AU.addRequiredID(PHIEliminationID);
/// This pass is still in development /// This pass is still in development
extern char &StrongPHIEliminationID; extern const PassInfo *const StrongPHIEliminationID;
extern char &PreAllocSplittingID; extern const PassInfo *const PreAllocSplittingID;
/// SimpleRegisterCoalescing pass. Aggressively coalesces every register /// SimpleRegisterCoalescing pass. Aggressively coalesces every register
/// copy it can. /// copy it can.
/// ///
extern char &SimpleRegisterCoalescingID; extern const PassInfo *const SimpleRegisterCoalescingID;
/// TwoAddressInstruction pass - This pass reduces two-address instructions to /// TwoAddressInstruction pass - This pass reduces two-address instructions to
/// use two operands. This destroys SSA information but it is desired by /// use two operands. This destroys SSA information but it is desired by
/// register allocators. /// register allocators.
extern char &TwoAddressInstructionPassID; extern const PassInfo *const TwoAddressInstructionPassID;
/// UnreachableMachineBlockElimination pass - This pass removes unreachable /// UnreachableMachineBlockElimination pass - This pass removes unreachable
/// machine basic blocks. /// machine basic blocks.
extern char &UnreachableMachineBlockElimID; extern const PassInfo *const UnreachableMachineBlockElimID;
/// DeadMachineInstructionElim pass - This pass removes dead machine /// DeadMachineInstructionElim pass - This pass removes dead machine
/// instructions. /// instructions.

View File

@ -31,7 +31,7 @@ namespace llvm {
public: public:
static char ID; static char ID;
ProcessImplicitDefs() : MachineFunctionPass(ID) {} ProcessImplicitDefs() : MachineFunctionPass(&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &au) const; virtual void getAnalysisUsage(AnalysisUsage &au) const;

View File

@ -475,7 +475,7 @@ namespace llvm {
public: public:
static char ID; static char ID;
SlotIndexes() : MachineFunctionPass(ID), indexListHead(0) {} SlotIndexes() : MachineFunctionPass(&ID), indexListHead(0) {}
virtual void getAnalysisUsage(AnalysisUsage &au) const; virtual void getAnalysisUsage(AnalysisUsage &au) const;
virtual void releaseMemory(); virtual void releaseMemory();

View File

@ -50,7 +50,7 @@ class raw_ostream;
class StringRef; class StringRef;
// AnalysisID - Use the PassInfo to identify a pass... // AnalysisID - Use the PassInfo to identify a pass...
typedef const void* AnalysisID; typedef const PassInfo* AnalysisID;
/// Different types of internal pass managers. External pass managers /// Different types of internal pass managers. External pass managers
/// (PassManager and FunctionPassManager) are not represented here. /// (PassManager and FunctionPassManager) are not represented here.
@ -82,13 +82,14 @@ enum PassKind {
/// ///
class Pass { class Pass {
AnalysisResolver *Resolver; // Used to resolve analysis AnalysisResolver *Resolver; // Used to resolve analysis
const void *PassID; intptr_t PassID;
PassKind Kind; PassKind Kind;
void operator=(const Pass&); // DO NOT IMPLEMENT void operator=(const Pass&); // DO NOT IMPLEMENT
Pass(const Pass &); // DO NOT IMPLEMENT Pass(const Pass &); // DO NOT IMPLEMENT
public: public:
explicit Pass(PassKind K, char &pid); explicit Pass(PassKind K, intptr_t pid);
explicit Pass(PassKind K, const void *pid);
virtual ~Pass(); virtual ~Pass();
@ -100,10 +101,10 @@ public:
/// ///
virtual const char *getPassName() const; virtual const char *getPassName() const;
/// getPassID - Return the PassID number that corresponds to this pass. /// getPassInfo - Return the PassInfo data structure that corresponds to this
virtual AnalysisID getPassID() const { /// pass... If the pass has not been registered, this will return null.
return PassID; ///
} const PassInfo *getPassInfo() const;
/// print - Print out the internal state of the pass. This is called by /// print - Print out the internal state of the pass. This is called by
/// Analyze to print out the contents of an analysis. Otherwise it is not /// Analyze to print out the contents of an analysis. Otherwise it is not
@ -158,7 +159,7 @@ public:
/// an analysis interface through multiple inheritance. If needed, it should /// an analysis interface through multiple inheritance. If needed, it should
/// override this to adjust the this pointer as needed for the specified pass /// override this to adjust the this pointer as needed for the specified pass
/// info. /// info.
virtual void *getAdjustedAnalysisPointer(AnalysisID ID); virtual void *getAdjustedAnalysisPointer(const PassInfo *);
virtual ImmutablePass *getAsImmutablePass(); virtual ImmutablePass *getAsImmutablePass();
virtual PMDataManager *getAsPMDataManager(); virtual PMDataManager *getAsPMDataManager();
@ -169,9 +170,14 @@ public:
// dumpPassStructure - Implement the -debug-passes=PassStructure option // dumpPassStructure - Implement the -debug-passes=PassStructure option
virtual void dumpPassStructure(unsigned Offset = 0); virtual void dumpPassStructure(unsigned Offset = 0);
template<typename AnalysisClass>
static const PassInfo *getClassPassInfo() {
return lookupPassInfo(intptr_t(&AnalysisClass::ID));
}
// lookupPassInfo - Return the pass info object for the specified pass class, // lookupPassInfo - Return the pass info object for the specified pass class,
// or null if it is not known. // or null if it is not known.
static const PassInfo *lookupPassInfo(const void *TI); static const PassInfo *lookupPassInfo(intptr_t TI);
// lookupPassInfo - Return the pass info object for the pass with the given // lookupPassInfo - Return the pass info object for the pass with the given
// argument string, or null if it is not known. // argument string, or null if it is not known.
@ -194,7 +200,7 @@ public:
/// don't have the class name available (use getAnalysisIfAvailable if you /// don't have the class name available (use getAnalysisIfAvailable if you
/// do), but it can tell you if you need to preserve the pass at least. /// do), but it can tell you if you need to preserve the pass at least.
/// ///
bool mustPreserveAnalysisID(char &AID) const; bool mustPreserveAnalysisID(const PassInfo *AnalysisID) const;
/// getAnalysis<AnalysisType>() - This function is used by subclasses to get /// getAnalysis<AnalysisType>() - This function is used by subclasses to get
/// to the analysis information that they claim to use by overriding the /// to the analysis information that they claim to use by overriding the
@ -207,10 +213,10 @@ public:
AnalysisType &getAnalysis(Function &F); // Defined in PassAnalysisSupport.h AnalysisType &getAnalysis(Function &F); // Defined in PassAnalysisSupport.h
template<typename AnalysisType> template<typename AnalysisType>
AnalysisType &getAnalysisID(AnalysisID PI) const; AnalysisType &getAnalysisID(const PassInfo *PI) const;
template<typename AnalysisType> template<typename AnalysisType>
AnalysisType &getAnalysisID(AnalysisID PI, Function &F); AnalysisType &getAnalysisID(const PassInfo *PI, Function &F);
}; };
@ -234,7 +240,8 @@ public:
/// Return what kind of Pass Manager can manage this pass. /// Return what kind of Pass Manager can manage this pass.
virtual PassManagerType getPotentialPassManagerType() const; virtual PassManagerType getPotentialPassManagerType() const;
explicit ModulePass(char &pid) : Pass(PT_Module, pid) {} explicit ModulePass(intptr_t pid) : Pass(PT_Module, pid) {}
explicit ModulePass(const void *pid) : Pass(PT_Module, pid) {}
// Force out-of-line virtual method. // Force out-of-line virtual method.
virtual ~ModulePass(); virtual ~ModulePass();
}; };
@ -261,7 +268,8 @@ public:
/// ///
bool runOnModule(Module &) { return false; } bool runOnModule(Module &) { return false; }
explicit ImmutablePass(char &pid) explicit ImmutablePass(intptr_t pid) : ModulePass(pid) {}
explicit ImmutablePass(const void *pid)
: ModulePass(pid) {} : ModulePass(pid) {}
// Force out-of-line virtual method. // Force out-of-line virtual method.
@ -279,7 +287,8 @@ public:
/// ///
class FunctionPass : public Pass { class FunctionPass : public Pass {
public: public:
explicit FunctionPass(char &pid) : Pass(PT_Function, pid) {} explicit FunctionPass(intptr_t pid) : Pass(PT_Function, pid) {}
explicit FunctionPass(const void *pid) : Pass(PT_Function, pid) {}
/// createPrinterPass - Get a function printer pass. /// createPrinterPass - Get a function printer pass.
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const; Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
@ -331,7 +340,8 @@ public:
/// ///
class BasicBlockPass : public Pass { class BasicBlockPass : public Pass {
public: public:
explicit BasicBlockPass(char &pid) : Pass(PT_BasicBlock, pid) {} explicit BasicBlockPass(intptr_t pid) : Pass(PT_BasicBlock, pid) {}
explicit BasicBlockPass(const void *pid) : Pass(PT_BasicBlock, pid) {}
/// createPrinterPass - Get a function printer pass. /// createPrinterPass - Get a function printer pass.
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const; Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;

View File

@ -49,37 +49,34 @@ public:
// addRequired - Add the specified ID to the required set of the usage info // addRequired - Add the specified ID to the required set of the usage info
// for a pass. // for a pass.
// //
AnalysisUsage &addRequiredID(const void *ID); AnalysisUsage &addRequiredID(AnalysisID ID);
AnalysisUsage &addRequiredID(char &ID);
template<class PassClass> template<class PassClass>
AnalysisUsage &addRequired() { AnalysisUsage &addRequired() {
return addRequiredID(PassClass::ID); return addRequiredID(Pass::getClassPassInfo<PassClass>());
} }
AnalysisUsage &addRequiredTransitiveID(char &ID); AnalysisUsage &addRequiredTransitiveID(AnalysisID ID);
template<class PassClass> template<class PassClass>
AnalysisUsage &addRequiredTransitive() { AnalysisUsage &addRequiredTransitive() {
return addRequiredTransitiveID(PassClass::ID); AnalysisID ID = Pass::getClassPassInfo<PassClass>();
return addRequiredTransitiveID(ID);
} }
// addPreserved - Add the specified ID to the set of analyses preserved by // addPreserved - Add the specified ID to the set of analyses preserved by
// this pass // this pass
// //
AnalysisUsage &addPreservedID(const void *ID) { AnalysisUsage &addPreservedID(AnalysisID ID) {
Preserved.push_back(ID); Preserved.push_back(ID);
return *this; return *this;
} }
AnalysisUsage &addPreservedID(char &ID) {
Preserved.push_back(&ID);
return *this;
}
// addPreserved - Add the specified Pass class to the set of analyses // addPreserved - Add the specified Pass class to the set of analyses
// preserved by this pass. // preserved by this pass.
// //
template<class PassClass> template<class PassClass>
AnalysisUsage &addPreserved() { AnalysisUsage &addPreserved() {
Preserved.push_back(&PassClass::ID); assert(Pass::getClassPassInfo<PassClass>() && "Pass class not registered!");
Preserved.push_back(Pass::getClassPassInfo<PassClass>());
return *this; return *this;
} }
@ -88,7 +85,12 @@ public:
// This can be useful when a pass is trivially preserved, but may not be // This can be useful when a pass is trivially preserved, but may not be
// linked in. Be careful about spelling! // linked in. Be careful about spelling!
// //
AnalysisUsage &addPreserved(StringRef Arg); AnalysisUsage &addPreserved(StringRef Arg) {
const PassInfo *PI = Pass::lookupPassInfo(Arg);
// If the pass exists, preserve it. Otherwise silently do nothing.
if (PI) Preserved.push_back(PI);
return *this;
}
// setPreservesAll - Set by analyses that do not transform their input at all // setPreservesAll - Set by analyses that do not transform their input at all
void setPreservesAll() { PreservesAll = true; } void setPreservesAll() { PreservesAll = true; }
@ -128,7 +130,7 @@ public:
inline PMDataManager &getPMDataManager() { return PM; } inline PMDataManager &getPMDataManager() { return PM; }
// Find pass that is implementing PI. // Find pass that is implementing PI.
Pass *findImplPass(AnalysisID PI) { Pass *findImplPass(const PassInfo *PI) {
Pass *ResultPass = 0; Pass *ResultPass = 0;
for (unsigned i = 0; i < AnalysisImpls.size() ; ++i) { for (unsigned i = 0; i < AnalysisImpls.size() ; ++i) {
if (AnalysisImpls[i].first == PI) { if (AnalysisImpls[i].first == PI) {
@ -140,10 +142,10 @@ public:
} }
// Find pass that is implementing PI. Initialize pass for Function F. // Find pass that is implementing PI. Initialize pass for Function F.
Pass *findImplPass(Pass *P, AnalysisID PI, Function &F); Pass *findImplPass(Pass *P, const PassInfo *PI, Function &F);
void addAnalysisImplsPair(AnalysisID PI, Pass *P) { void addAnalysisImplsPair(const PassInfo *PI, Pass *P) {
std::pair<AnalysisID, Pass*> pir = std::make_pair(PI,P); std::pair<const PassInfo*, Pass*> pir = std::make_pair(PI,P);
AnalysisImpls.push_back(pir); AnalysisImpls.push_back(pir);
} }
@ -158,7 +160,7 @@ public:
// AnalysisImpls - This keeps track of which passes implements the interfaces // AnalysisImpls - This keeps track of which passes implements the interfaces
// that are required by the current pass (to implement getAnalysis()). // that are required by the current pass (to implement getAnalysis()).
std::vector<std::pair<AnalysisID, Pass*> > AnalysisImpls; std::vector<std::pair<const PassInfo*, Pass*> > AnalysisImpls;
private: private:
// PassManager that is used to resolve analysis info // PassManager that is used to resolve analysis info
@ -177,7 +179,8 @@ template<typename AnalysisType>
AnalysisType *Pass::getAnalysisIfAvailable() const { AnalysisType *Pass::getAnalysisIfAvailable() const {
assert(Resolver && "Pass not resident in a PassManager object!"); assert(Resolver && "Pass not resident in a PassManager object!");
const void *PI = &AnalysisType::ID; const PassInfo *PI = getClassPassInfo<AnalysisType>();
if (PI == 0) return 0;
Pass *ResultPass = Resolver->getAnalysisIfAvailable(PI, true); Pass *ResultPass = Resolver->getAnalysisIfAvailable(PI, true);
if (ResultPass == 0) return 0; if (ResultPass == 0) return 0;
@ -196,11 +199,11 @@ AnalysisType *Pass::getAnalysisIfAvailable() const {
template<typename AnalysisType> template<typename AnalysisType>
AnalysisType &Pass::getAnalysis() const { AnalysisType &Pass::getAnalysis() const {
assert(Resolver && "Pass has not been inserted into a PassManager object!"); assert(Resolver && "Pass has not been inserted into a PassManager object!");
return getAnalysisID<AnalysisType>(&AnalysisType::ID); return getAnalysisID<AnalysisType>(getClassPassInfo<AnalysisType>());
} }
template<typename AnalysisType> template<typename AnalysisType>
AnalysisType &Pass::getAnalysisID(AnalysisID PI) const { AnalysisType &Pass::getAnalysisID(const PassInfo *PI) const {
assert(PI && "getAnalysis for unregistered pass!"); assert(PI && "getAnalysis for unregistered pass!");
assert(Resolver&&"Pass has not been inserted into a PassManager object!"); assert(Resolver&&"Pass has not been inserted into a PassManager object!");
// PI *must* appear in AnalysisImpls. Because the number of passes used // PI *must* appear in AnalysisImpls. Because the number of passes used
@ -226,11 +229,11 @@ template<typename AnalysisType>
AnalysisType &Pass::getAnalysis(Function &F) { AnalysisType &Pass::getAnalysis(Function &F) {
assert(Resolver &&"Pass has not been inserted into a PassManager object!"); assert(Resolver &&"Pass has not been inserted into a PassManager object!");
return getAnalysisID<AnalysisType>(&AnalysisType::ID, F); return getAnalysisID<AnalysisType>(getClassPassInfo<AnalysisType>(), F);
} }
template<typename AnalysisType> template<typename AnalysisType>
AnalysisType &Pass::getAnalysisID(AnalysisID PI, Function &F) { AnalysisType &Pass::getAnalysisID(const PassInfo *PI, Function &F) {
assert(PI && "getAnalysis for unregistered pass!"); assert(PI && "getAnalysis for unregistered pass!");
assert(Resolver && "Pass has not been inserted into a PassManager object!"); assert(Resolver && "Pass has not been inserted into a PassManager object!");
// PI *must* appear in AnalysisImpls. Because the number of passes used // PI *must* appear in AnalysisImpls. Because the number of passes used

View File

@ -302,7 +302,7 @@ public:
/// through getAnalysis interface. /// through getAnalysis interface.
virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass); virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass);
virtual Pass *getOnTheFlyPass(Pass *P, AnalysisID PI, Function &F); virtual Pass *getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F);
/// Initialize available analysis information. /// Initialize available analysis information.
void initializeAnalysisInfo() { void initializeAnalysisInfo() {
@ -414,7 +414,7 @@ class FPPassManager : public ModulePass, public PMDataManager {
public: public:
static char ID; static char ID;
explicit FPPassManager(int Depth) explicit FPPassManager(int Depth)
: ModulePass(ID), PMDataManager(Depth) { } : ModulePass(&ID), PMDataManager(Depth) { }
/// run - Execute all of the passes scheduled for execution. Keep track of /// run - Execute all of the passes scheduled for execution. Keep track of
/// whether any of the passes modifies the module, and if so, return true. /// whether any of the passes modifies the module, and if so, return true.

View File

@ -34,7 +34,7 @@ class PassRegistry {
mutable sys::SmartMutex<true> Lock; mutable sys::SmartMutex<true> Lock;
/// PassInfoMap - Keep track of the PassInfo object for each registered pass. /// PassInfoMap - Keep track of the PassInfo object for each registered pass.
typedef std::map<const void*, const PassInfo*> MapType; typedef std::map<intptr_t, const PassInfo*> MapType;
MapType PassInfoMap; MapType PassInfoMap;
typedef StringMap<const PassInfo*> StringMapType; typedef StringMap<const PassInfo*> StringMapType;
@ -51,14 +51,14 @@ class PassRegistry {
public: public:
static PassRegistry *getPassRegistry(); static PassRegistry *getPassRegistry();
const PassInfo *getPassInfo(const void *TI) const; const PassInfo *getPassInfo(intptr_t TI) const;
const PassInfo *getPassInfo(StringRef Arg) const; const PassInfo *getPassInfo(StringRef Arg) const;
void registerPass(const PassInfo &PI); void registerPass(const PassInfo &PI);
void unregisterPass(const PassInfo &PI); void unregisterPass(const PassInfo &PI);
/// Analysis Group Mechanisms. /// Analysis Group Mechanisms.
void registerAnalysisGroup(const void *InterfaceID, const void *PassID, void registerAnalysisGroup(intptr_t InterfaceID, intptr_t PassID,
PassInfo& Registeree, bool isDefault); PassInfo& Registeree, bool isDefault);
void enumerateWith(PassRegistrationListener *L); void enumerateWith(PassRegistrationListener *L);

View File

@ -41,7 +41,7 @@ public:
private: private:
const char *const PassName; // Nice name for Pass const char *const PassName; // Nice name for Pass
const char *const PassArgument; // Command Line argument to run this pass const char *const PassArgument; // Command Line argument to run this pass
const void *PassID; const intptr_t PassID;
const bool IsCFGOnlyPass; // Pass only looks at the CFG. const bool IsCFGOnlyPass; // Pass only looks at the CFG.
const bool IsAnalysis; // True if an analysis pass. const bool IsAnalysis; // True if an analysis pass.
const bool IsAnalysisGroup; // True if an analysis group. const bool IsAnalysisGroup; // True if an analysis group.
@ -52,7 +52,7 @@ private:
public: public:
/// PassInfo ctor - Do not call this directly, this should only be invoked /// PassInfo ctor - Do not call this directly, this should only be invoked
/// through RegisterPass. /// through RegisterPass.
PassInfo(const char *name, const char *arg, const void *pi, PassInfo(const char *name, const char *arg, intptr_t pi,
NormalCtor_t normal = 0, NormalCtor_t normal = 0,
bool isCFGOnly = false, bool is_analysis = false) bool isCFGOnly = false, bool is_analysis = false)
: PassName(name), PassArgument(arg), PassID(pi), : PassName(name), PassArgument(arg), PassID(pi),
@ -63,7 +63,7 @@ public:
/// PassInfo ctor - Do not call this directly, this should only be invoked /// PassInfo ctor - Do not call this directly, this should only be invoked
/// through RegisterPass. This version is for use by analysis groups; it /// through RegisterPass. This version is for use by analysis groups; it
/// does not auto-register the pass. /// does not auto-register the pass.
PassInfo(const char *name, const void *pi) PassInfo(const char *name, intptr_t pi)
: PassName(name), PassArgument(""), PassID(pi), : PassName(name), PassArgument(""), PassID(pi),
IsCFGOnlyPass(false), IsCFGOnlyPass(false),
IsAnalysis(false), IsAnalysisGroup(true), NormalCtor(0) { IsAnalysis(false), IsAnalysisGroup(true), NormalCtor(0) {
@ -81,11 +81,11 @@ public:
/// getTypeInfo - Return the id object for the pass... /// getTypeInfo - Return the id object for the pass...
/// TODO : Rename /// TODO : Rename
const void *getTypeInfo() const { return PassID; } intptr_t getTypeInfo() const { return PassID; }
/// Return true if this PassID implements the specified ID pointer. /// Return true if this PassID implements the specified ID pointer.
bool isPassID(const void *IDPtr) const { bool isPassID(void *IDPtr) const {
return PassID == IDPtr; return PassID == (intptr_t)IDPtr;
} }
/// isAnalysisGroup - Return true if this is an analysis group, not a normal /// isAnalysisGroup - Return true if this is an analysis group, not a normal
@ -161,7 +161,7 @@ struct RegisterPass : public PassInfo {
// Register Pass using default constructor... // Register Pass using default constructor...
RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false, RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false,
bool is_analysis = false) bool is_analysis = false)
: PassInfo(Name, PassArg, &passName::ID, : PassInfo(Name, PassArg, intptr_t(&passName::ID),
PassInfo::NormalCtor_t(callDefaultCtor<passName>), PassInfo::NormalCtor_t(callDefaultCtor<passName>),
CFGOnly, is_analysis) { CFGOnly, is_analysis) {
@ -191,8 +191,8 @@ struct RegisterPass : public PassInfo {
class RegisterAGBase : public PassInfo { class RegisterAGBase : public PassInfo {
protected: protected:
RegisterAGBase(const char *Name, RegisterAGBase(const char *Name,
const void *InterfaceID, intptr_t InterfaceID,
const void *PassID = 0, intptr_t PassID = 0,
bool isDefault = false); bool isDefault = false);
}; };
@ -200,12 +200,12 @@ template<typename Interface, bool Default = false>
struct RegisterAnalysisGroup : public RegisterAGBase { struct RegisterAnalysisGroup : public RegisterAGBase {
explicit RegisterAnalysisGroup(PassInfo &RPB) explicit RegisterAnalysisGroup(PassInfo &RPB)
: RegisterAGBase(RPB.getPassName(), : RegisterAGBase(RPB.getPassName(),
&Interface::ID, RPB.getTypeInfo(), intptr_t(&Interface::ID), RPB.getTypeInfo(),
Default) { Default) {
} }
explicit RegisterAnalysisGroup(const char *Name) explicit RegisterAnalysisGroup(const char *Name)
: RegisterAGBase(Name, &Interface::ID) { : RegisterAGBase(Name, intptr_t(&Interface::ID)) {
} }
}; };

View File

@ -110,7 +110,7 @@ public:
/// Constructs a TargetData from a specification string. See init(). /// Constructs a TargetData from a specification string. See init().
explicit TargetData(StringRef TargetDescription) explicit TargetData(StringRef TargetDescription)
: ImmutablePass(ID) { : ImmutablePass(&ID) {
init(TargetDescription); init(TargetDescription);
} }
@ -118,7 +118,7 @@ public:
explicit TargetData(const Module *M); explicit TargetData(const Module *M);
TargetData(const TargetData &TD) : TargetData(const TargetData &TD) :
ImmutablePass(ID), ImmutablePass(&ID),
LittleEndian(TD.isLittleEndian()), LittleEndian(TD.isLittleEndian()),
PointerMemSize(TD.PointerMemSize), PointerMemSize(TD.PointerMemSize),
PointerABIAlign(TD.PointerABIAlign), PointerABIAlign(TD.PointerABIAlign),

View File

@ -30,8 +30,8 @@ namespace llvm {
/// perform the inlining operations that do not depend on the policy. /// perform the inlining operations that do not depend on the policy.
/// ///
struct Inliner : public CallGraphSCCPass { struct Inliner : public CallGraphSCCPass {
explicit Inliner(char &ID); explicit Inliner(void *ID);
explicit Inliner(char &ID, int Threshold); explicit Inliner(void *ID, int Threshold);
/// getAnalysisUsage - For this class, we declare that we require and preserve /// getAnalysisUsage - For this class, we declare that we require and preserve
/// the call graph. If the derived class implements this method, it should /// the call graph. If the derived class implements this method, it should

View File

@ -149,7 +149,7 @@ Pass *createLoopIndexSplitPass();
// ret i32 %Y // ret i32 %Y
// //
FunctionPass *createPromoteMemoryToRegisterPass(); FunctionPass *createPromoteMemoryToRegisterPass();
extern char &PromoteMemoryToRegisterID; extern const PassInfo *const PromoteMemoryToRegisterID;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
@ -158,7 +158,7 @@ extern char &PromoteMemoryToRegisterID;
// hacking easier. // hacking easier.
// //
FunctionPass *createDemoteRegisterToMemoryPass(); FunctionPass *createDemoteRegisterToMemoryPass();
extern char &DemoteRegisterToMemoryID; extern const PassInfo *const DemoteRegisterToMemoryID;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
@ -202,7 +202,7 @@ FunctionPass *createCFGSimplificationPass();
// (set, immediate dominators, tree, and frontier) information. // (set, immediate dominators, tree, and frontier) information.
// //
FunctionPass *createBreakCriticalEdgesPass(); FunctionPass *createBreakCriticalEdgesPass();
extern char &BreakCriticalEdgesID; extern const PassInfo *const BreakCriticalEdgesID;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
@ -213,7 +213,7 @@ extern char &BreakCriticalEdgesID;
// AU.addRequiredID(LoopSimplifyID); // AU.addRequiredID(LoopSimplifyID);
// //
Pass *createLoopSimplifyPass(); Pass *createLoopSimplifyPass();
extern char &LoopSimplifyID; extern const PassInfo *const LoopSimplifyID;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
@ -228,7 +228,7 @@ FunctionPass *createTailCallEliminationPass();
// chained binary branch instructions. // chained binary branch instructions.
// //
FunctionPass *createLowerSwitchPass(); FunctionPass *createLowerSwitchPass();
extern char &LowerSwitchID; extern const PassInfo *const LowerSwitchID;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
@ -243,7 +243,7 @@ extern char &LowerSwitchID;
FunctionPass *createLowerInvokePass(const TargetLowering *TLI = 0); FunctionPass *createLowerInvokePass(const TargetLowering *TLI = 0);
FunctionPass *createLowerInvokePass(const TargetLowering *TLI, FunctionPass *createLowerInvokePass(const TargetLowering *TLI,
bool useExpensiveEHSupport); bool useExpensiveEHSupport);
extern char &LowerInvokePassID; extern const PassInfo *const LowerInvokePassID;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
@ -258,7 +258,7 @@ FunctionPass *createBlockPlacementPass();
// optimizations. // optimizations.
// //
Pass *createLCSSAPass(); Pass *createLCSSAPass();
extern char &LCSSAID; extern const PassInfo *const LCSSAID;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
@ -304,7 +304,7 @@ FunctionPass *createCodeGenPreparePass(const TargetLowering *TLI = 0);
// InstructionNamer - Give any unnamed non-void instructions "tmp" names. // InstructionNamer - Give any unnamed non-void instructions "tmp" names.
// //
FunctionPass *createInstructionNamerPass(); FunctionPass *createInstructionNamerPass();
extern char &InstructionNamerID; extern const PassInfo *const InstructionNamerID;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //

View File

@ -39,7 +39,7 @@ namespace llvm {
public: public:
static char ID; // Pass identification, replacement for typeid. static char ID; // Pass identification, replacement for typeid.
SSI() : SSI() :
FunctionPass(ID) { FunctionPass(&ID) {
} }
void getAnalysisUsage(AnalysisUsage &AU) const; void getAnalysisUsage(AnalysisUsage &AU) const;

View File

@ -26,7 +26,7 @@ struct UnifyFunctionExitNodes : public FunctionPass {
BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock; BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock;
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
UnifyFunctionExitNodes() : FunctionPass(ID), UnifyFunctionExitNodes() : FunctionPass(&ID),
ReturnBlock(0), UnwindBlock(0) {} ReturnBlock(0), UnwindBlock(0) {}
// We can preserve non-critical-edgeness when we unify function exit nodes // We can preserve non-critical-edgeness when we unify function exit nodes

View File

@ -34,7 +34,7 @@ namespace {
Module *M; Module *M;
public: public:
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
AliasAnalysisCounter() : ModulePass(ID) { AliasAnalysisCounter() : ModulePass(&ID) {
No = May = Must = 0; No = May = Must = 0;
NoMR = JustRef = JustMod = MR = 0; NoMR = JustRef = JustMod = MR = 0;
} }
@ -87,8 +87,8 @@ namespace {
/// an analysis interface through multiple inheritance. If needed, it /// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the /// should override this to adjust the this pointer as needed for the
/// specified pass info. /// specified pass info.
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
if (PI == &AliasAnalysis::ID) if (PI->isPassID(&AliasAnalysis::ID))
return (AliasAnalysis*)this; return (AliasAnalysis*)this;
return this; return this;
} }

View File

@ -50,7 +50,7 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
AAEval() : FunctionPass(ID) {} AAEval() : FunctionPass(&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<AliasAnalysis>(); AU.addRequired<AliasAnalysis>();

View File

@ -39,7 +39,7 @@ namespace {
public: public:
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
AliasDebugger() : ModulePass(ID) {} AliasDebugger() : ModulePass(&ID) {}
bool runOnModule(Module &M) { bool runOnModule(Module &M) {
InitializeAliasAnalysis(this); // set up super class InitializeAliasAnalysis(this); // set up super class
@ -83,8 +83,8 @@ namespace {
/// an analysis interface through multiple inheritance. If needed, it /// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the /// should override this to adjust the this pointer as needed for the
/// specified pass info. /// specified pass info.
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
if (PI == &AliasAnalysis::ID) if (PI->isPassID(&AliasAnalysis::ID))
return (AliasAnalysis*)this; return (AliasAnalysis*)this;
return this; return this;
} }

View File

@ -579,7 +579,7 @@ namespace {
AliasSetTracker *Tracker; AliasSetTracker *Tracker;
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
AliasSetPrinter() : FunctionPass(ID) {} AliasSetPrinter() : FunctionPass(&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll(); AU.setPreservesAll();

View File

@ -137,8 +137,8 @@ namespace {
/// ///
struct NoAA : public ImmutablePass, public AliasAnalysis { struct NoAA : public ImmutablePass, public AliasAnalysis {
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
NoAA() : ImmutablePass(ID) {} NoAA() : ImmutablePass(&ID) {}
explicit NoAA(char &PID) : ImmutablePass(PID) { } explicit NoAA(void *PID) : ImmutablePass(PID) { }
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
} }
@ -215,7 +215,7 @@ namespace {
/// derives from the NoAA class. /// derives from the NoAA class.
struct BasicAliasAnalysis : public NoAA { struct BasicAliasAnalysis : public NoAA {
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
BasicAliasAnalysis() : NoAA(ID) {} BasicAliasAnalysis() : NoAA(&ID) {}
AliasResult alias(const Value *V1, unsigned V1Size, AliasResult alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size) { const Value *V2, unsigned V2Size) {

View File

@ -25,7 +25,7 @@ using namespace llvm;
namespace { namespace {
struct CFGViewer : public FunctionPass { struct CFGViewer : public FunctionPass {
static char ID; // Pass identifcation, replacement for typeid static char ID; // Pass identifcation, replacement for typeid
CFGViewer() : FunctionPass(ID) {} CFGViewer() : FunctionPass(&ID) {}
virtual bool runOnFunction(Function &F) { virtual bool runOnFunction(Function &F) {
F.viewCFG(); F.viewCFG();
@ -46,7 +46,7 @@ INITIALIZE_PASS(CFGViewer, "view-cfg", "View CFG of function", false, true);
namespace { namespace {
struct CFGOnlyViewer : public FunctionPass { struct CFGOnlyViewer : public FunctionPass {
static char ID; // Pass identifcation, replacement for typeid static char ID; // Pass identifcation, replacement for typeid
CFGOnlyViewer() : FunctionPass(ID) {} CFGOnlyViewer() : FunctionPass(&ID) {}
virtual bool runOnFunction(Function &F) { virtual bool runOnFunction(Function &F) {
F.viewCFGOnly(); F.viewCFGOnly();
@ -68,8 +68,8 @@ INITIALIZE_PASS(CFGOnlyViewer, "view-cfg-only",
namespace { namespace {
struct CFGPrinter : public FunctionPass { struct CFGPrinter : public FunctionPass {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
CFGPrinter() : FunctionPass(ID) {} CFGPrinter() : FunctionPass(&ID) {}
explicit CFGPrinter(char &pid) : FunctionPass(pid) {} explicit CFGPrinter(void *pid) : FunctionPass(pid) {}
virtual bool runOnFunction(Function &F) { virtual bool runOnFunction(Function &F) {
std::string Filename = "cfg." + F.getNameStr() + ".dot"; std::string Filename = "cfg." + F.getNameStr() + ".dot";
@ -101,8 +101,8 @@ P1("dot-cfg", "Print CFG of function to 'dot' file", false, true);
namespace { namespace {
struct CFGOnlyPrinter : public FunctionPass { struct CFGOnlyPrinter : public FunctionPass {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
CFGOnlyPrinter() : FunctionPass(ID) {} CFGOnlyPrinter() : FunctionPass(&ID) {}
explicit CFGOnlyPrinter(char &pid) : FunctionPass(pid) {} explicit CFGOnlyPrinter(void *pid) : FunctionPass(pid) {}
virtual bool runOnFunction(Function &F) { virtual bool runOnFunction(Function &F) {
std::string Filename = "cfg." + F.getNameStr() + ".dot"; std::string Filename = "cfg." + F.getNameStr() + ".dot";
errs() << "Writing '" << Filename << "'..."; errs() << "Writing '" << Filename << "'...";

View File

@ -40,7 +40,7 @@ namespace {
void printVariableDeclaration(const Value *V); void printVariableDeclaration(const Value *V);
public: public:
static char ID; // Pass identification static char ID; // Pass identification
PrintDbgInfo() : FunctionPass(ID), Out(outs()) {} PrintDbgInfo() : FunctionPass(&ID), Out(outs()) {}
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {

View File

@ -86,27 +86,27 @@ namespace {
struct DomViewer struct DomViewer
: public DOTGraphTraitsViewer<DominatorTree, false> { : public DOTGraphTraitsViewer<DominatorTree, false> {
static char ID; static char ID;
DomViewer() : DOTGraphTraitsViewer<DominatorTree, false>("dom", ID){} DomViewer() : DOTGraphTraitsViewer<DominatorTree, false>("dom", &ID){}
}; };
struct DomOnlyViewer struct DomOnlyViewer
: public DOTGraphTraitsViewer<DominatorTree, true> { : public DOTGraphTraitsViewer<DominatorTree, true> {
static char ID; static char ID;
DomOnlyViewer() : DOTGraphTraitsViewer<DominatorTree, true>("domonly", ID){} DomOnlyViewer() : DOTGraphTraitsViewer<DominatorTree, true>("domonly", &ID){}
}; };
struct PostDomViewer struct PostDomViewer
: public DOTGraphTraitsViewer<PostDominatorTree, false> { : public DOTGraphTraitsViewer<PostDominatorTree, false> {
static char ID; static char ID;
PostDomViewer() : PostDomViewer() :
DOTGraphTraitsViewer<PostDominatorTree, false>("postdom", ID){} DOTGraphTraitsViewer<PostDominatorTree, false>("postdom", &ID){}
}; };
struct PostDomOnlyViewer struct PostDomOnlyViewer
: public DOTGraphTraitsViewer<PostDominatorTree, true> { : public DOTGraphTraitsViewer<PostDominatorTree, true> {
static char ID; static char ID;
PostDomOnlyViewer() : PostDomOnlyViewer() :
DOTGraphTraitsViewer<PostDominatorTree, true>("postdomonly", ID){} DOTGraphTraitsViewer<PostDominatorTree, true>("postdomonly", &ID){}
}; };
} // end anonymous namespace } // end anonymous namespace
@ -133,27 +133,27 @@ namespace {
struct DomPrinter struct DomPrinter
: public DOTGraphTraitsPrinter<DominatorTree, false> { : public DOTGraphTraitsPrinter<DominatorTree, false> {
static char ID; static char ID;
DomPrinter() : DOTGraphTraitsPrinter<DominatorTree, false>("dom", ID) {} DomPrinter() : DOTGraphTraitsPrinter<DominatorTree, false>("dom", &ID) {}
}; };
struct DomOnlyPrinter struct DomOnlyPrinter
: public DOTGraphTraitsPrinter<DominatorTree, true> { : public DOTGraphTraitsPrinter<DominatorTree, true> {
static char ID; static char ID;
DomOnlyPrinter() : DOTGraphTraitsPrinter<DominatorTree, true>("domonly", ID) {} DomOnlyPrinter() : DOTGraphTraitsPrinter<DominatorTree, true>("domonly", &ID) {}
}; };
struct PostDomPrinter struct PostDomPrinter
: public DOTGraphTraitsPrinter<PostDominatorTree, false> { : public DOTGraphTraitsPrinter<PostDominatorTree, false> {
static char ID; static char ID;
PostDomPrinter() : PostDomPrinter() :
DOTGraphTraitsPrinter<PostDominatorTree, false>("postdom", ID) {} DOTGraphTraitsPrinter<PostDominatorTree, false>("postdom", &ID) {}
}; };
struct PostDomOnlyPrinter struct PostDomOnlyPrinter
: public DOTGraphTraitsPrinter<PostDominatorTree, true> { : public DOTGraphTraitsPrinter<PostDominatorTree, true> {
static char ID; static char ID;
PostDomOnlyPrinter() : PostDomOnlyPrinter() :
DOTGraphTraitsPrinter<PostDominatorTree, true>("postdomonly", ID) {} DOTGraphTraitsPrinter<PostDominatorTree, true>("postdomonly", &ID) {}
}; };
} // end anonymous namespace } // end anonymous namespace

View File

@ -42,7 +42,7 @@ class BasicCallGraph : public ModulePass, public CallGraph {
public: public:
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
BasicCallGraph() : ModulePass(ID), Root(0), BasicCallGraph() : ModulePass(&ID), Root(0),
ExternalCallingNode(0), CallsExternalNode(0) {} ExternalCallingNode(0), CallsExternalNode(0) {}
// runOnModule - Compute the call graph for the specified module. // runOnModule - Compute the call graph for the specified module.
@ -86,8 +86,8 @@ public:
/// an analysis interface through multiple inheritance. If needed, it should /// an analysis interface through multiple inheritance. If needed, it should
/// override this to adjust the this pointer as needed for the specified pass /// override this to adjust the this pointer as needed for the specified pass
/// info. /// info.
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
if (PI == &CallGraph::ID) if (PI->isPassID(&CallGraph::ID))
return (CallGraph*)this; return (CallGraph*)this;
return this; return this;
} }

View File

@ -45,7 +45,7 @@ class CGPassManager : public ModulePass, public PMDataManager {
public: public:
static char ID; static char ID;
explicit CGPassManager(int Depth) explicit CGPassManager(int Depth)
: ModulePass(ID), PMDataManager(Depth) { } : ModulePass(&ID), PMDataManager(Depth) { }
/// run - Execute all of the passes scheduled for execution. Keep track of /// run - Execute all of the passes scheduled for execution. Keep track of
/// whether any of the passes modifies the module, and if so, return true. /// whether any of the passes modifies the module, and if so, return true.
@ -582,9 +582,9 @@ namespace {
public: public:
static char ID; static char ID;
PrintCallGraphPass() : CallGraphSCCPass(ID), Out(dbgs()) {} PrintCallGraphPass() : CallGraphSCCPass(&ID), Out(dbgs()) {}
PrintCallGraphPass(const std::string &B, raw_ostream &o) PrintCallGraphPass(const std::string &B, raw_ostream &o)
: CallGraphSCCPass(ID), Banner(B), Out(o) {} : CallGraphSCCPass(&ID), Banner(B), Out(o) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll(); AU.setPreservesAll();

View File

@ -88,7 +88,7 @@ namespace {
public: public:
static char ID; static char ID;
GlobalsModRef() : ModulePass(ID) {} GlobalsModRef() : ModulePass(&ID) {}
bool runOnModule(Module &M) { bool runOnModule(Module &M) {
InitializeAliasAnalysis(this); // set up super class InitializeAliasAnalysis(this); // set up super class
@ -150,8 +150,8 @@ namespace {
/// an analysis interface through multiple inheritance. If needed, it /// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the /// should override this to adjust the this pointer as needed for the
/// specified pass info. /// specified pass info.
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
if (PI == &AliasAnalysis::ID) if (PI->isPassID(&AliasAnalysis::ID))
return (AliasAnalysis*)this; return (AliasAnalysis*)this;
return this; return this;
} }

View File

@ -140,7 +140,7 @@ IVStrideUse &IVUsers::AddUser(Instruction *User, Value *Operand) {
} }
IVUsers::IVUsers() IVUsers::IVUsers()
: LoopPass(ID) { : LoopPass(&ID) {
} }
void IVUsers::getAnalysisUsage(AnalysisUsage &AU) const { void IVUsers::getAnalysisUsage(AnalysisUsage &AU) const {

View File

@ -51,7 +51,7 @@ namespace {
} }
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
InstCount() : FunctionPass(ID) {} InstCount() : FunctionPass(&ID) {}
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);

View File

@ -91,7 +91,7 @@ bool IntervalPartition::runOnFunction(Function &F) {
// distinguish it from a copy constructor. Always pass in false for now. // distinguish it from a copy constructor. Always pass in false for now.
// //
IntervalPartition::IntervalPartition(IntervalPartition &IP, bool) IntervalPartition::IntervalPartition(IntervalPartition &IP, bool)
: FunctionPass(ID) { : FunctionPass(&ID) {
assert(IP.getRootInterval() && "Cannot operate on empty IntervalPartitions!"); assert(IP.getRootInterval() && "Cannot operate on empty IntervalPartitions!");
// Pass false to intervals_begin because we take ownership of it's memory // Pass false to intervals_begin because we take ownership of it's memory

View File

@ -108,7 +108,7 @@ namespace {
raw_string_ostream MessagesStr; raw_string_ostream MessagesStr;
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
Lint() : FunctionPass(ID), MessagesStr(Messages) {} Lint() : FunctionPass(&ID), MessagesStr(Messages) {}
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);

View File

@ -25,7 +25,7 @@ char LiveValues::ID = 0;
INITIALIZE_PASS(LiveValues, "live-values", INITIALIZE_PASS(LiveValues, "live-values",
"Value Liveness Analysis", false, true); "Value Liveness Analysis", false, true);
LiveValues::LiveValues() : FunctionPass(ID) {} LiveValues::LiveValues() : FunctionPass(&ID) {}
void LiveValues::getAnalysisUsage(AnalysisUsage &AU) const { void LiveValues::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<DominatorTree>(); AU.addRequired<DominatorTree>();

View File

@ -30,9 +30,9 @@ private:
public: public:
static char ID; static char ID;
PrintLoopPass() : LoopPass(ID), Out(dbgs()) {} PrintLoopPass() : LoopPass(&ID), Out(dbgs()) {}
PrintLoopPass(const std::string &B, raw_ostream &o) PrintLoopPass(const std::string &B, raw_ostream &o)
: LoopPass(ID), Banner(B), Out(o) {} : LoopPass(&ID), Banner(B), Out(o) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll(); AU.setPreservesAll();
@ -59,7 +59,7 @@ char PrintLoopPass::ID = 0;
char LPPassManager::ID = 0; char LPPassManager::ID = 0;
LPPassManager::LPPassManager(int Depth) LPPassManager::LPPassManager(int Depth)
: FunctionPass(ID), PMDataManager(Depth) { : FunctionPass(&ID), PMDataManager(Depth) {
skipThisLoop = false; skipThisLoop = false;
redoThisLoop = false; redoThisLoop = false;
LI = NULL; LI = NULL;

View File

@ -50,7 +50,7 @@ INITIALIZE_PASS(MemoryDependenceAnalysis, "memdep",
"Memory Dependence Analysis", false, true); "Memory Dependence Analysis", false, true);
MemoryDependenceAnalysis::MemoryDependenceAnalysis() MemoryDependenceAnalysis::MemoryDependenceAnalysis()
: FunctionPass(ID), PredCache(0) { : FunctionPass(&ID), PredCache(0) {
} }
MemoryDependenceAnalysis::~MemoryDependenceAnalysis() { MemoryDependenceAnalysis::~MemoryDependenceAnalysis() {
} }

View File

@ -30,7 +30,7 @@ namespace {
DebugInfoFinder Finder; DebugInfoFinder Finder;
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
ModuleDebugInfoPrinter() : ModulePass(ID) {} ModuleDebugInfoPrinter() : ModulePass(&ID) {}
virtual bool runOnModule(Module &M); virtual bool runOnModule(Module &M);

View File

@ -28,7 +28,7 @@
using namespace llvm; using namespace llvm;
char PointerTracking::ID = 0; char PointerTracking::ID = 0;
PointerTracking::PointerTracking() : FunctionPass(ID) {} PointerTracking::PointerTracking() : FunctionPass(&ID) {}
bool PointerTracking::runOnFunction(Function &F) { bool PointerTracking::runOnFunction(Function &F) {
predCache.clear(); predCache.clear();

View File

@ -39,7 +39,7 @@ namespace {
public: public:
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
explicit ProfileEstimatorPass(const double execcount = 0) explicit ProfileEstimatorPass(const double execcount = 0)
: FunctionPass(ID), ExecCount(execcount) { : FunctionPass(&ID), ExecCount(execcount) {
if (execcount == 0) ExecCount = LoopWeight; if (execcount == 0) ExecCount = LoopWeight;
} }
@ -59,8 +59,8 @@ namespace {
/// an analysis interface through multiple inheritance. If needed, it /// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the /// should override this to adjust the this pointer as needed for the
/// specified pass info. /// specified pass info.
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
if (PI == &ProfileInfo::ID) if (PI->isPassID(&ProfileInfo::ID))
return (ProfileInfo*)this; return (ProfileInfo*)this;
return this; return this;
} }
@ -78,7 +78,7 @@ X("profile-estimator", "Estimate profiling information", false, true);
static RegisterAnalysisGroup<ProfileInfo> Y(X); static RegisterAnalysisGroup<ProfileInfo> Y(X);
namespace llvm { namespace llvm {
char &ProfileEstimatorPassID = ProfileEstimatorPass::ID; const PassInfo *ProfileEstimatorPassID = &X;
FunctionPass *createProfileEstimatorPass() { FunctionPass *createProfileEstimatorPass() {
return new ProfileEstimatorPass(); return new ProfileEstimatorPass();

View File

@ -1076,14 +1076,14 @@ raw_ostream& operator<<(raw_ostream &O, std::pair<const MachineBasicBlock *, con
namespace { namespace {
struct NoProfileInfo : public ImmutablePass, public ProfileInfo { struct NoProfileInfo : public ImmutablePass, public ProfileInfo {
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
NoProfileInfo() : ImmutablePass(ID) {} NoProfileInfo() : ImmutablePass(&ID) {}
/// getAdjustedAnalysisPointer - This method is used when a pass implements /// getAdjustedAnalysisPointer - This method is used when a pass implements
/// an analysis interface through multiple inheritance. If needed, it /// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the /// should override this to adjust the this pointer as needed for the
/// specified pass info. /// specified pass info.
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
if (PI == &ProfileInfo::ID) if (PI->isPassID(&ProfileInfo::ID))
return (ProfileInfo*)this; return (ProfileInfo*)this;
return this; return this;
} }

View File

@ -45,7 +45,7 @@ namespace {
public: public:
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
explicit LoaderPass(const std::string &filename = "") explicit LoaderPass(const std::string &filename = "")
: ModulePass(ID), Filename(filename) { : ModulePass(&ID), Filename(filename) {
if (filename.empty()) Filename = ProfileInfoFilename; if (filename.empty()) Filename = ProfileInfoFilename;
} }
@ -67,8 +67,8 @@ namespace {
/// an analysis interface through multiple inheritance. If needed, it /// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the /// should override this to adjust the this pointer as needed for the
/// specified pass info. /// specified pass info.
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
if (PI == &ProfileInfo::ID) if (PI->isPassID(&ProfileInfo::ID))
return (ProfileInfo*)this; return (ProfileInfo*)this;
return this; return this;
} }
@ -84,7 +84,7 @@ X("profile-loader", "Load profile information from llvmprof.out", false, true);
static RegisterAnalysisGroup<ProfileInfo> Y(X); static RegisterAnalysisGroup<ProfileInfo> Y(X);
char &llvm::ProfileLoaderPassID = LoaderPass::ID; const PassInfo *llvm::ProfileLoaderPassID = &X;
ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); } ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); }

View File

@ -59,10 +59,10 @@ namespace llvm {
public: public:
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
explicit ProfileVerifierPassT () : FunctionPass(ID) { explicit ProfileVerifierPassT () : FunctionPass(&ID) {
DisableAssertions = ProfileVerifierDisableAssertions; DisableAssertions = ProfileVerifierDisableAssertions;
} }
explicit ProfileVerifierPassT (bool da) : FunctionPass(ID), explicit ProfileVerifierPassT (bool da) : FunctionPass(&ID),
DisableAssertions(da) { DisableAssertions(da) {
} }

View File

@ -589,7 +589,7 @@ void RegionInfo::releaseMemory() {
TopLevelRegion = 0; TopLevelRegion = 0;
} }
RegionInfo::RegionInfo() : FunctionPass(ID) { RegionInfo::RegionInfo() : FunctionPass(&ID) {
TopLevelRegion = 0; TopLevelRegion = 0;
} }

View File

@ -121,7 +121,7 @@ namespace {
struct RegionViewer struct RegionViewer
: public DOTGraphTraitsViewer<RegionInfo, false> { : public DOTGraphTraitsViewer<RegionInfo, false> {
static char ID; static char ID;
RegionViewer() : DOTGraphTraitsViewer<RegionInfo, false>("reg", ID){} RegionViewer() : DOTGraphTraitsViewer<RegionInfo, false>("reg", &ID){}
}; };
char RegionViewer::ID = 0; char RegionViewer::ID = 0;
@ -131,7 +131,7 @@ INITIALIZE_PASS(RegionViewer, "view-regions", "View regions of function",
struct RegionOnlyViewer struct RegionOnlyViewer
: public DOTGraphTraitsViewer<RegionInfo, true> { : public DOTGraphTraitsViewer<RegionInfo, true> {
static char ID; static char ID;
RegionOnlyViewer() : DOTGraphTraitsViewer<RegionInfo, true>("regonly", ID){} RegionOnlyViewer() : DOTGraphTraitsViewer<RegionInfo, true>("regonly", &ID){}
}; };
char RegionOnlyViewer::ID = 0; char RegionOnlyViewer::ID = 0;
@ -143,7 +143,7 @@ struct RegionPrinter
: public DOTGraphTraitsPrinter<RegionInfo, false> { : public DOTGraphTraitsPrinter<RegionInfo, false> {
static char ID; static char ID;
RegionPrinter() : RegionPrinter() :
DOTGraphTraitsPrinter<RegionInfo, false>("reg", ID) {} DOTGraphTraitsPrinter<RegionInfo, false>("reg", &ID) {}
}; };
} //end anonymous namespace } //end anonymous namespace
@ -157,7 +157,7 @@ struct RegionOnlyPrinter
: public DOTGraphTraitsPrinter<RegionInfo, true> { : public DOTGraphTraitsPrinter<RegionInfo, true> {
static char ID; static char ID;
RegionOnlyPrinter() : RegionOnlyPrinter() :
DOTGraphTraitsPrinter<RegionInfo, true>("reg", ID) {} DOTGraphTraitsPrinter<RegionInfo, true>("reg", &ID) {}
}; };
} }

View File

@ -5742,7 +5742,7 @@ ScalarEvolution::SCEVCallbackVH::SCEVCallbackVH(Value *V, ScalarEvolution *se)
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
ScalarEvolution::ScalarEvolution() ScalarEvolution::ScalarEvolution()
: FunctionPass(ID), FirstUnknown(0) { : FunctionPass(&ID), FirstUnknown(0) {
} }
bool ScalarEvolution::runOnFunction(Function &F) { bool ScalarEvolution::runOnFunction(Function &F) {

View File

@ -34,14 +34,14 @@ namespace {
public: public:
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
ScalarEvolutionAliasAnalysis() : FunctionPass(ID), SE(0) {} ScalarEvolutionAliasAnalysis() : FunctionPass(&ID), SE(0) {}
/// getAdjustedAnalysisPointer - This method is used when a pass implements /// getAdjustedAnalysisPointer - This method is used when a pass implements
/// an analysis interface through multiple inheritance. If needed, it /// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the /// should override this to adjust the this pointer as needed for the
/// specified pass info. /// specified pass info.
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
if (PI == &AliasAnalysis::ID) if (PI->isPassID(&AliasAnalysis::ID))
return (AliasAnalysis*)this; return (AliasAnalysis*)this;
return this; return this;
} }

View File

@ -82,14 +82,14 @@ namespace {
public AliasAnalysis { public AliasAnalysis {
public: public:
static char ID; // Class identification, replacement for typeinfo static char ID; // Class identification, replacement for typeinfo
TypeBasedAliasAnalysis() : ImmutablePass(ID) {} TypeBasedAliasAnalysis() : ImmutablePass(&ID) {}
/// getAdjustedAnalysisPointer - This method is used when a pass implements /// getAdjustedAnalysisPointer - This method is used when a pass implements
/// an analysis interface through multiple inheritance. If needed, it /// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the /// should override this to adjust the this pointer as needed for the
/// specified pass info. /// specified pass info.
virtual void *getAdjustedAnalysisPointer(const void *PI) { virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
if (PI == &AliasAnalysis::ID) if (PI->isPassID(&AliasAnalysis::ID))
return (AliasAnalysis*)this; return (AliasAnalysis*)this;
return this; return this;
} }

View File

@ -21,7 +21,7 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
explicit WriteBitcodePass(raw_ostream &o) explicit WriteBitcodePass(raw_ostream &o)
: ModulePass(ID), OS(o) {} : ModulePass(&ID), OS(o) {}
const char *getPassName() const { return "Bitcode Writer"; } const char *getPassName() const { return "Bitcode Writer"; }

View File

@ -91,7 +91,7 @@ static unsigned getGVAlignmentLog2(const GlobalValue *GV, const TargetData &TD,
AsmPrinter::AsmPrinter(TargetMachine &tm, MCStreamer &Streamer) AsmPrinter::AsmPrinter(TargetMachine &tm, MCStreamer &Streamer)
: MachineFunctionPass(ID), : MachineFunctionPass(&ID),
TM(tm), MAI(tm.getMCAsmInfo()), TM(tm), MAI(tm.getMCAsmInfo()),
OutContext(Streamer.getContext()), OutContext(Streamer.getContext()),
OutStreamer(Streamer), OutStreamer(Streamer),

View File

@ -65,7 +65,7 @@ namespace {
public: public:
static char ID; static char ID;
explicit BranchFolderPass(bool defaultEnableTailMerge) explicit BranchFolderPass(bool defaultEnableTailMerge)
: MachineFunctionPass(ID), BranchFolder(defaultEnableTailMerge) {} : MachineFunctionPass(&ID), BranchFolder(defaultEnableTailMerge) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { return "Control Flow Optimizer"; } virtual const char *getPassName() const { return "Control Flow Optimizer"; }

View File

@ -36,7 +36,7 @@ namespace {
public: public:
static char ID; static char ID;
CodePlacementOpt() : MachineFunctionPass(ID) {} CodePlacementOpt() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { virtual const char *getPassName() const {

View File

@ -36,7 +36,7 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
DeadMachineInstructionElim() : MachineFunctionPass(ID) {} DeadMachineInstructionElim() : MachineFunctionPass(&ID) {}
private: private:
bool isDead(const MachineInstr *MI) const; bool isDead(const MachineInstr *MI) const;

View File

@ -160,7 +160,7 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid. static char ID; // Pass identification, replacement for typeid.
DwarfEHPrepare(const TargetMachine *tm, bool fast) : DwarfEHPrepare(const TargetMachine *tm, bool fast) :
FunctionPass(ID), TM(tm), TLI(TM->getTargetLowering()), FunctionPass(&ID), TM(tm), TLI(TM->getTargetLowering()),
CompileFast(fast), CompileFast(fast),
ExceptionValueIntrinsic(0), SelectorIntrinsic(0), ExceptionValueIntrinsic(0), SelectorIntrinsic(0),
URoR(0), EHCatchAllValue(0), RewindFunction(0) {} URoR(0), EHCatchAllValue(0), RewindFunction(0) {}

View File

@ -63,7 +63,7 @@ char ELFWriter::ID = 0;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
ELFWriter::ELFWriter(raw_ostream &o, TargetMachine &tm) ELFWriter::ELFWriter(raw_ostream &o, TargetMachine &tm)
: MachineFunctionPass(ID), O(o), TM(tm), : MachineFunctionPass(&ID), O(o), TM(tm),
OutContext(*new MCContext(*TM.getMCAsmInfo())), OutContext(*new MCContext(*TM.getMCAsmInfo())),
TLOF(TM.getTargetLowering()->getObjFileLowering()), TLOF(TM.getTargetLowering()->getObjFileLowering()),
is64Bit(TM.getTargetData()->getPointerSizeInBits() == 64), is64Bit(TM.getTargetData()->getPointerSizeInBits() == 64),

View File

@ -30,8 +30,8 @@ namespace {
raw_ostream &OS; raw_ostream &OS;
public: public:
Printer() : FunctionPass(ID), OS(errs()) {} Printer() : FunctionPass(&ID), OS(errs()) {}
explicit Printer(raw_ostream &OS) : FunctionPass(ID), OS(OS) {} explicit Printer(raw_ostream &OS) : FunctionPass(&ID), OS(OS) {}
const char *getPassName() const; const char *getPassName() const;
@ -70,7 +70,7 @@ GCFunctionInfo::~GCFunctionInfo() {}
char GCModuleInfo::ID = 0; char GCModuleInfo::ID = 0;
GCModuleInfo::GCModuleInfo() GCModuleInfo::GCModuleInfo()
: ImmutablePass(ID) {} : ImmutablePass(&ID) {}
GCModuleInfo::~GCModuleInfo() { GCModuleInfo::~GCModuleInfo() {
clear(); clear();
@ -189,7 +189,7 @@ FunctionPass *llvm::createGCInfoDeleter() {
return new Deleter(); return new Deleter();
} }
Deleter::Deleter() : FunctionPass(ID) {} Deleter::Deleter() : FunctionPass(&ID) {}
const char *Deleter::getPassName() const { const char *Deleter::getPassName() const {
return "Delete Garbage Collector Information"; return "Delete Garbage Collector Information";

View File

@ -130,7 +130,7 @@ FunctionPass *llvm::createGCLoweringPass() {
char LowerIntrinsics::ID = 0; char LowerIntrinsics::ID = 0;
LowerIntrinsics::LowerIntrinsics() LowerIntrinsics::LowerIntrinsics()
: FunctionPass(ID) {} : FunctionPass(&ID) {}
const char *LowerIntrinsics::getPassName() const { const char *LowerIntrinsics::getPassName() const {
return "Lower Garbage Collection Instructions"; return "Lower Garbage Collection Instructions";
@ -318,7 +318,7 @@ FunctionPass *llvm::createGCMachineCodeAnalysisPass() {
char MachineCodeAnalysis::ID = 0; char MachineCodeAnalysis::ID = 0;
MachineCodeAnalysis::MachineCodeAnalysis() MachineCodeAnalysis::MachineCodeAnalysis()
: MachineFunctionPass(ID) {} : MachineFunctionPass(&ID) {}
const char *MachineCodeAnalysis::getPassName() const { const char *MachineCodeAnalysis::getPassName() const {
return "Analyze Machine Code For Garbage Collection"; return "Analyze Machine Code For Garbage Collection";

View File

@ -154,7 +154,7 @@ namespace {
int FnNum; int FnNum;
public: public:
static char ID; static char ID;
IfConverter() : MachineFunctionPass(ID), FnNum(-1) {} IfConverter() : MachineFunctionPass(&ID), FnNum(-1) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { return "If Converter"; } virtual const char *getPassName() const { return "If Converter"; }

View File

@ -36,7 +36,7 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
LowerSubregsInstructionPass() : MachineFunctionPass(ID) {} LowerSubregsInstructionPass() : MachineFunctionPass(&ID) {}
const char *getPassName() const { const char *getPassName() const {
return "Subregister lowering instruction pass"; return "Subregister lowering instruction pass";

View File

@ -41,7 +41,7 @@ namespace {
MachineRegisterInfo *MRI; MachineRegisterInfo *MRI;
public: public:
static char ID; // Pass identification static char ID; // Pass identification
MachineCSE() : MachineFunctionPass(ID), LookAheadLimit(5), CurrVN(0) {} MachineCSE() : MachineFunctionPass(&ID), LookAheadLimit(5), CurrVN(0) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);

View File

@ -27,7 +27,7 @@ char MachineDominatorTree::ID = 0;
static RegisterPass<MachineDominatorTree> static RegisterPass<MachineDominatorTree>
E("machinedomtree", "MachineDominator Tree Construction", true); E("machinedomtree", "MachineDominator Tree Construction", true);
char &llvm::MachineDominatorsID = MachineDominatorTree::ID; const PassInfo *const llvm::MachineDominatorsID = &E;
void MachineDominatorTree::getAnalysisUsage(AnalysisUsage &AU) const { void MachineDominatorTree::getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll(); AU.setPreservesAll();
@ -41,7 +41,7 @@ bool MachineDominatorTree::runOnMachineFunction(MachineFunction &F) {
} }
MachineDominatorTree::MachineDominatorTree() MachineDominatorTree::MachineDominatorTree()
: MachineFunctionPass(ID) { : MachineFunctionPass(&ID) {
DT = new DominatorTreeBase<MachineBasicBlock>(false); DT = new DominatorTreeBase<MachineBasicBlock>(false);
} }

View File

@ -20,14 +20,14 @@ using namespace llvm;
// a default constructor. // a default constructor.
static PassInfo static PassInfo
X("Machine Function Analysis", "machine-function-analysis", X("Machine Function Analysis", "machine-function-analysis",
&MachineFunctionAnalysis::ID, 0, intptr_t(&MachineFunctionAnalysis::ID), 0,
/*CFGOnly=*/false, /*is_analysis=*/true); /*CFGOnly=*/false, /*is_analysis=*/true);
char MachineFunctionAnalysis::ID = 0; char MachineFunctionAnalysis::ID = 0;
MachineFunctionAnalysis::MachineFunctionAnalysis(const TargetMachine &tm, MachineFunctionAnalysis::MachineFunctionAnalysis(const TargetMachine &tm,
CodeGenOpt::Level OL) : CodeGenOpt::Level OL) :
FunctionPass(ID), TM(tm), OptLevel(OL), MF(0) { FunctionPass(&ID), TM(tm), OptLevel(OL), MF(0) {
} }
MachineFunctionAnalysis::~MachineFunctionAnalysis() { MachineFunctionAnalysis::~MachineFunctionAnalysis() {

View File

@ -29,7 +29,7 @@ struct MachineFunctionPrinterPass : public MachineFunctionPass {
const std::string Banner; const std::string Banner;
MachineFunctionPrinterPass(raw_ostream &os, const std::string &banner) MachineFunctionPrinterPass(raw_ostream &os, const std::string &banner)
: MachineFunctionPass(ID), OS(os), Banner(banner) {} : MachineFunctionPass(&ID), OS(os), Banner(banner) {}
const char *getPassName() const { return "MachineFunction Printer"; } const char *getPassName() const { return "MachineFunction Printer"; }

View File

@ -74,10 +74,10 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
MachineLICM() : MachineLICM() :
MachineFunctionPass(ID), PreRegAlloc(true) {} MachineFunctionPass(&ID), PreRegAlloc(true) {}
explicit MachineLICM(bool PreRA) : explicit MachineLICM(bool PreRA) :
MachineFunctionPass(ID), PreRegAlloc(PreRA) {} MachineFunctionPass(&ID), PreRegAlloc(PreRA) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);

View File

@ -33,7 +33,7 @@ char MachineLoopInfo::ID = 0;
static RegisterPass<MachineLoopInfo> static RegisterPass<MachineLoopInfo>
X("machine-loops", "Machine Natural Loop Construction", true); X("machine-loops", "Machine Natural Loop Construction", true);
char &llvm::MachineLoopInfoID = MachineLoopInfo::ID; const PassInfo *const llvm::MachineLoopInfoID = &X;
bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) { bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) {
releaseMemory(); releaseMemory();

View File

@ -254,7 +254,7 @@ void MMIAddrLabelMapCallbackPtr::allUsesReplacedWith(Value *V2) {
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI) MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI)
: ImmutablePass(ID), Context(MAI), : ImmutablePass(&ID), Context(MAI),
ObjFileMMI(0), ObjFileMMI(0),
CurCallSite(0), CallsEHReturn(0), CallsUnwindInit(0), DbgInfoAvailable(false){ CurCallSite(0), CallsEHReturn(0), CallsUnwindInit(0), DbgInfoAvailable(false){
// Always emit some info, by default "no personality" info. // Always emit some info, by default "no personality" info.
@ -264,7 +264,7 @@ MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI)
} }
MachineModuleInfo::MachineModuleInfo() MachineModuleInfo::MachineModuleInfo()
: ImmutablePass(ID), Context(*(MCAsmInfo*)0) { : ImmutablePass(&ID), Context(*(MCAsmInfo*)0) {
assert(0 && "This MachineModuleInfo constructor should never be called, MMI " assert(0 && "This MachineModuleInfo constructor should never be called, MMI "
"should always be explicitly constructed by LLVMTargetMachine"); "should always be explicitly constructed by LLVMTargetMachine");
abort(); abort();

View File

@ -44,7 +44,7 @@ namespace {
public: public:
static char ID; // Pass identification static char ID; // Pass identification
MachineSinking() : MachineFunctionPass(ID) {} MachineSinking() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);

View File

@ -194,7 +194,7 @@ namespace {
static char ID; // Pass ID, replacement for typeid static char ID; // Pass ID, replacement for typeid
MachineVerifierPass() MachineVerifierPass()
: MachineFunctionPass(ID) {} : MachineFunctionPass(&ID) {}
void getAnalysisUsage(AnalysisUsage &AU) const { void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll(); AU.setPreservesAll();

View File

@ -43,7 +43,7 @@ namespace {
public: public:
static char ID; // Pass identification static char ID; // Pass identification
OptimizeExts() : MachineFunctionPass(ID) {} OptimizeExts() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);

View File

@ -33,7 +33,7 @@ namespace {
public: public:
static char ID; // Pass identification static char ID; // Pass identification
OptimizePHIs() : MachineFunctionPass(ID) {} OptimizePHIs() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);

View File

@ -40,7 +40,7 @@ char PHIElimination::ID = 0;
static RegisterPass<PHIElimination> static RegisterPass<PHIElimination>
X("phi-node-elimination", "Eliminate PHI nodes for register allocation"); X("phi-node-elimination", "Eliminate PHI nodes for register allocation");
char &llvm::PHIEliminationID = PHIElimination::ID; const PassInfo *const llvm::PHIEliminationID = &X;
void llvm::PHIElimination::getAnalysisUsage(AnalysisUsage &AU) const { void llvm::PHIElimination::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addPreserved<LiveVariables>(); AU.addPreserved<LiveVariables>();

View File

@ -25,7 +25,7 @@ namespace llvm {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
PHIElimination() : MachineFunctionPass(ID) {} PHIElimination() : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &Fn); virtual bool runOnMachineFunction(MachineFunction &Fn);

View File

@ -85,7 +85,7 @@ namespace {
public: public:
static char ID; static char ID;
PostRAScheduler(CodeGenOpt::Level ol) : PostRAScheduler(CodeGenOpt::Level ol) :
MachineFunctionPass(ID), OptLevel(ol) {} MachineFunctionPass(&ID), OptLevel(ol) {}
void getAnalysisUsage(AnalysisUsage &AU) const { void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesCFG(); AU.setPreservesCFG();

View File

@ -92,7 +92,7 @@ namespace {
public: public:
static char ID; static char ID;
PreAllocSplitting() PreAllocSplitting()
: MachineFunctionPass(ID) {} : MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);
@ -206,7 +206,7 @@ char PreAllocSplitting::ID = 0;
static RegisterPass<PreAllocSplitting> static RegisterPass<PreAllocSplitting>
X("pre-alloc-splitting", "Pre-Register Allocation Live Interval Splitting"); X("pre-alloc-splitting", "Pre-Register Allocation Live Interval Splitting");
char &llvm::PreAllocSplittingID = PreAllocSplitting::ID; const PassInfo *const llvm::PreAllocSplittingID = &X;
/// findSpillPoint - Find a gap as far away from the given MI that's suitable /// findSpillPoint - Find a gap as far away from the given MI that's suitable
/// for spilling the current live interval. The index must be before any /// for spilling the current live interval. The index must be before any

View File

@ -36,7 +36,7 @@ namespace llvm {
class PEI : public MachineFunctionPass { class PEI : public MachineFunctionPass {
public: public:
static char ID; static char ID;
PEI() : MachineFunctionPass(ID) {} PEI() : MachineFunctionPass(&ID) {}
const char *getPassName() const { const char *getPassName() const {
return "Prolog/Epilog Insertion & Frame Finalization"; return "Prolog/Epilog Insertion & Frame Finalization";

View File

@ -47,7 +47,7 @@ namespace {
class RAFast : public MachineFunctionPass { class RAFast : public MachineFunctionPass {
public: public:
static char ID; static char ID;
RAFast() : MachineFunctionPass(ID), StackSlotForVirtReg(-1), RAFast() : MachineFunctionPass(&ID), StackSlotForVirtReg(-1),
isBulkSpilling(false) {} isBulkSpilling(false) {}
private: private:
const TargetMachine *TM; const TargetMachine *TM;

View File

@ -90,7 +90,7 @@ namespace {
struct RALinScan : public MachineFunctionPass { struct RALinScan : public MachineFunctionPass {
static char ID; static char ID;
RALinScan() : MachineFunctionPass(ID) { RALinScan() : MachineFunctionPass(&ID) {
// Initialize the queue to record recently-used registers. // Initialize the queue to record recently-used registers.
if (NumRecentlyUsedRegs > 0) if (NumRecentlyUsedRegs > 0)
RecentRegs.resize(NumRecentlyUsedRegs, 0); RecentRegs.resize(NumRecentlyUsedRegs, 0);

View File

@ -84,7 +84,7 @@ namespace {
static char ID; static char ID;
/// Construct a PBQP register allocator. /// Construct a PBQP register allocator.
PBQPRegAlloc() : MachineFunctionPass(ID) {} PBQPRegAlloc() : MachineFunctionPass(&ID) {}
/// Return the pass name. /// Return the pass name.
virtual const char* getPassName() const { virtual const char* getPassName() const {

View File

@ -198,7 +198,7 @@ namespace llvm {
public: public:
static char ID; static char ID;
RenderMachineFunction() : MachineFunctionPass(ID) {} RenderMachineFunction() : MachineFunctionPass(&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &au) const; virtual void getAnalysisUsage(AnalysisUsage &au) const;

View File

@ -171,7 +171,7 @@ TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
SelectionDAGISel::SelectionDAGISel(const TargetMachine &tm, CodeGenOpt::Level OL) : SelectionDAGISel::SelectionDAGISel(const TargetMachine &tm, CodeGenOpt::Level OL) :
MachineFunctionPass(ID), TM(tm), TLI(*tm.getTargetLowering()), MachineFunctionPass(&ID), TM(tm), TLI(*tm.getTargetLowering()),
FuncInfo(new FunctionLoweringInfo(TLI)), FuncInfo(new FunctionLoweringInfo(TLI)),
CurDAG(new SelectionDAG(tm)), CurDAG(new SelectionDAG(tm)),
SDB(new SelectionDAGBuilder(*CurDAG, *FuncInfo, OL)), SDB(new SelectionDAGBuilder(*CurDAG, *FuncInfo, OL)),

View File

@ -65,7 +65,7 @@ X("simple-register-coalescing", "Simple Register Coalescing");
// Declare that we implement the RegisterCoalescer interface // Declare that we implement the RegisterCoalescer interface
static RegisterAnalysisGroup<RegisterCoalescer, true/*The Default*/> V(X); static RegisterAnalysisGroup<RegisterCoalescer, true/*The Default*/> V(X);
char &llvm::SimpleRegisterCoalescingID = SimpleRegisterCoalescing::ID; const PassInfo *const llvm::SimpleRegisterCoalescingID = &X;
void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const { void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesCFG(); AU.setPreservesCFG();

View File

@ -64,7 +64,7 @@ namespace llvm {
public: public:
static char ID; // Pass identifcation, replacement for typeid static char ID; // Pass identifcation, replacement for typeid
SimpleRegisterCoalescing() : MachineFunctionPass(ID) {} SimpleRegisterCoalescing() : MachineFunctionPass(&ID) {}
struct InstrSlots { struct InstrSlots {
enum { enum {

View File

@ -58,7 +58,7 @@ namespace {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
explicit SjLjEHPass(const TargetLowering *tli = NULL) explicit SjLjEHPass(const TargetLowering *tli = NULL)
: FunctionPass(ID), TLI(tli) { } : FunctionPass(&ID), TLI(tli) { }
bool doInitialization(Module &M); bool doInitialization(Module &M);
bool runOnFunction(Function &F); bool runOnFunction(Function &F);

View File

@ -36,7 +36,7 @@ namespace llvm {
public: public:
static char ID; static char ID;
LoopSplitter() : MachineFunctionPass(ID) {} LoopSplitter() : MachineFunctionPass(&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &au) const; virtual void getAnalysisUsage(AnalysisUsage &au) const;

View File

@ -62,9 +62,9 @@ namespace {
bool RequiresStackProtector() const; bool RequiresStackProtector() const;
public: public:
static char ID; // Pass identification, replacement for typeid. static char ID; // Pass identification, replacement for typeid.
StackProtector() : FunctionPass(ID), TLI(0) {} StackProtector() : FunctionPass(&ID), TLI(0) {}
StackProtector(const TargetLowering *tli) StackProtector(const TargetLowering *tli)
: FunctionPass(ID), TLI(tli) {} : FunctionPass(&ID), TLI(tli) {}
virtual bool runOnFunction(Function &Fn); virtual bool runOnFunction(Function &Fn);
}; };

View File

@ -95,9 +95,9 @@ namespace {
public: public:
static char ID; // Pass identification static char ID; // Pass identification
StackSlotColoring() : StackSlotColoring() :
MachineFunctionPass(ID), ColorWithRegs(false), NextColor(-1) {} MachineFunctionPass(&ID), ColorWithRegs(false), NextColor(-1) {}
StackSlotColoring(bool RegColor) : StackSlotColoring(bool RegColor) :
MachineFunctionPass(ID), ColorWithRegs(RegColor), NextColor(-1) {} MachineFunctionPass(&ID), ColorWithRegs(RegColor), NextColor(-1) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesCFG(); AU.setPreservesCFG();

View File

@ -39,7 +39,7 @@ using namespace llvm;
namespace { namespace {
struct StrongPHIElimination : public MachineFunctionPass { struct StrongPHIElimination : public MachineFunctionPass {
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
StrongPHIElimination() : MachineFunctionPass(ID) {} StrongPHIElimination() : MachineFunctionPass(&ID) {}
// Waiting stores, for each MBB, the set of copies that need to // Waiting stores, for each MBB, the set of copies that need to
// be inserted into that MBB // be inserted into that MBB
@ -154,7 +154,7 @@ static RegisterPass<StrongPHIElimination>
X("strong-phi-node-elimination", X("strong-phi-node-elimination",
"Eliminate PHI nodes for register allocation, intelligently"); "Eliminate PHI nodes for register allocation, intelligently");
char &llvm::StrongPHIEliminationID = StrongPHIElimination::ID; const PassInfo *const llvm::StrongPHIEliminationID = &X;
/// computeDFS - Computes the DFS-in and DFS-out numbers of the dominator tree /// computeDFS - Computes the DFS-in and DFS-out numbers of the dominator tree
/// of the given MachineFunction. These numbers are then used in other parts /// of the given MachineFunction. These numbers are then used in other parts

View File

@ -69,7 +69,7 @@ namespace {
public: public:
static char ID; static char ID;
explicit TailDuplicatePass(bool PreRA) : explicit TailDuplicatePass(bool PreRA) :
MachineFunctionPass(ID), PreRegAlloc(PreRA) {} MachineFunctionPass(&ID), PreRegAlloc(PreRA) {}
virtual bool runOnMachineFunction(MachineFunction &MF); virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { return "Tail Duplication"; } virtual const char *getPassName() const { return "Tail Duplication"; }

Some files were not shown because too many files have changed in this diff Show More