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.
Rename range.stridable to range.strides by vass (chapel-lang#22441)
This PR switches the boolean field `range.stridable` to `range.strides` of the type `enum strideKind { one, negOne, positive, negative, any }` according to the design discussion concluded in chapel-lang#17131 (comment) The `by` operator infers the `strides` of the resulting range based on its `step` argument. Ex. `r by 1` produces `r` rather than a range with `stridable = true`; `1..n by anUnsignedInteger` produces a range with `strideKind.positive`; etc. `stridable` queries on ranges and domains are still supported without a warning. The warnings have been added to the module and compiler code. In this PR they are commented out and marked with "RSDW" for "range.stridable deprecation warning". They will be enabled in a future PR. I modified Chapel code outside of modules/internal as little as possible. My goal was make sure that the deprecation code works correctly. To support domain maps that have not been converted from stridable to strideKind, the compiler converts accesses to the former field `stridable` to the new field `strides` in BaseRectangularDom and BaseArrOverRectangularDom. The bulk of updates to test code caters for a mix of un-converted uses of `stridable` that produce ranges with `strideKind.any` and `strides`-base code produces ranges with `strideKind.positive` or other more specific strideKinds. The bulk of updates to test .good files updates the `strides` components of the range and domain types from `false` to `one` and from `true` to `positive`, `any`, etc. Some tests get compile-time warnings or errors instead of, or in addition to, the runtime warnings or errors in those cases where the compiler can now determine the corresponding condition statically based on the `strides` parameter of the range or domain. While there: * add a future test library/standard/Reflection/primitives/ResolvesDmap * overhaul range.displayRepresentation() to display all the range fields * disallow a range assignment when the corresponding idxType assignment is illegal * support safeCast between ranges of identical enum types, because domain assignment+initialization depends on it via chpl_assignDomainWithGetSetIndices() * simplify some codes by merging the two branches of `if stridable` Development history compressed into 36425cd: 42fa8bf..b8c3c86 Post-merge TODOs: * uncomment the deprecation warnings * switch the rest of module and test code to `strides` * add deprecation tests * update dyno resolver to handle `range.strides` field in Resolver::exit() * rename `hasPosNegUnitStride` to a better name * add tests of new assignment / initialization behaviors
- Loading branch information
Showing
311 changed files
with
3,565 additions
and
1,792 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
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
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
Oops, something went wrong.