Skip to content

Remove deprecated code from ChapelArray and ChapelSyncVars #26520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 2 additions & 89 deletions modules/internal/ChapelArray.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -1951,12 +1951,10 @@ module ChapelArray {
return result;
}

// How to cast arrays to strings
// catch-all to avoid promotion
@chpldoc.nodoc
@deprecated(notes="casting arrays to string is deprecated; please use 'try! \"%?\".format()' from IO.FormattedIO instead")
operator :(x: [], type t:string) {
import IO.FormattedIO.string;
return try! "%?".format(x);
compilerError("array casts to string are not supported");
}

pragma "last resort"
Expand Down Expand Up @@ -2703,14 +2701,6 @@ module ChapelArray {
e = b;
}

// required to prevent deprecation warnings being related to internal modules
@chpldoc.nodoc
@deprecated(notes="Direct assignment to 'sync' variables is deprecated; apply a 'write??()' method to modify one")
operator =(ref a: [], b: _desync(a.eltType)) where isSyncType(a.eltType) {
forall e in a do
e = b;
}

//
// op= overloads for array/scalar pairs
//
Expand All @@ -2719,143 +2709,66 @@ module ChapelArray {
forall e in a do
e += b;
}
// required to prevent deprecation warnings being related to internal modules
@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator +=(ref a: [], b: _desync(a.eltType)) where isSyncType(a.eltType) {
forall e in a do
e += b;
}

@chpldoc.nodoc
operator -=(ref a: [], b: _desync(a.eltType)) {
forall e in a do
e -= b;
}
// required to prevent deprecation warnings being related to internal modules
@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator -=(ref a: [], b: _desync(a.eltType)) where isSyncType(a.eltType) {
forall e in a do
e -= b;
}

@chpldoc.nodoc
operator *=(ref a: [], b: _desync(a.eltType)) {
forall e in a do
e *= b;
}
// required to prevent deprecation warnings being related to internal modules
@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator *=(ref a: [], b: _desync(a.eltType)) where isSyncType(a.eltType) {
forall e in a do
e *= b;
}

@chpldoc.nodoc
operator /=(ref a: [], b: _desync(a.eltType)) {
forall e in a do
e /= b;
}
// required to prevent deprecation warnings being related to internal modules
@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator /=(ref a: [], b: _desync(a.eltType)) where isSyncType(a.eltType) {
forall e in a do
e /= b;
}

@chpldoc.nodoc
operator %=(ref a: [], b: _desync(a.eltType)) {
forall e in a do
e %= b;
}
// required to prevent deprecation warnings being related to internal modules
@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator %=(ref a: [], b: _desync(a.eltType)) where isSyncType(a.eltType) {
forall e in a do
e %= b;
}

@chpldoc.nodoc
operator **=(ref a: [], b: _desync(a.eltType)) {
forall e in a do
e **= b;
}
// required to prevent deprecation warnings being related to internal modules
@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator **=(ref a: [], b: _desync(a.eltType)) where isSyncType(a.eltType) {
forall e in a do
e **= b;
}

@chpldoc.nodoc
operator &=(ref a: [], b: _desync(a.eltType)) {
forall e in a do
e &= b;
}
// required to prevent deprecation warnings being related to internal modules
@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator &=(ref a: [], b: _desync(a.eltType)) where isSyncType(a.eltType) {
forall e in a do
e &= b;
}

@chpldoc.nodoc
operator |=(ref a: [], b: _desync(a.eltType)) {
forall e in a do
e |= b;
}
// required to prevent deprecation warnings being related to internal modules
@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator |=(ref a: [], b: _desync(a.eltType)) where isSyncType(a.eltType) {
forall e in a do
e |= b;
}

@chpldoc.nodoc
operator ^=(ref a: [], b: _desync(a.eltType)) {
forall e in a do
e ^= b;
}
// required to prevent deprecation warnings being related to internal modules
@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator ^=(ref a: [], b: _desync(a.eltType)) where isSyncType(a.eltType) {
forall e in a do
e ^= b;
}

@chpldoc.nodoc
operator >>=(ref a: [], b: _desync(a.eltType)) {
forall e in a do
e >>= b;
}
// required to prevent deprecation warnings being related to internal modules
@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator >>=(ref a: [], b: _desync(a.eltType)) where isSyncType(a.eltType) {
forall e in a do
e >>= b;
}

@chpldoc.nodoc
operator <<=(ref a: [], b: _desync(a.eltType)) {
forall e in a do
e <<= b;
}
// required to prevent deprecation warnings being related to internal modules
@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator <<=(ref a: [], b: _desync(a.eltType)) where isSyncType(a.eltType) {
forall e in a do
e <<= b;
}

//
// Swap operator for arrays
Expand Down
99 changes: 0 additions & 99 deletions modules/internal/ChapelSyncvar.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,6 @@ module ChapelSyncvar {
this.isOwned = false;
}

@deprecated(notes="Initializing a type-inferred variable from a 'sync' is deprecated; apply a 'read??()' method to the right-hand side")
proc init=(const ref other: _syncvar(?)) {
// Allow initialization from compatible sync variables, e.g.:
// var x : sync int = 5;
// var y : sync real = x;
if isCoercible(other.valType, this.type.valType) == false {
param theseTypes = "'" + this.type:string + "' from '" + other.type:string + "'";
param because = "because '" + other.valType:string + "' is not coercible to '" + this.type.valType:string + "'";
compilerError("cannot initialize ", theseTypes, " ", because);
}
this.init(this.type.valType);
this.writeEF(other.readFE());
}

pragma "dont disable remote value forwarding"
proc init=(in other : this.type.valType) {
this.init(this.type.valType, other);
Expand Down Expand Up @@ -298,91 +284,12 @@ module ChapelSyncvar {
return wrapped.isFull;
}

@chpldoc.nodoc
@deprecated(notes="Direct assignment to 'sync' variables is deprecated; apply a 'write??()' method to modify one")
operator =(ref lhs : _syncvar(?t), rhs : t) {
lhs.wrapped.writeEF(rhs);
}

@chpldoc.nodoc
inline operator :(from, type t:_syncvar)
where from.type == t.valType {
return new _syncvar(from);
}

@chpldoc.nodoc
@deprecated(notes="Casting sync variables is deprecated")
inline operator :(from: _syncvar, type toType:_syncvar) {
// TODO: this doesn't seem right - it doesn't use toType
return new _syncvar(from);
}

@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator +=(ref lhs : _syncvar(?t), rhs : t) {
lhs.wrapped.writeEF(lhs.wrapped.readFE() + rhs);
}

@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator -=(ref lhs : _syncvar(?t), rhs : t) {
lhs.wrapped.writeEF(lhs.wrapped.readFE() - rhs);
}

@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator *=(ref lhs : _syncvar(?t), rhs : t) {
lhs.wrapped.writeEF(lhs.wrapped.readFE() * rhs);
}

@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator /=(ref lhs : _syncvar(?t), rhs : t) {
lhs.wrapped.writeEF(lhs.wrapped.readFE() / rhs);
}

@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator %=(ref lhs : _syncvar(?t), rhs : t) {
lhs.wrapped.writeEF(lhs.wrapped.readFE() % rhs);
}

@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator **=(ref lhs : _syncvar(?t), rhs : t) {
lhs.wrapped.writeEF(lhs.wrapped.readFE() ** rhs);
}

@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator &=(ref lhs : _syncvar(?t), rhs : t) {
lhs.wrapped.writeEF(lhs.wrapped.readFE() & rhs);
}

@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator |=(ref lhs : _syncvar(?t), rhs : t) {
lhs.wrapped.writeEF(lhs.wrapped.readFE() | rhs);
}

@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator ^=(ref lhs : _syncvar(?t), rhs : t) {
lhs.wrapped.writeEF(lhs.wrapped.readFE() ^ rhs);
}

@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator >>=(ref lhs : _syncvar(?t), rhs : t) {
lhs.wrapped.writeEF(lhs.wrapped.readFE() >> rhs);
}

@chpldoc.nodoc
@deprecated("'op=' assignments to 'sync' variables are deprecated; add explicit '.read??'/'.write??' methods to modify one")
operator <<=(ref lhs : _syncvar(?t), rhs : t) {
lhs.wrapped.writeEF(lhs.wrapped.readFE() << rhs);
}

// TODO Jade: remove me when compiler generated inits are removed
proc chpl__compilerGeneratedAssignSyncSingle(ref lhs: _syncvar(?),
ref rhs: _syncvar(?)) {
Expand All @@ -397,12 +304,6 @@ module ChapelSyncvar {
return ret;
}

pragma "init copy fn"
@deprecated(notes="Initializing a type-inferred variable from a 'sync' is deprecated; apply a '.read??()' method to the right-hand side")
proc chpl__initCopy(ref sv : _syncvar(?t), definedConst: bool) {
return sv.readFE();
}

pragma "auto copy fn"
proc chpl__autoCopy(const ref rhs : _syncvar, definedConst: bool) {
// Does it make sense to have a const sync? If so, can we make use of that
Expand Down
Loading