Skip to content

Commit ce5baba

Browse files
Merge pull request #356 from rohany/fix-warnings
lower,index_notation: fix compilation warnings
2 parents fb2ed72 + ec1a9ac commit ce5baba

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/index_notation/provenance_graph.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ std::vector<ir::Expr> ProvenanceGraph::deriveIterBounds(IndexVar indexVar, std::
10681068

10691069
std::map<IndexVar, std::vector<ir::Expr>> parentIterBounds;
10701070
std::map<IndexVar, std::vector<ir::Expr>> parentCoordBounds;
1071-
for (const IndexVar parent : getParents(indexVar)) {
1071+
for (const IndexVar& parent : getParents(indexVar)) {
10721072
parentIterBounds[parent] = deriveIterBounds(parent, derivedVarOrder, underivedBounds, variableNames, iterators);
10731073
vector<IndexVar> underivedParentAncestors = getUnderivedAncestors(parent);
10741074
// TODO: this is okay for now because we don't need parentCoordBounds for fused taco_iassert(underivedParentAncestors.size() == 1);
@@ -1088,7 +1088,7 @@ bool ProvenanceGraph::hasCoordBounds(IndexVar indexVar) const {
10881088
bool ProvenanceGraph::isPosVariable(taco::IndexVar indexVar) const {
10891089
if (isUnderived(indexVar)) return false;
10901090
if (parentRelMap.at(indexVar).getRelType() == POS) return true;
1091-
for (const IndexVar parent : getParents(indexVar)) {
1091+
for (const IndexVar& parent : getParents(indexVar)) {
10921092
if (isPosVariable(parent)) {
10931093
return true;
10941094
}
@@ -1104,7 +1104,7 @@ bool ProvenanceGraph::isPosOfAccess(IndexVar indexVar, Access access) const {
11041104
else if (parentRelMap.at(indexVar).getRelType() == FUSE) {
11051105
return false; // lose pos of access status through fuse
11061106
}
1107-
for (const IndexVar parent : getParents(indexVar)) {
1107+
for (const IndexVar& parent : getParents(indexVar)) {
11081108
if (isPosOfAccess(parent, access)) {
11091109
return true;
11101110
}

src/lower/lowerer_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ LowererImpl::lower(IndexStmt stmt, string name,
140140

141141
provGraph = ProvenanceGraph(stmt);
142142

143-
for (const IndexVar indexVar : provGraph.getAllIndexVars()) {
143+
for (const IndexVar& indexVar : provGraph.getAllIndexVars()) {
144144
if (iterators.modeIterators().count(indexVar)) {
145145
indexVarToExprMap.insert({indexVar, iterators.modeIterators()[indexVar].getIteratorVar()});
146146
}

0 commit comments

Comments
 (0)