diff options
Diffstat (limited to 'polly/lib/Exchange/JSONExporter.cpp')
-rw-r--r-- | polly/lib/Exchange/JSONExporter.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/polly/lib/Exchange/JSONExporter.cpp b/polly/lib/Exchange/JSONExporter.cpp index 5047f90d6af..63e7bdda181 100644 --- a/polly/lib/Exchange/JSONExporter.cpp +++ b/polly/lib/Exchange/JSONExporter.cpp @@ -91,7 +91,7 @@ struct JSONImporter : public ScopPass { char JSONExporter::ID = 0; std::string JSONExporter::getFileName(Scop &S) const { - std::string FunctionName = S.getRegion().getEntry()->getParent()->getName(); + std::string FunctionName = S.getFunction().getName(); std::string FileName = FunctionName + "___" + S.getNameStr() + ".jscop"; return FileName; } @@ -109,7 +109,7 @@ Json::Value JSONExporter::getJSON(Scop &S) const { Location = FileName + ":" + std::to_string(LineBegin) + "-" + std::to_string(LineEnd); - root["name"] = S.getRegion().getNameStr(); + root["name"] = S.getNameStr(); root["context"] = S.getContextStr(); if (LineBegin != (unsigned)-1) root["location"] = Location; @@ -139,8 +139,6 @@ Json::Value JSONExporter::getJSON(Scop &S) const { } bool JSONExporter::runOnScop(Scop &S) { - Region &R = S.getRegion(); - std::string FileName = ImportDir + "/" + getFileName(S); Json::Value jscop = getJSON(S); @@ -151,8 +149,8 @@ bool JSONExporter::runOnScop(Scop &S) { std::error_code EC; tool_output_file F(FileName, EC, llvm::sys::fs::F_Text); - std::string FunctionName = R.getEntry()->getParent()->getName(); - errs() << "Writing JScop '" << R.getNameStr() << "' in function '" + std::string FunctionName = S.getFunction().getName(); + errs() << "Writing JScop '" << S.getNameStr() << "' in function '" << FunctionName << "' to '" << FileName << "'.\n"; if (!EC) { @@ -180,7 +178,7 @@ Pass *polly::createJSONExporterPass() { return new JSONExporter(); } char JSONImporter::ID = 0; std::string JSONImporter::getFileName(Scop &S) const { - std::string FunctionName = S.getRegion().getEntry()->getParent()->getName(); + std::string FunctionName = S.getFunction().getName(); std::string FileName = FunctionName + "___" + S.getNameStr() + ".jscop"; if (ImportPostfix != "") @@ -200,16 +198,14 @@ void JSONImporter::printScop(raw_ostream &OS, Scop &S) const { typedef Dependences::StatementToIslMapTy StatementToIslMapTy; bool JSONImporter::runOnScop(Scop &S) { - Region &R = S.getRegion(); const Dependences &D = getAnalysis<DependenceInfo>().getDependences(Dependences::AL_Statement); - const DataLayout &DL = - S.getRegion().getEntry()->getParent()->getParent()->getDataLayout(); + const DataLayout &DL = S.getFunction().getParent()->getDataLayout(); std::string FileName = ImportDir + "/" + getFileName(S); - std::string FunctionName = R.getEntry()->getParent()->getName(); - errs() << "Reading JScop '" << R.getNameStr() << "' in function '" + std::string FunctionName = S.getFunction().getName(); + errs() << "Reading JScop '" << S.getNameStr() << "' in function '" << FunctionName << "' from '" << FileName << "'.\n"; ErrorOr<std::unique_ptr<MemoryBuffer>> result = MemoryBuffer::getFile(FileName); |