This is the first step in the interface simplification.
llvm-svn: 230897
bool runOnScop(Scop &S);
/// @brief Print a source code representation of the program.
- void printScop(llvm::raw_ostream &OS) const;
+ void printScop(llvm::raw_ostream &OS, Scop &S) const;
/// @brief Return a copy of the AST root node.
__isl_give isl_ast_node *getAst() const;
void recomputeDependences();
bool runOnScop(Scop &S);
- void printScop(raw_ostream &OS) const;
+ void printScop(raw_ostream &OS, Scop &S) const;
virtual void releaseMemory();
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
///
virtual bool runOnScop(Scop &S) = 0;
+ /// @brief Print method for SCoPs.
+ virtual void printScop(raw_ostream &OS, Scop &S) const = 0;
+
/// getAnalysisUsage - Subclasses that override getAnalysisUsage
/// must call this.
///
private:
virtual bool runOnRegion(Region *R, RGPassManager &RGM);
void print(raw_ostream &OS, const Module *) const;
- virtual void printScop(raw_ostream &OS) const {}
};
} // End llvm namespace
isl_union_map_domain(StmtSchedule));
DEBUG({
dbgs() << "Wrapped Dependences:\n";
- printScop(dbgs());
+ printScop(dbgs(), S);
dbgs() << "\n";
});
DEBUG({
dbgs() << "Final Wrapped Dependences:\n";
- printScop(dbgs());
+ printScop(dbgs(), S);
dbgs() << "\n";
});
DEBUG({
dbgs() << "Zipped Dependences:\n";
- printScop(dbgs());
+ printScop(dbgs(), S);
dbgs() << "\n";
});
DEBUG({
dbgs() << "Unwrapped Dependences:\n";
- printScop(dbgs());
+ printScop(dbgs(), S);
dbgs() << "\n";
});
RED = isl_union_map_coalesce(RED);
TC_RED = isl_union_map_coalesce(TC_RED);
- DEBUG(printScop(dbgs()));
+ DEBUG(printScop(dbgs(), S));
}
void Dependences::recomputeDependences() {
OS << "n/a\n";
}
-void Dependences::printScop(raw_ostream &OS) const {
+void Dependences::printScop(raw_ostream &OS, Scop &) const {
OS << "\tRAW dependences:\n\t\t";
printDependencyMap(OS, RAW);
OS << "\tWAR dependences:\n\t\t";
void ScopPass::print(raw_ostream &OS, const Module *M) const {
if (S)
- printScop(OS);
+ printScop(OS, *S);
}
void ScopPass::getAnalysisUsage(AnalysisUsage &AU) const {
Ast = new IslAst(&Scop, D);
- DEBUG(printScop(dbgs()));
+ DEBUG(printScop(dbgs(), Scop));
return false;
}
return Payload ? Payload->Build : nullptr;
}
-void IslAstInfo::printScop(raw_ostream &OS) const {
+void IslAstInfo::printScop(raw_ostream &OS, Scop &S) const {
isl_ast_print_options *Options;
isl_ast_node *RootNode = getAst();
- Scop &S = getCurScop();
Function *F = S.getRegion().getEntry()->getParent();
OS << ":: isl ast :: " << F->getName() << " :: " << S.getRegion().getNameStr()
"SCoP ==\n";
S.print(errs());
errs() << "\n== The isl AST ==\n";
- AI->printScop(errs());
+ AI->printScop(errs(), S);
errs() << "\n== The invalid function ==\n";
F.print(errs());
errs() << "\n== The errors ==\n";
return true;
}
- virtual void printScop(raw_ostream &OS) const {}
+ virtual void printScop(raw_ostream &, Scop &) const {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<DataLayoutPass>();
std::string getFileName(Scop *S) const;
Json::Value getJSON(Scop &scop) const;
virtual bool runOnScop(Scop &S);
- void printScop(raw_ostream &OS) const;
+ void printScop(raw_ostream &OS, Scop &S) const;
void getAnalysisUsage(AnalysisUsage &AU) const;
};
std::string getFileName(Scop *S) const;
virtual bool runOnScop(Scop &S);
- void printScop(raw_ostream &OS) const;
+ void printScop(raw_ostream &OS, Scop &S) const;
void getAnalysisUsage(AnalysisUsage &AU) const;
};
}
return FileName;
}
-void JSONExporter::printScop(raw_ostream &OS) const { S->print(OS); }
+void JSONExporter::printScop(raw_ostream &OS, Scop &S) const { S.print(OS); }
Json::Value JSONExporter::getJSON(Scop &scop) const {
Json::Value root;
return FileName;
}
-void JSONImporter::printScop(raw_ostream &OS) const {
- S->print(OS);
+void JSONImporter::printScop(raw_ostream &OS, Scop &S) const {
+ S.print(OS);
for (std::vector<std::string>::const_iterator I = newAccessStrings.begin(),
E = newAccessStrings.end();
I != E; I++)
virtual bool runOnScop(Scop &S);
- void printScop(llvm::raw_ostream &OS) const;
+ void printScop(raw_ostream &OS, Scop &S) const;
void getAnalysisUsage(AnalysisUsage &AU) const;
private:
return eliminateDeadCode(S, DCEPreciseSteps);
}
-void DeadCodeElim::printScop(raw_ostream &OS) const {}
+void DeadCodeElim::printScop(raw_ostream &, Scop &) const {}
void DeadCodeElim::getAnalysisUsage(AnalysisUsage &AU) const {
ScopPass::getAnalysisUsage(AU);
explicit PlutoOptimizer() : ScopPass(ID) {}
virtual bool runOnScop(Scop &S);
- void printScop(llvm::raw_ostream &OS) const;
+ void printScop(llvm::raw_ostream &OS, Scop &S) const;
void getAnalysisUsage(AnalysisUsage &AU) const;
static void extendScattering(Scop &S, unsigned NewDimensions);
};
return false;
}
-void PlutoOptimizer::printScop(raw_ostream &OS) const {}
+void PlutoOptimizer::printScop(raw_ostream &, Scop &) const {}
void PlutoOptimizer::getAnalysisUsage(AnalysisUsage &AU) const {
ScopPass::getAnalysisUsage(AU);
~IslScheduleOptimizer() { isl_schedule_free(LastSchedule); }
virtual bool runOnScop(Scop &S);
- void printScop(llvm::raw_ostream &OS) const;
+ void printScop(raw_ostream &OS, Scop &S) const;
void getAnalysisUsage(AnalysisUsage &AU) const;
private:
return false;
}
-void IslScheduleOptimizer::printScop(raw_ostream &OS) const {
+void IslScheduleOptimizer::printScop(raw_ostream &OS, Scop &) const {
isl_printer *p;
char *ScheduleStr;