mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 05:29:24 +00:00
Make the getAnalyss<> members const. Using them does NOT modify the Pass object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3522 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
764b46ea2d
commit
3f917b6f99
@ -126,7 +126,7 @@ protected:
|
||||
/// getAnalysisUsage function.
|
||||
///
|
||||
template<typename AnalysisType>
|
||||
AnalysisType &getAnalysis() {
|
||||
AnalysisType &getAnalysis() const {
|
||||
assert(Resolver && "Pass has not been inserted into a PassManager object!");
|
||||
const PassInfo *PI = getClassPassInfo<AnalysisType>();
|
||||
assert(PI && "getAnalysis for unregistered pass!");
|
||||
@ -143,10 +143,10 @@ protected:
|
||||
}
|
||||
|
||||
template<typename AnalysisType>
|
||||
AnalysisType &getAnalysisID(const PassInfo *PI) {
|
||||
AnalysisType &getAnalysisID(const PassInfo *PI) const {
|
||||
assert(Resolver && "Pass has not been inserted into a PassManager object!");
|
||||
assert(PI && "getAnalysis for unregistered pass!");
|
||||
return *(AnalysisType*)Resolver->getAnalysis(PI);
|
||||
return *dynamic_cast<AnalysisType*>(Resolver->getAnalysis(PI));
|
||||
}
|
||||
|
||||
/// getAnalysisToUpdate<AnalysisType>() - This function is used by subclasses
|
||||
@ -156,11 +156,11 @@ protected:
|
||||
/// provide the capability to update an analysis that exists.
|
||||
///
|
||||
template<typename AnalysisType>
|
||||
AnalysisType *getAnalysisToUpdate() {
|
||||
AnalysisType *getAnalysisToUpdate() const {
|
||||
assert(Resolver && "Pass not resident in a PassManager object!");
|
||||
const PassInfo *PI = getClassPassInfo<AnalysisType>();
|
||||
if (PI == 0) return 0;
|
||||
return (AnalysisType*)Resolver->getAnalysisToUpdate(PI);
|
||||
return dynamic_cast<AnalysisType*>(Resolver->getAnalysisToUpdate(PI));
|
||||
}
|
||||
|
||||
|
||||
|
@ -86,14 +86,14 @@ public:
|
||||
struct AnalysisResolver {
|
||||
virtual Pass *getAnalysisOrNullUp(AnalysisID ID) const = 0;
|
||||
virtual Pass *getAnalysisOrNullDown(AnalysisID ID) const = 0;
|
||||
Pass *getAnalysis(AnalysisID ID) {
|
||||
Pass *getAnalysis(AnalysisID ID) const {
|
||||
Pass *Result = getAnalysisOrNullUp(ID);
|
||||
assert(Result && "Pass has an incorrect analysis uses set!");
|
||||
return Result;
|
||||
}
|
||||
|
||||
// getAnalysisToUpdate - Return an analysis result or null if it doesn't exist
|
||||
Pass *getAnalysisToUpdate(AnalysisID ID) {
|
||||
Pass *getAnalysisToUpdate(AnalysisID ID) const {
|
||||
return getAnalysisOrNullUp(ID);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user