mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 12:19:53 +00:00
adopt getAdjustedAnalysisPointer in a few more passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94018 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fc570e4bff
commit
1bc76d48d4
@ -85,6 +85,16 @@ namespace {
|
|||||||
AU.setPreservesAll();
|
AU.setPreservesAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 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))
|
||||||
|
return (AliasAnalysis*)this;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: We could count these too...
|
// FIXME: We could count these too...
|
||||||
bool pointsToConstantMemory(const Value *P) {
|
bool pointsToConstantMemory(const Value *P) {
|
||||||
return getAnalysis<AliasAnalysis>().pointsToConstantMemory(P);
|
return getAnalysis<AliasAnalysis>().pointsToConstantMemory(P);
|
||||||
|
@ -71,6 +71,16 @@ namespace {
|
|||||||
AU.setPreservesAll(); // Does not transform code
|
AU.setPreservesAll(); // Does not transform code
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 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))
|
||||||
|
return (AliasAnalysis*)this;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
// Implement the AliasAnalysis API
|
// Implement the AliasAnalysis API
|
||||||
//
|
//
|
||||||
|
@ -55,6 +55,16 @@ namespace {
|
|||||||
/// run - Estimate the profile information from the specified file.
|
/// run - Estimate the profile information from the specified file.
|
||||||
virtual bool runOnFunction(Function &F);
|
virtual bool runOnFunction(Function &F);
|
||||||
|
|
||||||
|
/// 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))
|
||||||
|
return (ProfileInfo*)this;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
virtual void recurseBasicBlock(BasicBlock *BB);
|
virtual void recurseBasicBlock(BasicBlock *BB);
|
||||||
|
|
||||||
void inline printEdgeWeight(Edge);
|
void inline printEdgeWeight(Edge);
|
||||||
|
@ -1079,6 +1079,20 @@ namespace {
|
|||||||
struct NoProfileInfo : public ImmutablePass, public ProfileInfo {
|
struct NoProfileInfo : public ImmutablePass, public ProfileInfo {
|
||||||
static char ID; // Class identification, replacement for typeinfo
|
static char ID; // Class identification, replacement for typeinfo
|
||||||
NoProfileInfo() : ImmutablePass(&ID) {}
|
NoProfileInfo() : ImmutablePass(&ID) {}
|
||||||
|
|
||||||
|
/// getAdjustedAnalysisPointer - This method is used when a pass implements
|
||||||
|
/// 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))
|
||||||
|
return (ProfileInfo*)this;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual const char *getPassName() const {
|
||||||
|
return "NoProfileInfo";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
} // End of anonymous namespace
|
} // End of anonymous namespace
|
||||||
|
|
||||||
|
@ -63,6 +63,16 @@ namespace {
|
|||||||
virtual void readEdgeOrRemember(Edge, Edge&, unsigned &, double &);
|
virtual void readEdgeOrRemember(Edge, Edge&, unsigned &, double &);
|
||||||
virtual void readEdge(ProfileInfo::Edge, std::vector<unsigned>&);
|
virtual void readEdge(ProfileInfo::Edge, std::vector<unsigned>&);
|
||||||
|
|
||||||
|
/// 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))
|
||||||
|
return (ProfileInfo*)this;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/// run - Load the profile information from the specified file.
|
/// run - Load the profile information from the specified file.
|
||||||
virtual bool runOnModule(Module &M);
|
virtual bool runOnModule(Module &M);
|
||||||
};
|
};
|
||||||
|
@ -32,6 +32,16 @@ namespace {
|
|||||||
static char ID; // Class identification, replacement for typeinfo
|
static char ID; // Class identification, replacement for typeinfo
|
||||||
ScalarEvolutionAliasAnalysis() : FunctionPass(&ID), SE(0) {}
|
ScalarEvolutionAliasAnalysis() : FunctionPass(&ID), SE(0) {}
|
||||||
|
|
||||||
|
/// getAdjustedAnalysisPointer - This method is used when a pass implements
|
||||||
|
/// 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))
|
||||||
|
return (AliasAnalysis*)this;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
|
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
|
||||||
virtual bool runOnFunction(Function &F);
|
virtual bool runOnFunction(Function &F);
|
||||||
|
Loading…
Reference in New Issue
Block a user