Print function names under --polly-report

llvm-svn: 176446
This commit is contained in:
Tobias Grosser 2013-03-04 19:49:51 +00:00
parent fd5ef42830
commit b2863ca2dc
2 changed files with 11 additions and 5 deletions

View File

@ -214,7 +214,7 @@ class ScopDetection : public FunctionPass {
std::string &FileName); std::string &FileName);
/// @brief Print the locations of all detected scops. /// @brief Print the locations of all detected scops.
void printLocations(); void printLocations(llvm::Function &F);
public: public:
static char ID; static char ID;

View File

@ -590,7 +590,12 @@ void ScopDetection::getDebugLocation(const Region *R, unsigned &LineBegin,
} }
} }
void ScopDetection::printLocations() { void ScopDetection::printLocations(llvm::Function &F) {
int NumberOfScops = std::distance(begin(), end());
if (NumberOfScops)
outs() << ":: Static control regions in " << F.getName() << "\n";
for (iterator RI = begin(), RE = end(); RI != RE; ++RI) { for (iterator RI = begin(), RE = end(); RI != RE; ++RI) {
unsigned LineEntry, LineExit; unsigned LineEntry, LineExit;
std::string FileName; std::string FileName;
@ -603,8 +608,9 @@ void ScopDetection::printLocations() {
return; return;
} }
outs() << FileName << ":" << LineEntry << ": Scop start\n"; outs() << FileName << ":" << LineEntry
outs() << FileName << ":" << LineExit << ": Scop end\n"; << ": Start of static control region\n";
outs() << FileName << ":" << LineExit << ": End of static control region\n";
} }
} }
@ -626,7 +632,7 @@ bool ScopDetection::runOnFunction(llvm::Function &F) {
findScops(*TopRegion); findScops(*TopRegion);
if (ReportLevel >= 1) if (ReportLevel >= 1)
printLocations(); printLocations(F);
return false; return false;
} }