Skip to content

Commit

Permalink
respond to reviewer feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Abraham <[email protected]>
  • Loading branch information
jabraham17 committed Aug 24, 2023
1 parent 5dd824d commit 2f1c4c6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
12 changes: 9 additions & 3 deletions compiler/resolution/cullOverReferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,15 @@ static void maybeIssueRefMaybeConstWarning(ArgSymbol* arg) {
argName = arg->name;
}

const char* intentName = isTaskIntent ? "add an explicit task variable for" : (isArgThis ? "use an explicit this intent for the method" : "use an explicit intent for the argument");

Symbol* warnSym = (isTaskIntent && arg->getFunction()) ? (Symbol*)arg->getFunction() : (Symbol*)arg;
const char* intentName = isTaskIntent ?
"add an explicit 'ref' task intent for" :
(isArgThis ?
"use an explicit 'ref' this intent for the method" :
"use an explicit 'ref' intent for the argument");

bool useFunctionForWarning = isTaskIntent && arg->getFunction();
Symbol* warnSym =
useFunctionForWarning ? (Symbol*)arg->getFunction() : (Symbol*)arg;
USR_WARN(warnSym,
"inferring a default intent to be 'ref' is deprecated "
"- please %s '%s'",
Expand Down
14 changes: 7 additions & 7 deletions test/deprecated/ref-maybe-const-task-intent.good
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ref-maybe-const-task-intent.chpl:2: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit task variable for 'y'
ref-maybe-const-task-intent.chpl:8: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit task variable for 'z'
ref-maybe-const-task-intent.chpl:9: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit task variable for 'z'
ref-maybe-const-task-intent.chpl:14: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit task variable for 'w'
ref-maybe-const-task-intent.chpl:24: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit task variable for 'x'
ref-maybe-const-task-intent.chpl:25: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit task variable for 'y'
ref-maybe-const-task-intent.chpl:36: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit task variable for 'this'
ref-maybe-const-task-intent.chpl:2: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' task intent for 'y'
ref-maybe-const-task-intent.chpl:8: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' task intent for 'z'
ref-maybe-const-task-intent.chpl:9: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' task intent for 'z'
ref-maybe-const-task-intent.chpl:14: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' task intent for 'w'
ref-maybe-const-task-intent.chpl:24: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' task intent for 'x'
ref-maybe-const-task-intent.chpl:25: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' task intent for 'y'
ref-maybe-const-task-intent.chpl:36: warning: inferring a default intent to be 'ref' is deprecated - please add an explicit 'ref' task intent for 'this'
4 changes: 2 additions & 2 deletions test/deprecated/ref-maybe-const.good
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ref-maybe-const.chpl:7: warning: inferring a default intent to be 'ref' is deprecated - please use an explicit intent for the argument 'A'
ref-maybe-const.chpl:12: warning: inferring a default intent to be 'ref' is deprecated - please use an explicit intent for the argument 'args'
ref-maybe-const.chpl:7: warning: inferring a default intent to be 'ref' is deprecated - please use an explicit 'ref' intent for the argument 'A'
ref-maybe-const.chpl:12: warning: inferring a default intent to be 'ref' is deprecated - please use an explicit 'ref' intent for the argument 'args'
A, 1 2 3 4 5 6 7 8 9 10
B, 1 2 3 4 5 6 7 8 9 10
A, 1 1 1 1 1 1 1 1 1 1
Expand Down
2 changes: 1 addition & 1 deletion test/studies/cholesky/marybeth/chol.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ proc main() {

chol(A);

writeln("Factored Matrix:");
writeln("Factored Matrix:");
writelower(A);
writeln();
}
Expand Down

0 comments on commit 2f1c4c6

Please sign in to comment.