mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-02 09:33:59 +00:00
eliminate a bunch of dynamic_cast's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94154 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c589e03865
commit
5e664b8f7c
@ -152,6 +152,7 @@ public:
|
||||
virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
|
||||
return this;
|
||||
}
|
||||
virtual ImmutablePass *getAsImmutablePass() { return 0; }
|
||||
|
||||
/// verifyAnalysis() - This member can be implemented by a analysis pass to
|
||||
/// check state of analysis information.
|
||||
@ -249,6 +250,8 @@ public:
|
||||
///
|
||||
virtual void initializePass();
|
||||
|
||||
virtual ImmutablePass *getAsImmutablePass() { return this; }
|
||||
|
||||
/// ImmutablePasses are never run.
|
||||
///
|
||||
bool runOnModule(Module &) { return false; }
|
||||
|
@ -202,9 +202,7 @@ public:
|
||||
}
|
||||
|
||||
inline void addTopLevelPass(Pass *P) {
|
||||
|
||||
if (ImmutablePass *IP = dynamic_cast<ImmutablePass *> (P)) {
|
||||
|
||||
if (ImmutablePass *IP = P->getAsImmutablePass()) {
|
||||
// P is a immutable pass and it will be managed by this
|
||||
// top level manager. Set up analysis resolver to connect them.
|
||||
AnalysisResolver *AR = new AnalysisResolver(*this);
|
||||
@ -333,8 +331,7 @@ public:
|
||||
}
|
||||
|
||||
inline void addTopLevelPass(Pass *P) {
|
||||
if (ImmutablePass *IP = dynamic_cast<ImmutablePass *> (P)) {
|
||||
|
||||
if (ImmutablePass *IP = P->getAsImmutablePass()) {
|
||||
// P is a immutable pass and it will be managed by this
|
||||
// top level manager. Set up analysis resolver to connect them.
|
||||
AnalysisResolver *AR = new AnalysisResolver(*this);
|
||||
@ -670,7 +667,7 @@ bool PMDataManager::preserveHigherLevelAnalysis(Pass *P) {
|
||||
for (SmallVector<Pass *, 8>::iterator I = HigherLevelAnalysis.begin(),
|
||||
E = HigherLevelAnalysis.end(); I != E; ++I) {
|
||||
Pass *P1 = *I;
|
||||
if (!dynamic_cast<ImmutablePass*>(P1) &&
|
||||
if (P1->getAsImmutablePass() == 0 &&
|
||||
std::find(PreservedSet.begin(), PreservedSet.end(),
|
||||
P1->getPassInfo()) ==
|
||||
PreservedSet.end())
|
||||
@ -713,8 +710,8 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
|
||||
for (std::map<AnalysisID, Pass*>::iterator I = AvailableAnalysis.begin(),
|
||||
E = AvailableAnalysis.end(); I != E; ) {
|
||||
std::map<AnalysisID, Pass*>::iterator Info = I++;
|
||||
if (!dynamic_cast<ImmutablePass*>(Info->second)
|
||||
&& std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) ==
|
||||
if (Info->second->getAsImmutablePass() == 0 &&
|
||||
std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) ==
|
||||
PreservedSet.end()) {
|
||||
// Remove this analysis
|
||||
if (PassDebugging >= Details) {
|
||||
@ -737,7 +734,7 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
|
||||
I = InheritedAnalysis[Index]->begin(),
|
||||
E = InheritedAnalysis[Index]->end(); I != E; ) {
|
||||
std::map<AnalysisID, Pass *>::iterator Info = I++;
|
||||
if (!dynamic_cast<ImmutablePass*>(Info->second) &&
|
||||
if (Info->second->getAsImmutablePass() == 0 &&
|
||||
std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) ==
|
||||
PreservedSet.end()) {
|
||||
// Remove this analysis
|
||||
|
Loading…
x
Reference in New Issue
Block a user