forked from chapel-lang/chapel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert the Stencil distribution to a record (chapel-lang#23016)
[reviewed by @benharsh — thanks!] This follows the grand tradition of chapel-lang#22657 , chapel-lang#22951 , and chapel-lang#22991 , this PR changes the `Stencil` distribution to a record. It: * adds a new `Stencil` record, modeled closely on `Block` * converts the old `Stencil` class to a `StencilImpl` record * adds the necessary `StencilDom.dsiGetDist()` method * updates the dmapType deprecation test to include a dmap + Stencil example * updates other tests that were using dmap and Stencil together Not directly related to the main point of the PR (other than that I hit it while updating tests), it also: * fixes the argument and return intent of two of the internal routines used to build dmap information to work in the event that a `const` record is passed in; this is strictly needed to support legacy `dmap` behavior which is why I hadn't noticed it previously * adds a future because for awhile I had changed it to accept a `const ref` and return the arg by `ref`, which should be illegal And then even less related, I made further updates to the untested hpl.hpcc2012.chpl and hpl.performance.chpl tests to better reflect the current language / avoid false positives on `git grep`
- Loading branch information
Showing
14 changed files
with
214 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
use BlockDist; | ||
|
||
config const n = 10; | ||
|
||
const block = new Block({1..n}); | ||
var D = {1..n} dmapped new dmap(block); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dmapConstRecord.chpl:6: warning: The use of 'dmap' is deprecated for this distribution; please replace 'new dmap(new <DistName>(<args>))' with 'new <DistName>(<args>)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
43 | ||
43 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
proc foo(const ref x) ref { | ||
return x; | ||
} | ||
|
||
const answer = 42; | ||
ref alias = foo(answer); | ||
alias += 1; | ||
writeln(alias); | ||
writeln(answer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bug: compiler permits 'const ref' formals to be returned as 'ref' | ||
|
||
(resulting in the ability to change 'const' values) |
Oops, something went wrong.