Revert r110396 to fix buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2010-08-06 00:23:35 +00:00
parent f6d6df4006
commit 1f74590e9d
212 changed files with 476 additions and 480 deletions

View File

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

View File

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

View File

@ -26,7 +26,7 @@ class FindUsedTypes : public ModulePass {
std::set<const Type *> UsedTypes;
public:
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
/// the types used in the module.

View File

@ -48,7 +48,7 @@ class IntervalPartition : public FunctionPass {
public:
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
virtual bool runOnFunction(Function &F);

View File

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

View File

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

View File

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

View File

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

View File

@ -28,7 +28,8 @@ class PMStack;
class LoopPass : public Pass {
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
/// to a Loop.

View File

@ -92,7 +92,7 @@ namespace llvm {
// file.
//
ModulePass *createProfileLoaderPass();
extern char &ProfileLoaderPassID;
extern const PassInfo *ProfileLoaderPassID;
//===--------------------------------------------------------------------===//
//
@ -106,7 +106,7 @@ namespace llvm {
// instead of loading it from a previous run.
//
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
DominatorTreeBase<BasicBlock>* DT;
PostDominatorTree() : FunctionPass(ID) {
PostDominatorTree() : FunctionPass(&ID) {
DT = new DominatorTreeBase<BasicBlock>(true);
}
@ -106,7 +106,7 @@ template <> struct GraphTraits<PostDominatorTree*>
struct PostDominanceFrontier : public DominanceFrontierBase {
static char ID;
PostDominanceFrontier()
: DominanceFrontierBase(ID, true) {}
: DominanceFrontierBase(&ID, true) {}
virtual bool runOnFunction(Function &) {
Frontiers.clear();

View File

@ -33,7 +33,8 @@ class CallGraphSCC;
class CallGraphSCCPass : public Pass {
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
/// corresponding to a CallGraph.

View File

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

View File

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

View File

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

View File

@ -46,7 +46,7 @@ class TargetRegisterInfo;
class LiveVariables : public MachineFunctionPass {
public:
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
/// the program. We represent this with three different pieces of

View File

@ -31,7 +31,8 @@ class MachineFunction;
/// override runOnMachineFunction.
class MachineFunctionPass : public FunctionPass {
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
/// desired machine code transformation or analysis.

View File

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

View File

@ -43,18 +43,18 @@ namespace llvm {
/// 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.
///
extern char &MachineDominatorsID;
extern const PassInfo *const MachineDominatorsID;
/// PHIElimination pass - This pass eliminates machine instruction PHI nodes
/// by inserting copy instructions. This destroys SSA information, but is the
/// desired input for some register allocators. This pass is "required" by
/// these register allocator like this: AU.addRequiredID(PHIEliminationID);
///
extern char &PHIEliminationID;
extern const PassInfo *const PHIEliminationID;
/// StrongPHIElimination pass - This pass eliminates machine instruction PHI
/// nodes by inserting copy instructions. This destroys SSA information, but
@ -62,23 +62,23 @@ namespace llvm {
/// "required" by these register allocator like this:
/// AU.addRequiredID(PHIEliminationID);
/// 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
/// copy it can.
///
extern char &SimpleRegisterCoalescingID;
extern const PassInfo *const SimpleRegisterCoalescingID;
/// TwoAddressInstruction pass - This pass reduces two-address instructions to
/// use two operands. This destroys SSA information but it is desired by
/// register allocators.
extern char &TwoAddressInstructionPassID;
extern const PassInfo *const TwoAddressInstructionPassID;
/// UnreachableMachineBlockElimination pass - This pass removes unreachable
/// machine basic blocks.
extern char &UnreachableMachineBlockElimID;
extern const PassInfo *const UnreachableMachineBlockElimID;
/// DeadMachineInstructionElim pass - This pass removes dead machine
/// instructions.

View File

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

View File

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

View File

@ -50,7 +50,7 @@ class raw_ostream;
class StringRef;
// 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
/// (PassManager and FunctionPassManager) are not represented here.
@ -82,13 +82,14 @@ enum PassKind {
///
class Pass {
AnalysisResolver *Resolver; // Used to resolve analysis
const void *PassID;
intptr_t PassID;
PassKind Kind;
void operator=(const Pass&); // DO NOT IMPLEMENT
Pass(const Pass &); // DO NOT IMPLEMENT
public:
explicit Pass(PassKind K, char &pid);
explicit Pass(PassKind K, intptr_t pid);
explicit Pass(PassKind K, const void *pid);
virtual ~Pass();
@ -100,10 +101,10 @@ public:
///
virtual const char *getPassName() const;
/// getPassID - Return the PassID number that corresponds to this pass.
virtual AnalysisID getPassID() const {
return PassID;
}
/// getPassInfo - Return the PassInfo data structure that corresponds to this
/// pass... If the pass has not been registered, this will return null.
///
const PassInfo *getPassInfo() const;
/// 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
@ -158,7 +159,7 @@ public:
/// an analysis interface through multiple inheritance. If needed, it should
/// override this to adjust the this pointer as needed for the specified pass
/// info.
virtual void *getAdjustedAnalysisPointer(AnalysisID ID);
virtual void *getAdjustedAnalysisPointer(const PassInfo *);
virtual ImmutablePass *getAsImmutablePass();
virtual PMDataManager *getAsPMDataManager();
@ -169,9 +170,14 @@ public:
// dumpPassStructure - Implement the -debug-passes=PassStructure option
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,
// 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
// 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
/// 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
/// 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
template<typename AnalysisType>
AnalysisType &getAnalysisID(AnalysisID PI) const;
AnalysisType &getAnalysisID(const PassInfo *PI) const;
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.
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.
virtual ~ModulePass();
};
@ -261,7 +268,8 @@ public:
///
bool runOnModule(Module &) { return false; }
explicit ImmutablePass(char &pid)
explicit ImmutablePass(intptr_t pid) : ModulePass(pid) {}
explicit ImmutablePass(const void *pid)
: ModulePass(pid) {}
// Force out-of-line virtual method.
@ -279,7 +287,8 @@ public:
///
class FunctionPass : public Pass {
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.
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
@ -331,7 +340,8 @@ public:
///
class BasicBlockPass : public Pass {
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.
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
// for a pass.
//
AnalysisUsage &addRequiredID(const void *ID);
AnalysisUsage &addRequiredID(char &ID);
AnalysisUsage &addRequiredID(AnalysisID ID);
template<class PassClass>
AnalysisUsage &addRequired() {
return addRequiredID(PassClass::ID);
return addRequiredID(Pass::getClassPassInfo<PassClass>());
}
AnalysisUsage &addRequiredTransitiveID(char &ID);
AnalysisUsage &addRequiredTransitiveID(AnalysisID ID);
template<class PassClass>
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
// this pass
//
AnalysisUsage &addPreservedID(const void *ID) {
AnalysisUsage &addPreservedID(AnalysisID ID) {
Preserved.push_back(ID);
return *this;
}
AnalysisUsage &addPreservedID(char &ID) {
Preserved.push_back(&ID);
return *this;
}
// addPreserved - Add the specified Pass class to the set of analyses
// preserved by this pass.
//
template<class PassClass>
AnalysisUsage &addPreserved() {
Preserved.push_back(&PassClass::ID);
assert(Pass::getClassPassInfo<PassClass>() && "Pass class not registered!");
Preserved.push_back(Pass::getClassPassInfo<PassClass>());
return *this;
}
@ -88,7 +85,12 @@ public:
// This can be useful when a pass is trivially preserved, but may not be
// 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
void setPreservesAll() { PreservesAll = true; }
@ -128,7 +130,7 @@ public:
inline PMDataManager &getPMDataManager() { return PM; }
// Find pass that is implementing PI.
Pass *findImplPass(AnalysisID PI) {
Pass *findImplPass(const PassInfo *PI) {
Pass *ResultPass = 0;
for (unsigned i = 0; i < AnalysisImpls.size() ; ++i) {
if (AnalysisImpls[i].first == PI) {
@ -140,10 +142,10 @@ public:
}
// 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) {
std::pair<AnalysisID, Pass*> pir = std::make_pair(PI,P);
void addAnalysisImplsPair(const PassInfo *PI, Pass *P) {
std::pair<const PassInfo*, Pass*> pir = std::make_pair(PI,P);
AnalysisImpls.push_back(pir);
}
@ -158,7 +160,7 @@ public:
// AnalysisImpls - This keeps track of which passes implements the interfaces
// 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:
// PassManager that is used to resolve analysis info
@ -177,7 +179,8 @@ template<typename AnalysisType>
AnalysisType *Pass::getAnalysisIfAvailable() const {
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);
if (ResultPass == 0) return 0;
@ -196,11 +199,11 @@ AnalysisType *Pass::getAnalysisIfAvailable() const {
template<typename AnalysisType>
AnalysisType &Pass::getAnalysis() const {
assert(Resolver && "Pass has not been inserted into a PassManager object!");
return getAnalysisID<AnalysisType>(&AnalysisType::ID);
return getAnalysisID<AnalysisType>(getClassPassInfo<AnalysisType>());
}
template<typename AnalysisType>
AnalysisType &Pass::getAnalysisID(AnalysisID PI) const {
AnalysisType &Pass::getAnalysisID(const PassInfo *PI) const {
assert(PI && "getAnalysis for unregistered pass!");
assert(Resolver&&"Pass has not been inserted into a PassManager object!");
// PI *must* appear in AnalysisImpls. Because the number of passes used
@ -226,11 +229,11 @@ template<typename AnalysisType>
AnalysisType &Pass::getAnalysis(Function &F) {
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>
AnalysisType &Pass::getAnalysisID(AnalysisID PI, Function &F) {
AnalysisType &Pass::getAnalysisID(const PassInfo *PI, Function &F) {
assert(PI && "getAnalysis for unregistered pass!");
assert(Resolver && "Pass has not been inserted into a PassManager object!");
// PI *must* appear in AnalysisImpls. Because the number of passes used

View File

@ -302,7 +302,7 @@ public:
/// through getAnalysis interface.
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.
void initializeAnalysisInfo() {
@ -414,7 +414,7 @@ class FPPassManager : public ModulePass, public PMDataManager {
public:
static char ID;
explicit FPPassManager(int Depth)
: ModulePass(ID), PMDataManager(Depth) { }
: ModulePass(&ID), PMDataManager(Depth) { }
/// 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.

View File

@ -34,7 +34,7 @@ class PassRegistry {
mutable sys::SmartMutex<true> Lock;
/// 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;
typedef StringMap<const PassInfo*> StringMapType;
@ -51,14 +51,14 @@ class PassRegistry {
public:
static PassRegistry *getPassRegistry();
const PassInfo *getPassInfo(const void *TI) const;
const PassInfo *getPassInfo(intptr_t TI) const;
const PassInfo *getPassInfo(StringRef Arg) const;
void registerPass(const PassInfo &PI);
void unregisterPass(const PassInfo &PI);
/// Analysis Group Mechanisms.
void registerAnalysisGroup(const void *InterfaceID, const void *PassID,
void registerAnalysisGroup(intptr_t InterfaceID, intptr_t PassID,
PassInfo& Registeree, bool isDefault);
void enumerateWith(PassRegistrationListener *L);

View File

@ -41,7 +41,7 @@ public:
private:
const char *const PassName; // Nice name for 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 IsAnalysis; // True if an analysis pass.
const bool IsAnalysisGroup; // True if an analysis group.
@ -52,7 +52,7 @@ private:
public:
/// PassInfo ctor - Do not call this directly, this should only be invoked
/// 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,
bool isCFGOnly = false, bool is_analysis = false)
: PassName(name), PassArgument(arg), PassID(pi),
@ -63,7 +63,7 @@ public:
/// PassInfo ctor - Do not call this directly, this should only be invoked
/// through RegisterPass. This version is for use by analysis groups; it
/// 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),
IsCFGOnlyPass(false),
IsAnalysis(false), IsAnalysisGroup(true), NormalCtor(0) {
@ -81,11 +81,11 @@ public:
/// getTypeInfo - Return the id object for the pass...
/// TODO : Rename
const void *getTypeInfo() const { return PassID; }
intptr_t getTypeInfo() const { return PassID; }
/// Return true if this PassID implements the specified ID pointer.
bool isPassID(const void *IDPtr) const {
return PassID == IDPtr;
bool isPassID(void *IDPtr) const {
return PassID == (intptr_t)IDPtr;
}
/// 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...
RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false,
bool is_analysis = false)
: PassInfo(Name, PassArg, &passName::ID,
: PassInfo(Name, PassArg, intptr_t(&passName::ID),
PassInfo::NormalCtor_t(callDefaultCtor<passName>),
CFGOnly, is_analysis) {
@ -191,8 +191,8 @@ struct RegisterPass : public PassInfo {
class RegisterAGBase : public PassInfo {
protected:
RegisterAGBase(const char *Name,
const void *InterfaceID,
const void *PassID = 0,
intptr_t InterfaceID,
intptr_t PassID = 0,
bool isDefault = false);
};
@ -200,12 +200,12 @@ template<typename Interface, bool Default = false>
struct RegisterAnalysisGroup : public RegisterAGBase {
explicit RegisterAnalysisGroup(PassInfo &RPB)
: RegisterAGBase(RPB.getPassName(),
&Interface::ID, RPB.getTypeInfo(),
intptr_t(&Interface::ID), RPB.getTypeInfo(),
Default) {
}
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().
explicit TargetData(StringRef TargetDescription)
: ImmutablePass(ID) {
: ImmutablePass(&ID) {
init(TargetDescription);
}
@ -118,7 +118,7 @@ public:
explicit TargetData(const Module *M);
TargetData(const TargetData &TD) :
ImmutablePass(ID),
ImmutablePass(&ID),
LittleEndian(TD.isLittleEndian()),
PointerMemSize(TD.PointerMemSize),
PointerABIAlign(TD.PointerABIAlign),

View File

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

View File

@ -149,7 +149,7 @@ Pass *createLoopIndexSplitPass();
// ret i32 %Y
//
FunctionPass *createPromoteMemoryToRegisterPass();
extern char &PromoteMemoryToRegisterID;
extern const PassInfo *const PromoteMemoryToRegisterID;
//===----------------------------------------------------------------------===//
//
@ -158,7 +158,7 @@ extern char &PromoteMemoryToRegisterID;
// hacking easier.
//
FunctionPass *createDemoteRegisterToMemoryPass();
extern char &DemoteRegisterToMemoryID;
extern const PassInfo *const DemoteRegisterToMemoryID;
//===----------------------------------------------------------------------===//
//
@ -202,7 +202,7 @@ FunctionPass *createCFGSimplificationPass();
// (set, immediate dominators, tree, and frontier) information.
//
FunctionPass *createBreakCriticalEdgesPass();
extern char &BreakCriticalEdgesID;
extern const PassInfo *const BreakCriticalEdgesID;
//===----------------------------------------------------------------------===//
//
@ -213,7 +213,7 @@ extern char &BreakCriticalEdgesID;
// AU.addRequiredID(LoopSimplifyID);
//
Pass *createLoopSimplifyPass();
extern char &LoopSimplifyID;
extern const PassInfo *const LoopSimplifyID;
//===----------------------------------------------------------------------===//
//
@ -228,7 +228,7 @@ FunctionPass *createTailCallEliminationPass();
// chained binary branch instructions.
//
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,
bool useExpensiveEHSupport);
extern char &LowerInvokePassID;
extern const PassInfo *const LowerInvokePassID;
//===----------------------------------------------------------------------===//
//
@ -258,7 +258,7 @@ FunctionPass *createBlockPlacementPass();
// optimizations.
//
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.
//
FunctionPass *createInstructionNamerPass();
extern char &InstructionNamerID;
extern const PassInfo *const InstructionNamerID;
//===----------------------------------------------------------------------===//
//

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -45,7 +45,7 @@ class CGPassManager : public ModulePass, public PMDataManager {
public:
static char ID;
explicit CGPassManager(int Depth)
: ModulePass(ID), PMDataManager(Depth) { }
: ModulePass(&ID), PMDataManager(Depth) { }
/// 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.
@ -582,9 +582,9 @@ namespace {
public:
static char ID;
PrintCallGraphPass() : CallGraphSCCPass(ID), Out(dbgs()) {}
PrintCallGraphPass() : CallGraphSCCPass(&ID), Out(dbgs()) {}
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 {
AU.setPreservesAll();

View File

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

View File

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

View File

@ -51,7 +51,7 @@ namespace {
}
public:
static char ID; // Pass identification, replacement for typeid
InstCount() : FunctionPass(ID) {}
InstCount() : FunctionPass(&ID) {}
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.
//
IntervalPartition::IntervalPartition(IntervalPartition &IP, bool)
: FunctionPass(ID) {
: FunctionPass(&ID) {
assert(IP.getRootInterval() && "Cannot operate on empty IntervalPartitions!");
// Pass false to intervals_begin because we take ownership of it's memory

View File

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

View File

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

View File

@ -30,9 +30,9 @@ private:
public:
static char ID;
PrintLoopPass() : LoopPass(ID), Out(dbgs()) {}
PrintLoopPass() : LoopPass(&ID), Out(dbgs()) {}
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 {
AU.setPreservesAll();
@ -59,7 +59,7 @@ char PrintLoopPass::ID = 0;
char LPPassManager::ID = 0;
LPPassManager::LPPassManager(int Depth)
: FunctionPass(ID), PMDataManager(Depth) {
: FunctionPass(&ID), PMDataManager(Depth) {
skipThisLoop = false;
redoThisLoop = false;
LI = NULL;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -34,14 +34,14 @@ namespace {
public:
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
/// an analysis interface through multiple inheritance. If needed, it
/// should override this to adjust the this pointer as needed for the
/// specified pass info.
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
if (PI == &AliasAnalysis::ID)
virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
if (PI->isPassID(&AliasAnalysis::ID))
return (AliasAnalysis*)this;
return this;
}

View File

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

View File

@ -21,7 +21,7 @@ namespace {
public:
static char ID; // Pass identification, replacement for typeid
explicit WriteBitcodePass(raw_ostream &o)
: ModulePass(ID), OS(o) {}
: ModulePass(&ID), OS(o) {}
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)
: MachineFunctionPass(ID),
: MachineFunctionPass(&ID),
TM(tm), MAI(tm.getMCAsmInfo()),
OutContext(Streamer.getContext()),
OutStreamer(Streamer),

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -29,7 +29,7 @@ struct MachineFunctionPrinterPass : public MachineFunctionPass {
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"; }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -40,7 +40,7 @@ char PHIElimination::ID = 0;
static RegisterPass<PHIElimination>
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 {
AU.addPreserved<LiveVariables>();

View File

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

View File

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

View File

@ -92,7 +92,7 @@ namespace {
public:
static char ID;
PreAllocSplitting()
: MachineFunctionPass(ID) {}
: MachineFunctionPass(&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF);
@ -206,7 +206,7 @@ char PreAllocSplitting::ID = 0;
static RegisterPass<PreAllocSplitting>
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
/// for spilling the current live interval. The index must be before any

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -171,7 +171,7 @@ TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
//===----------------------------------------------------------------------===//
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)),
CurDAG(new SelectionDAG(tm)),
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
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 {
AU.setPreservesCFG();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -39,7 +39,7 @@ using namespace llvm;
namespace {
struct StrongPHIElimination : public MachineFunctionPass {
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
// be inserted into that MBB
@ -154,7 +154,7 @@ static RegisterPass<StrongPHIElimination>
X("strong-phi-node-elimination",
"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
/// of the given MachineFunction. These numbers are then used in other parts

View File

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

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