summaryrefslogtreecommitdiffstats
path: root/polly/lib/Exchange/JSONExporter.cpp
diff options
context:
space:
mode:
authorJohannes Doerfert <jdoerfert@codeaurora.org>2014-06-13 18:01:45 +0000
committerJohannes Doerfert <jdoerfert@codeaurora.org>2014-06-13 18:01:45 +0000
commitf675289d87c4effb46ae301463e6416aa3ab2c77 (patch)
tree692dfb586769cdb6a73ec118e11ce48396efe772 /polly/lib/Exchange/JSONExporter.cpp
parentfdd9f2b23da920f5e3f09fa0a328429b3cffff88 (diff)
downloadbcm5719-llvm-f675289d87c4effb46ae301463e6416aa3ab2c77.tar.gz
bcm5719-llvm-f675289d87c4effb46ae301463e6416aa3ab2c77.zip
[Refactor] C++11 Memory access iterators in SCoP stmts
+ Added const iterator version + Changed name to begin/end to allow range loops + Changed call sites to range loops + Changed typename to (const_)iterator llvm-svn: 210927
Diffstat (limited to 'polly/lib/Exchange/JSONExporter.cpp')
-rw-r--r--polly/lib/Exchange/JSONExporter.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/polly/lib/Exchange/JSONExporter.cpp b/polly/lib/Exchange/JSONExporter.cpp
index 868b830e0ee..a06aa8f8fbb 100644
--- a/polly/lib/Exchange/JSONExporter.cpp
+++ b/polly/lib/Exchange/JSONExporter.cpp
@@ -104,13 +104,11 @@ Json::Value JSONExporter::getJSON(Scop &scop) const {
statement["schedule"] = Stmt->getScatteringStr();
statement["accesses"];
- for (ScopStmt::memacc_iterator MI = Stmt->memacc_begin(),
- ME = Stmt->memacc_end();
- MI != ME; ++MI) {
+ for (MemoryAccess *MA : *Stmt) {
Json::Value access;
- access["kind"] = (*MI)->isRead() ? "read" : "write";
- access["relation"] = (*MI)->getAccessRelationStr();
+ access["kind"] = MA->isRead() ? "read" : "write";
+ access["relation"] = MA->getAccessRelationStr();
statement["accesses"].append(access);
}
@@ -263,14 +261,12 @@ bool JSONImporter::runOnScop(Scop &scop) {
ScopStmt *Stmt = *SI;
int memoryAccessIdx = 0;
- for (ScopStmt::memacc_iterator MI = Stmt->memacc_begin(),
- ME = Stmt->memacc_end();
- MI != ME; ++MI) {
+ for (MemoryAccess *MA : *Stmt) {
Json::Value accesses = jscop["statements"][statementIdx]["accesses"]
[memoryAccessIdx]["relation"];
isl_map *newAccessMap =
isl_map_read_from_str(S->getIslCtx(), accesses.asCString());
- isl_map *currentAccessMap = (*MI)->getAccessRelation();
+ isl_map *currentAccessMap = MA->getAccessRelation();
if (isl_map_dim(newAccessMap, isl_dim_param) !=
isl_map_dim(currentAccessMap, isl_dim_param)) {
@@ -311,7 +307,7 @@ bool JSONImporter::runOnScop(Scop &scop) {
// Statistics.
++NewAccessMapFound;
newAccessStrings.push_back(accesses.asCString());
- (*MI)->setNewAccessRelation(newAccessMap);
+ MA->setNewAccessRelation(newAccessMap);
} else {
isl_map_free(newAccessMap);
}
OpenPOWER on IntegriCloud