mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-27 21:50:29 +00:00
Reapply r110396, with fixes to appease the Linux buildbot gods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e26a7b5e21
commit
90c579de5a
@ -22,7 +22,7 @@ template <class Analysis, bool Simple>
|
||||
struct DOTGraphTraitsViewer : public FunctionPass {
|
||||
std::string Name;
|
||||
|
||||
DOTGraphTraitsViewer(std::string GraphName, const void *ID) : FunctionPass(ID) {
|
||||
DOTGraphTraitsViewer(std::string GraphName, char &ID) : FunctionPass(ID) {
|
||||
Name = GraphName;
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ struct DOTGraphTraitsPrinter : public FunctionPass {
|
||||
|
||||
std::string Name;
|
||||
|
||||
DOTGraphTraitsPrinter(std::string GraphName, const void *ID)
|
||||
DOTGraphTraitsPrinter(std::string GraphName, char &ID)
|
||||
: FunctionPass(ID) {
|
||||
Name = GraphName;
|
||||
}
|
||||
|
@ -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(void *ID, bool isPostDom)
|
||||
DominanceFrontierBase(char &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!");
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
|
@ -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.
|
||||
|
@ -28,9 +28,9 @@ namespace llvm {
|
||||
LibCallInfo *LCI;
|
||||
|
||||
explicit LibCallAliasAnalysis(LibCallInfo *LC = 0)
|
||||
: FunctionPass(&ID), LCI(LC) {
|
||||
: FunctionPass(ID), LCI(LC) {
|
||||
}
|
||||
explicit LibCallAliasAnalysis(const void *ID, LibCallInfo *LC)
|
||||
explicit LibCallAliasAnalysis(char &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 PassInfo *PI) {
|
||||
if (PI->isPassID(&AliasAnalysis::ID))
|
||||
virtual void *getAdjustedAnalysisPointer(const void *PI) {
|
||||
if (PI == &AliasAnalysis::ID)
|
||||
return (AliasAnalysis*)this;
|
||||
return this;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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; }
|
||||
|
||||
|
@ -28,8 +28,7 @@ class PMStack;
|
||||
|
||||
class LoopPass : public Pass {
|
||||
public:
|
||||
explicit LoopPass(intptr_t pid) : Pass(PT_Loop, pid) {}
|
||||
explicit LoopPass(void *pid) : Pass(PT_Loop, pid) {}
|
||||
explicit LoopPass(char &pid) : Pass(PT_Loop, pid) {}
|
||||
|
||||
/// getPrinterPass - Get a pass to print the function corresponding
|
||||
/// to a Loop.
|
||||
|
@ -92,7 +92,7 @@ namespace llvm {
|
||||
// file.
|
||||
//
|
||||
ModulePass *createProfileLoaderPass();
|
||||
extern const PassInfo *ProfileLoaderPassID;
|
||||
extern char &ProfileLoaderPassID;
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
//
|
||||
@ -106,7 +106,7 @@ namespace llvm {
|
||||
// instead of loading it from a previous run.
|
||||
//
|
||||
FunctionPass *createProfileEstimatorPass();
|
||||
extern const PassInfo *ProfileEstimatorPassID;
|
||||
extern char &ProfileEstimatorPassID;
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
//
|
||||
|
@ -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();
|
||||
|
@ -33,8 +33,7 @@ class CallGraphSCC;
|
||||
|
||||
class CallGraphSCCPass : public Pass {
|
||||
public:
|
||||
explicit CallGraphSCCPass(intptr_t pid) : Pass(PT_CallGraphSCC, pid) {}
|
||||
explicit CallGraphSCCPass(void *pid) : Pass(PT_CallGraphSCC, pid) {}
|
||||
explicit CallGraphSCCPass(char &pid) : Pass(PT_CallGraphSCC, pid) {}
|
||||
|
||||
/// createPrinterPass - Get a pass that prints the Module
|
||||
/// corresponding to a CallGraph.
|
||||
|
@ -23,7 +23,7 @@ namespace llvm {
|
||||
public:
|
||||
static char ID;
|
||||
|
||||
CalculateSpillWeights() : MachineFunctionPass(&ID) {}
|
||||
CalculateSpillWeights() : MachineFunctionPass(ID) {}
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &au) const;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -31,8 +31,7 @@ class MachineFunction;
|
||||
/// override runOnMachineFunction.
|
||||
class MachineFunctionPass : public FunctionPass {
|
||||
protected:
|
||||
explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {}
|
||||
explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {}
|
||||
explicit MachineFunctionPass(char &ID) : FunctionPass(ID) {}
|
||||
|
||||
/// runOnMachineFunction - This method must be overloaded to perform the
|
||||
/// desired machine code transformation or analysis.
|
||||
|
@ -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; }
|
||||
|
||||
|
@ -43,18 +43,18 @@ namespace llvm {
|
||||
|
||||
/// MachineLoopInfo pass - This pass is a loop analysis pass.
|
||||
///
|
||||
extern const PassInfo *const MachineLoopInfoID;
|
||||
extern char &MachineLoopInfoID;
|
||||
|
||||
/// MachineDominators pass - This pass is a machine dominators analysis pass.
|
||||
///
|
||||
extern const PassInfo *const MachineDominatorsID;
|
||||
extern char &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 const PassInfo *const PHIEliminationID;
|
||||
extern char &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 const PassInfo *const StrongPHIEliminationID;
|
||||
extern char &StrongPHIEliminationID;
|
||||
|
||||
extern const PassInfo *const PreAllocSplittingID;
|
||||
extern char &PreAllocSplittingID;
|
||||
|
||||
/// SimpleRegisterCoalescing pass. Aggressively coalesces every register
|
||||
/// copy it can.
|
||||
///
|
||||
extern const PassInfo *const SimpleRegisterCoalescingID;
|
||||
extern char &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 const PassInfo *const TwoAddressInstructionPassID;
|
||||
extern char &TwoAddressInstructionPassID;
|
||||
|
||||
/// UnreachableMachineBlockElimination pass - This pass removes unreachable
|
||||
/// machine basic blocks.
|
||||
extern const PassInfo *const UnreachableMachineBlockElimID;
|
||||
extern char &UnreachableMachineBlockElimID;
|
||||
|
||||
/// DeadMachineInstructionElim pass - This pass removes dead machine
|
||||
/// instructions.
|
||||
|
@ -31,7 +31,7 @@ namespace llvm {
|
||||
public:
|
||||
static char ID;
|
||||
|
||||
ProcessImplicitDefs() : MachineFunctionPass(&ID) {}
|
||||
ProcessImplicitDefs() : MachineFunctionPass(ID) {}
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &au) const;
|
||||
|
||||
|
@ -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();
|
||||
|
@ -50,7 +50,7 @@ class raw_ostream;
|
||||
class StringRef;
|
||||
|
||||
// AnalysisID - Use the PassInfo to identify a pass...
|
||||
typedef const PassInfo* AnalysisID;
|
||||
typedef const void* AnalysisID;
|
||||
|
||||
/// Different types of internal pass managers. External pass managers
|
||||
/// (PassManager and FunctionPassManager) are not represented here.
|
||||
@ -82,14 +82,13 @@ enum PassKind {
|
||||
///
|
||||
class Pass {
|
||||
AnalysisResolver *Resolver; // Used to resolve analysis
|
||||
intptr_t PassID;
|
||||
const void *PassID;
|
||||
PassKind Kind;
|
||||
void operator=(const Pass&); // DO NOT IMPLEMENT
|
||||
Pass(const Pass &); // DO NOT IMPLEMENT
|
||||
|
||||
public:
|
||||
explicit Pass(PassKind K, intptr_t pid);
|
||||
explicit Pass(PassKind K, const void *pid);
|
||||
explicit Pass(PassKind K, char &pid);
|
||||
virtual ~Pass();
|
||||
|
||||
|
||||
@ -101,10 +100,10 @@ public:
|
||||
///
|
||||
virtual const char *getPassName() const;
|
||||
|
||||
/// 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;
|
||||
/// getPassID - Return the PassID number that corresponds to this pass.
|
||||
virtual AnalysisID getPassID() const {
|
||||
return PassID;
|
||||
}
|
||||
|
||||
/// 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
|
||||
@ -159,7 +158,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(const PassInfo *);
|
||||
virtual void *getAdjustedAnalysisPointer(AnalysisID ID);
|
||||
virtual ImmutablePass *getAsImmutablePass();
|
||||
virtual PMDataManager *getAsPMDataManager();
|
||||
|
||||
@ -170,14 +169,9 @@ 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(intptr_t TI);
|
||||
static const PassInfo *lookupPassInfo(const void *TI);
|
||||
|
||||
// lookupPassInfo - Return the pass info object for the pass with the given
|
||||
// argument string, or null if it is not known.
|
||||
@ -200,7 +194,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(const PassInfo *AnalysisID) const;
|
||||
bool mustPreserveAnalysisID(char &AID) const;
|
||||
|
||||
/// getAnalysis<AnalysisType>() - This function is used by subclasses to get
|
||||
/// to the analysis information that they claim to use by overriding the
|
||||
@ -213,10 +207,10 @@ public:
|
||||
AnalysisType &getAnalysis(Function &F); // Defined in PassAnalysisSupport.h
|
||||
|
||||
template<typename AnalysisType>
|
||||
AnalysisType &getAnalysisID(const PassInfo *PI) const;
|
||||
AnalysisType &getAnalysisID(AnalysisID PI) const;
|
||||
|
||||
template<typename AnalysisType>
|
||||
AnalysisType &getAnalysisID(const PassInfo *PI, Function &F);
|
||||
AnalysisType &getAnalysisID(AnalysisID PI, Function &F);
|
||||
};
|
||||
|
||||
|
||||
@ -240,8 +234,7 @@ public:
|
||||
/// Return what kind of Pass Manager can manage this pass.
|
||||
virtual PassManagerType getPotentialPassManagerType() const;
|
||||
|
||||
explicit ModulePass(intptr_t pid) : Pass(PT_Module, pid) {}
|
||||
explicit ModulePass(const void *pid) : Pass(PT_Module, pid) {}
|
||||
explicit ModulePass(char &pid) : Pass(PT_Module, pid) {}
|
||||
// Force out-of-line virtual method.
|
||||
virtual ~ModulePass();
|
||||
};
|
||||
@ -268,8 +261,7 @@ public:
|
||||
///
|
||||
bool runOnModule(Module &) { return false; }
|
||||
|
||||
explicit ImmutablePass(intptr_t pid) : ModulePass(pid) {}
|
||||
explicit ImmutablePass(const void *pid)
|
||||
explicit ImmutablePass(char &pid)
|
||||
: ModulePass(pid) {}
|
||||
|
||||
// Force out-of-line virtual method.
|
||||
@ -287,8 +279,7 @@ public:
|
||||
///
|
||||
class FunctionPass : public Pass {
|
||||
public:
|
||||
explicit FunctionPass(intptr_t pid) : Pass(PT_Function, pid) {}
|
||||
explicit FunctionPass(const void *pid) : Pass(PT_Function, pid) {}
|
||||
explicit FunctionPass(char &pid) : Pass(PT_Function, pid) {}
|
||||
|
||||
/// createPrinterPass - Get a function printer pass.
|
||||
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
|
||||
@ -340,8 +331,7 @@ public:
|
||||
///
|
||||
class BasicBlockPass : public Pass {
|
||||
public:
|
||||
explicit BasicBlockPass(intptr_t pid) : Pass(PT_BasicBlock, pid) {}
|
||||
explicit BasicBlockPass(const void *pid) : Pass(PT_BasicBlock, pid) {}
|
||||
explicit BasicBlockPass(char &pid) : Pass(PT_BasicBlock, pid) {}
|
||||
|
||||
/// createPrinterPass - Get a function printer pass.
|
||||
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
|
||||
|
@ -49,34 +49,37 @@ public:
|
||||
// addRequired - Add the specified ID to the required set of the usage info
|
||||
// for a pass.
|
||||
//
|
||||
AnalysisUsage &addRequiredID(AnalysisID ID);
|
||||
AnalysisUsage &addRequiredID(const void *ID);
|
||||
AnalysisUsage &addRequiredID(char &ID);
|
||||
template<class PassClass>
|
||||
AnalysisUsage &addRequired() {
|
||||
return addRequiredID(Pass::getClassPassInfo<PassClass>());
|
||||
return addRequiredID(PassClass::ID);
|
||||
}
|
||||
|
||||
AnalysisUsage &addRequiredTransitiveID(AnalysisID ID);
|
||||
AnalysisUsage &addRequiredTransitiveID(char &ID);
|
||||
template<class PassClass>
|
||||
AnalysisUsage &addRequiredTransitive() {
|
||||
AnalysisID ID = Pass::getClassPassInfo<PassClass>();
|
||||
return addRequiredTransitiveID(ID);
|
||||
return addRequiredTransitiveID(PassClass::ID);
|
||||
}
|
||||
|
||||
// addPreserved - Add the specified ID to the set of analyses preserved by
|
||||
// this pass
|
||||
//
|
||||
AnalysisUsage &addPreservedID(AnalysisID ID) {
|
||||
AnalysisUsage &addPreservedID(const void *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() {
|
||||
assert(Pass::getClassPassInfo<PassClass>() && "Pass class not registered!");
|
||||
Preserved.push_back(Pass::getClassPassInfo<PassClass>());
|
||||
Preserved.push_back(&PassClass::ID);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -85,12 +88,7 @@ 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) {
|
||||
const PassInfo *PI = Pass::lookupPassInfo(Arg);
|
||||
// If the pass exists, preserve it. Otherwise silently do nothing.
|
||||
if (PI) Preserved.push_back(PI);
|
||||
return *this;
|
||||
}
|
||||
AnalysisUsage &addPreserved(StringRef Arg);
|
||||
|
||||
// setPreservesAll - Set by analyses that do not transform their input at all
|
||||
void setPreservesAll() { PreservesAll = true; }
|
||||
@ -130,7 +128,7 @@ public:
|
||||
inline PMDataManager &getPMDataManager() { return PM; }
|
||||
|
||||
// Find pass that is implementing PI.
|
||||
Pass *findImplPass(const PassInfo *PI) {
|
||||
Pass *findImplPass(AnalysisID PI) {
|
||||
Pass *ResultPass = 0;
|
||||
for (unsigned i = 0; i < AnalysisImpls.size() ; ++i) {
|
||||
if (AnalysisImpls[i].first == PI) {
|
||||
@ -142,10 +140,10 @@ public:
|
||||
}
|
||||
|
||||
// Find pass that is implementing PI. Initialize pass for Function F.
|
||||
Pass *findImplPass(Pass *P, const PassInfo *PI, Function &F);
|
||||
Pass *findImplPass(Pass *P, AnalysisID PI, Function &F);
|
||||
|
||||
void addAnalysisImplsPair(const PassInfo *PI, Pass *P) {
|
||||
std::pair<const PassInfo*, Pass*> pir = std::make_pair(PI,P);
|
||||
void addAnalysisImplsPair(AnalysisID PI, Pass *P) {
|
||||
std::pair<AnalysisID, Pass*> pir = std::make_pair(PI,P);
|
||||
AnalysisImpls.push_back(pir);
|
||||
}
|
||||
|
||||
@ -160,7 +158,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<const PassInfo*, Pass*> > AnalysisImpls;
|
||||
std::vector<std::pair<AnalysisID, Pass*> > AnalysisImpls;
|
||||
|
||||
private:
|
||||
// PassManager that is used to resolve analysis info
|
||||
@ -179,8 +177,7 @@ template<typename AnalysisType>
|
||||
AnalysisType *Pass::getAnalysisIfAvailable() const {
|
||||
assert(Resolver && "Pass not resident in a PassManager object!");
|
||||
|
||||
const PassInfo *PI = getClassPassInfo<AnalysisType>();
|
||||
if (PI == 0) return 0;
|
||||
const void *PI = &AnalysisType::ID;
|
||||
|
||||
Pass *ResultPass = Resolver->getAnalysisIfAvailable(PI, true);
|
||||
if (ResultPass == 0) return 0;
|
||||
@ -199,11 +196,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>(getClassPassInfo<AnalysisType>());
|
||||
return getAnalysisID<AnalysisType>(&AnalysisType::ID);
|
||||
}
|
||||
|
||||
template<typename AnalysisType>
|
||||
AnalysisType &Pass::getAnalysisID(const PassInfo *PI) const {
|
||||
AnalysisType &Pass::getAnalysisID(AnalysisID 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
|
||||
@ -229,11 +226,11 @@ template<typename AnalysisType>
|
||||
AnalysisType &Pass::getAnalysis(Function &F) {
|
||||
assert(Resolver &&"Pass has not been inserted into a PassManager object!");
|
||||
|
||||
return getAnalysisID<AnalysisType>(getClassPassInfo<AnalysisType>(), F);
|
||||
return getAnalysisID<AnalysisType>(&AnalysisType::ID, F);
|
||||
}
|
||||
|
||||
template<typename AnalysisType>
|
||||
AnalysisType &Pass::getAnalysisID(const PassInfo *PI, Function &F) {
|
||||
AnalysisType &Pass::getAnalysisID(AnalysisID 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
|
||||
|
@ -302,7 +302,7 @@ public:
|
||||
/// through getAnalysis interface.
|
||||
virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass);
|
||||
|
||||
virtual Pass *getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F);
|
||||
virtual Pass *getOnTheFlyPass(Pass *P, AnalysisID 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.
|
||||
|
@ -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<intptr_t, const PassInfo*> MapType;
|
||||
typedef std::map<const void*, const PassInfo*> MapType;
|
||||
MapType PassInfoMap;
|
||||
|
||||
typedef StringMap<const PassInfo*> StringMapType;
|
||||
@ -51,14 +51,14 @@ class PassRegistry {
|
||||
public:
|
||||
static PassRegistry *getPassRegistry();
|
||||
|
||||
const PassInfo *getPassInfo(intptr_t TI) const;
|
||||
const PassInfo *getPassInfo(const void *TI) const;
|
||||
const PassInfo *getPassInfo(StringRef Arg) const;
|
||||
|
||||
void registerPass(const PassInfo &PI);
|
||||
void unregisterPass(const PassInfo &PI);
|
||||
|
||||
/// Analysis Group Mechanisms.
|
||||
void registerAnalysisGroup(intptr_t InterfaceID, intptr_t PassID,
|
||||
void registerAnalysisGroup(const void *InterfaceID, const void *PassID,
|
||||
PassInfo& Registeree, bool isDefault);
|
||||
|
||||
void enumerateWith(PassRegistrationListener *L);
|
||||
|
@ -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 intptr_t PassID;
|
||||
const void *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, intptr_t pi,
|
||||
PassInfo(const char *name, const char *arg, const void *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, intptr_t pi)
|
||||
PassInfo(const char *name, const void *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
|
||||
intptr_t getTypeInfo() const { return PassID; }
|
||||
const void *getTypeInfo() const { return PassID; }
|
||||
|
||||
/// Return true if this PassID implements the specified ID pointer.
|
||||
bool isPassID(void *IDPtr) const {
|
||||
return PassID == (intptr_t)IDPtr;
|
||||
bool isPassID(const void *IDPtr) const {
|
||||
return PassID == 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, intptr_t(&passName::ID),
|
||||
: PassInfo(Name, PassArg, &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,
|
||||
intptr_t InterfaceID,
|
||||
intptr_t PassID = 0,
|
||||
const void *InterfaceID,
|
||||
const void *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(),
|
||||
intptr_t(&Interface::ID), RPB.getTypeInfo(),
|
||||
&Interface::ID, RPB.getTypeInfo(),
|
||||
Default) {
|
||||
}
|
||||
|
||||
explicit RegisterAnalysisGroup(const char *Name)
|
||||
: RegisterAGBase(Name, intptr_t(&Interface::ID)) {
|
||||
: RegisterAGBase(Name, &Interface::ID) {
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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),
|
||||
|
@ -30,8 +30,8 @@ namespace llvm {
|
||||
/// perform the inlining operations that do not depend on the policy.
|
||||
///
|
||||
struct Inliner : public CallGraphSCCPass {
|
||||
explicit Inliner(void *ID);
|
||||
explicit Inliner(void *ID, int Threshold);
|
||||
explicit Inliner(char &ID);
|
||||
explicit Inliner(char &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
|
||||
|
@ -149,7 +149,7 @@ Pass *createLoopIndexSplitPass();
|
||||
// ret i32 %Y
|
||||
//
|
||||
FunctionPass *createPromoteMemoryToRegisterPass();
|
||||
extern const PassInfo *const PromoteMemoryToRegisterID;
|
||||
extern char &PromoteMemoryToRegisterID;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@ -158,7 +158,7 @@ extern const PassInfo *const PromoteMemoryToRegisterID;
|
||||
// hacking easier.
|
||||
//
|
||||
FunctionPass *createDemoteRegisterToMemoryPass();
|
||||
extern const PassInfo *const DemoteRegisterToMemoryID;
|
||||
extern char &DemoteRegisterToMemoryID;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@ -202,7 +202,7 @@ FunctionPass *createCFGSimplificationPass();
|
||||
// (set, immediate dominators, tree, and frontier) information.
|
||||
//
|
||||
FunctionPass *createBreakCriticalEdgesPass();
|
||||
extern const PassInfo *const BreakCriticalEdgesID;
|
||||
extern char &BreakCriticalEdgesID;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@ -213,7 +213,7 @@ extern const PassInfo *const BreakCriticalEdgesID;
|
||||
// AU.addRequiredID(LoopSimplifyID);
|
||||
//
|
||||
Pass *createLoopSimplifyPass();
|
||||
extern const PassInfo *const LoopSimplifyID;
|
||||
extern char &LoopSimplifyID;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@ -228,7 +228,7 @@ FunctionPass *createTailCallEliminationPass();
|
||||
// chained binary branch instructions.
|
||||
//
|
||||
FunctionPass *createLowerSwitchPass();
|
||||
extern const PassInfo *const LowerSwitchID;
|
||||
extern char &LowerSwitchID;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@ -243,7 +243,7 @@ extern const PassInfo *const LowerSwitchID;
|
||||
FunctionPass *createLowerInvokePass(const TargetLowering *TLI = 0);
|
||||
FunctionPass *createLowerInvokePass(const TargetLowering *TLI,
|
||||
bool useExpensiveEHSupport);
|
||||
extern const PassInfo *const LowerInvokePassID;
|
||||
extern char &LowerInvokePassID;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@ -258,7 +258,7 @@ FunctionPass *createBlockPlacementPass();
|
||||
// optimizations.
|
||||
//
|
||||
Pass *createLCSSAPass();
|
||||
extern const PassInfo *const LCSSAID;
|
||||
extern char &LCSSAID;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@ -304,7 +304,7 @@ FunctionPass *createCodeGenPreparePass(const TargetLowering *TLI = 0);
|
||||
// InstructionNamer - Give any unnamed non-void instructions "tmp" names.
|
||||
//
|
||||
FunctionPass *createInstructionNamerPass();
|
||||
extern const PassInfo *const InstructionNamerID;
|
||||
extern char &InstructionNamerID;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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(const PassInfo *PI) {
|
||||
if (PI->isPassID(&AliasAnalysis::ID))
|
||||
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
|
||||
if (PI == &AliasAnalysis::ID)
|
||||
return (AliasAnalysis*)this;
|
||||
return this;
|
||||
}
|
||||
|
@ -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>();
|
||||
|
@ -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(const PassInfo *PI) {
|
||||
if (PI->isPassID(&AliasAnalysis::ID))
|
||||
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
|
||||
if (PI == &AliasAnalysis::ID)
|
||||
return (AliasAnalysis*)this;
|
||||
return this;
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -137,8 +137,8 @@ namespace {
|
||||
///
|
||||
struct NoAA : public ImmutablePass, public AliasAnalysis {
|
||||
static char ID; // Class identification, replacement for typeinfo
|
||||
NoAA() : ImmutablePass(&ID) {}
|
||||
explicit NoAA(void *PID) : ImmutablePass(PID) { }
|
||||
NoAA() : ImmutablePass(ID) {}
|
||||
explicit NoAA(char &PID) : ImmutablePass(PID) { }
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
}
|
||||
@ -176,8 +176,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(const PassInfo *PI) {
|
||||
if (PI->isPassID(&AliasAnalysis::ID))
|
||||
virtual void *getAdjustedAnalysisPointer(const void *ID) {
|
||||
if (ID == &AliasAnalysis::ID)
|
||||
return (AliasAnalysis*)this;
|
||||
return this;
|
||||
}
|
||||
@ -222,7 +222,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) {}
|
||||
|
||||
virtual AliasResult alias(const Value *V1, unsigned V1Size,
|
||||
const Value *V2, unsigned V2Size) {
|
||||
@ -259,8 +259,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(const PassInfo *PI) {
|
||||
if (PI->isPassID(&AliasAnalysis::ID))
|
||||
virtual void *getAdjustedAnalysisPointer(const void *ID) {
|
||||
if (ID == &AliasAnalysis::ID)
|
||||
return (AliasAnalysis*)this;
|
||||
return this;
|
||||
}
|
||||
|
@ -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(void *pid) : FunctionPass(pid) {}
|
||||
CFGPrinter() : FunctionPass(ID) {}
|
||||
explicit CFGPrinter(char &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(void *pid) : FunctionPass(pid) {}
|
||||
CFGOnlyPrinter() : FunctionPass(ID) {}
|
||||
explicit CFGOnlyPrinter(char &pid) : FunctionPass(pid) {}
|
||||
virtual bool runOnFunction(Function &F) {
|
||||
std::string Filename = "cfg." + F.getNameStr() + ".dot";
|
||||
errs() << "Writing '" << Filename << "'...";
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
||||
|
@ -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(const PassInfo *PI) {
|
||||
if (PI->isPassID(&CallGraph::ID))
|
||||
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
|
||||
if (PI == &CallGraph::ID)
|
||||
return (CallGraph*)this;
|
||||
return this;
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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(const PassInfo *PI) {
|
||||
if (PI->isPassID(&AliasAnalysis::ID))
|
||||
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
|
||||
if (PI == &AliasAnalysis::ID)
|
||||
return (AliasAnalysis*)this;
|
||||
return this;
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ IVStrideUse &IVUsers::AddUser(Instruction *User, Value *Operand) {
|
||||
}
|
||||
|
||||
IVUsers::IVUsers()
|
||||
: LoopPass(&ID) {
|
||||
: LoopPass(ID) {
|
||||
}
|
||||
|
||||
void IVUsers::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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>();
|
||||
|
@ -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;
|
||||
|
@ -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() {
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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(const PassInfo *PI) {
|
||||
if (PI->isPassID(&ProfileInfo::ID))
|
||||
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
|
||||
if (PI == &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 {
|
||||
const PassInfo *ProfileEstimatorPassID = &X;
|
||||
char &ProfileEstimatorPassID = ProfileEstimatorPass::ID;
|
||||
|
||||
FunctionPass *createProfileEstimatorPass() {
|
||||
return new ProfileEstimatorPass();
|
||||
|
@ -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(const PassInfo *PI) {
|
||||
if (PI->isPassID(&ProfileInfo::ID))
|
||||
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
|
||||
if (PI == &ProfileInfo::ID)
|
||||
return (ProfileInfo*)this;
|
||||
return this;
|
||||
}
|
||||
|
@ -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(const PassInfo *PI) {
|
||||
if (PI->isPassID(&ProfileInfo::ID))
|
||||
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
|
||||
if (PI == &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);
|
||||
|
||||
const PassInfo *llvm::ProfileLoaderPassID = &X;
|
||||
char &llvm::ProfileLoaderPassID = LoaderPass::ID;
|
||||
|
||||
ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); }
|
||||
|
||||
|
@ -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) {
|
||||
}
|
||||
|
||||
|
@ -589,7 +589,7 @@ void RegionInfo::releaseMemory() {
|
||||
TopLevelRegion = 0;
|
||||
}
|
||||
|
||||
RegionInfo::RegionInfo() : FunctionPass(&ID) {
|
||||
RegionInfo::RegionInfo() : FunctionPass(ID) {
|
||||
TopLevelRegion = 0;
|
||||
}
|
||||
|
||||
|
@ -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) {}
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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(const PassInfo *PI) {
|
||||
if (PI->isPassID(&AliasAnalysis::ID))
|
||||
virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
|
||||
if (PI == &AliasAnalysis::ID)
|
||||
return (AliasAnalysis*)this;
|
||||
return this;
|
||||
}
|
||||
|
@ -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 PassInfo *PI) {
|
||||
if (PI->isPassID(&AliasAnalysis::ID))
|
||||
virtual void *getAdjustedAnalysisPointer(const void *PI) {
|
||||
if (PI == &AliasAnalysis::ID)
|
||||
return (AliasAnalysis*)this;
|
||||
return this;
|
||||
}
|
||||
|
@ -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"; }
|
||||
|
||||
|
@ -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),
|
||||
|
@ -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"; }
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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) {}
|
||||
|
@ -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),
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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"; }
|
||||
|
@ -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";
|
||||
|
@ -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);
|
||||
|
||||
|
@ -27,7 +27,7 @@ char MachineDominatorTree::ID = 0;
|
||||
static RegisterPass<MachineDominatorTree>
|
||||
E("machinedomtree", "MachineDominator Tree Construction", true);
|
||||
|
||||
const PassInfo *const llvm::MachineDominatorsID = &E;
|
||||
char &llvm::MachineDominatorsID = MachineDominatorTree::ID;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -20,14 +20,14 @@ using namespace llvm;
|
||||
// a default constructor.
|
||||
static PassInfo
|
||||
X("Machine Function Analysis", "machine-function-analysis",
|
||||
intptr_t(&MachineFunctionAnalysis::ID), 0,
|
||||
&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() {
|
||||
|
@ -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"; }
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -33,7 +33,7 @@ char MachineLoopInfo::ID = 0;
|
||||
static RegisterPass<MachineLoopInfo>
|
||||
X("machine-loops", "Machine Natural Loop Construction", true);
|
||||
|
||||
const PassInfo *const llvm::MachineLoopInfoID = &X;
|
||||
char &llvm::MachineLoopInfoID = MachineLoopInfo::ID;
|
||||
|
||||
bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) {
|
||||
releaseMemory();
|
||||
|
@ -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();
|
||||
|
@ -44,7 +44,7 @@ namespace {
|
||||
|
||||
public:
|
||||
static char ID; // Pass identification
|
||||
MachineSinking() : MachineFunctionPass(&ID) {}
|
||||
MachineSinking() : MachineFunctionPass(ID) {}
|
||||
|
||||
virtual bool runOnMachineFunction(MachineFunction &MF);
|
||||
|
||||
|
@ -195,7 +195,7 @@ namespace {
|
||||
static char ID; // Pass ID, replacement for typeid
|
||||
|
||||
MachineVerifierPass()
|
||||
: MachineFunctionPass(&ID) {}
|
||||
: MachineFunctionPass(ID) {}
|
||||
|
||||
void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.setPreservesAll();
|
||||
|
@ -46,7 +46,7 @@ namespace {
|
||||
|
||||
public:
|
||||
static char ID; // Pass identification
|
||||
OptimizeCmps() : MachineFunctionPass(&ID) {}
|
||||
OptimizeCmps() : MachineFunctionPass(ID) {}
|
||||
|
||||
virtual bool runOnMachineFunction(MachineFunction &MF);
|
||||
|
||||
|
@ -43,7 +43,7 @@ namespace {
|
||||
|
||||
public:
|
||||
static char ID; // Pass identification
|
||||
OptimizeExts() : MachineFunctionPass(&ID) {}
|
||||
OptimizeExts() : MachineFunctionPass(ID) {}
|
||||
|
||||
virtual bool runOnMachineFunction(MachineFunction &MF);
|
||||
|
||||
|
@ -33,7 +33,7 @@ namespace {
|
||||
|
||||
public:
|
||||
static char ID; // Pass identification
|
||||
OptimizePHIs() : MachineFunctionPass(&ID) {}
|
||||
OptimizePHIs() : MachineFunctionPass(ID) {}
|
||||
|
||||
virtual bool runOnMachineFunction(MachineFunction &MF);
|
||||
|
||||
|
@ -40,7 +40,7 @@ char PHIElimination::ID = 0;
|
||||
static RegisterPass<PHIElimination>
|
||||
X("phi-node-elimination", "Eliminate PHI nodes for register allocation");
|
||||
|
||||
const PassInfo *const llvm::PHIEliminationID = &X;
|
||||
char &llvm::PHIEliminationID = PHIElimination::ID;
|
||||
|
||||
void llvm::PHIElimination::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.addPreserved<LiveVariables>();
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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");
|
||||
|
||||
const PassInfo *const llvm::PreAllocSplittingID = &X;
|
||||
char &llvm::PreAllocSplittingID = PreAllocSplitting::ID;
|
||||
|
||||
/// 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
|
||||
|
@ -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";
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -198,7 +198,7 @@ namespace llvm {
|
||||
public:
|
||||
static char ID;
|
||||
|
||||
RenderMachineFunction() : MachineFunctionPass(&ID) {}
|
||||
RenderMachineFunction() : MachineFunctionPass(ID) {}
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &au) const;
|
||||
|
||||
|
@ -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)),
|
||||
|
@ -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);
|
||||
|
||||
const PassInfo *const llvm::SimpleRegisterCoalescingID = &X;
|
||||
char &llvm::SimpleRegisterCoalescingID = SimpleRegisterCoalescing::ID;
|
||||
|
||||
void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.setPreservesCFG();
|
||||
|
@ -64,7 +64,7 @@ namespace llvm {
|
||||
|
||||
public:
|
||||
static char ID; // Pass identifcation, replacement for typeid
|
||||
SimpleRegisterCoalescing() : MachineFunctionPass(&ID) {}
|
||||
SimpleRegisterCoalescing() : MachineFunctionPass(ID) {}
|
||||
|
||||
struct InstrSlots {
|
||||
enum {
|
||||
|
@ -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);
|
||||
|
||||
|
@ -36,7 +36,7 @@ namespace llvm {
|
||||
public:
|
||||
static char ID;
|
||||
|
||||
LoopSplitter() : MachineFunctionPass(&ID) {}
|
||||
LoopSplitter() : MachineFunctionPass(ID) {}
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &au) const;
|
||||
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -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();
|
||||
|
@ -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");
|
||||
|
||||
const PassInfo *const llvm::StrongPHIEliminationID = &X;
|
||||
char &llvm::StrongPHIEliminationID = StrongPHIElimination::ID;
|
||||
|
||||
/// 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
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user