Skip to content

[pass-manager] Analysis => Analyses. #17997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions include/swift/SILOptimizer/PassManager/PassManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class SILPassManager {
llvm::SmallVector<SILTransform *, 16> Transformations;

/// A list of registered analysis.
llvm::SmallVector<SILAnalysis *, 16> Analysis;
llvm::SmallVector<SILAnalysis *, 16> Analyses;

/// An entry in the FunctionWorkList.
struct WorklistEntry {
Expand Down Expand Up @@ -122,7 +122,7 @@ class SILPassManager {
/// analysis. If the analysis is not found, the program terminates.
template<typename T>
T *getAnalysis() {
for (SILAnalysis *A : Analysis)
for (SILAnalysis *A : Analyses)
if (auto *R = llvm::dyn_cast<T>(A))
return R;

Expand All @@ -145,7 +145,7 @@ class SILPassManager {
/// \brief Iterate over all analysis and invalidate them.
void invalidateAllAnalysis() {
// Invalidate the analysis (unless they are locked)
for (auto AP : Analysis)
for (auto AP : Analyses)
if (!AP->isLocked())
AP->invalidate();

Expand All @@ -170,7 +170,7 @@ class SILPassManager {
/// is the job of the analysis to make sure no extra work is done if the
/// particular analysis has been done on the function.
void notifyAnalysisOfFunction(SILFunction *F) {
for (auto AP : Analysis) {
for (auto AP : Analyses) {
AP->notifyAddedOrModifiedFunction(F);
}
}
Expand All @@ -179,7 +179,7 @@ class SILPassManager {
void invalidateAnalysis(SILFunction *F,
SILAnalysis::InvalidationKind K) {
// Invalidate the analysis (unless they are locked)
for (auto AP : Analysis)
for (auto AP : Analyses)
if (!AP->isLocked())
AP->invalidate(F, K);

Expand All @@ -192,7 +192,7 @@ class SILPassManager {
/// or vtables.
void invalidateFunctionTables() {
// Invalidate the analysis (unless they are locked)
for (auto AP : Analysis)
for (auto AP : Analyses)
if (!AP->isLocked())
AP->invalidateFunctionTables();

Expand All @@ -205,7 +205,7 @@ class SILPassManager {
/// \brief Iterate over all analysis and notify them of a deleted function.
void notifyDeleteFunction(SILFunction *F) {
// Invalidate the analysis (unless they are locked)
for (auto AP : Analysis)
for (auto AP : Analyses)
if (!AP->isLocked())
AP->notifyWillDeleteFunction(F);

Expand Down Expand Up @@ -233,7 +233,7 @@ class SILPassManager {

/// Verify all analyses.
void verifyAnalyses() const {
for (auto *A : Analysis) {
for (auto *A : Analyses) {
A->verify();
}
}
Expand All @@ -245,7 +245,7 @@ class SILPassManager {
/// this. If no override is provided the SILAnalysis should just call the
/// normal verify method.
void verifyAnalyses(SILFunction *F) const {
for (auto *A : Analysis) {
for (auto *A : Analyses) {
A->verify(F);
}
}
Expand Down
8 changes: 4 additions & 4 deletions lib/SILOptimizer/PassManager/PassManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ SILPassManager::SILPassManager(SILModule *M, llvm::StringRef Stage,
Mod(M), StageName(Stage), isMandatoryPipeline(isMandatoryPipeline) {

#define ANALYSIS(NAME) \
Analysis.push_back(create##NAME##Analysis(Mod));
Analyses.push_back(create##NAME##Analysis(Mod));
#include "swift/SILOptimizer/Analysis/Analysis.def"

for (SILAnalysis *A : Analysis) {
for (SILAnalysis *A : Analyses) {
A->initialize(this);
M->registerDeleteNotificationHandler(A);
}
Expand All @@ -258,7 +258,7 @@ bool SILPassManager::continueTransforming() {
}

bool SILPassManager::analysesUnlocked() {
for (auto *A : Analysis)
for (auto *A : Analyses)
if (A->isLocked())
return false;

Expand Down Expand Up @@ -544,7 +544,7 @@ SILPassManager::~SILPassManager() {
delete T;

// delete the analysis.
for (auto *A : Analysis) {
for (auto *A : Analyses) {
Mod->removeDeleteNotificationHandler(A);
assert(!A->isLocked() &&
"Deleting a locked analysis. Did we forget to unlock ?");
Expand Down