Skip to content

Commit 4408264

Browse files
committed
Rename methods for clarification.
Rename methods to clarify that they return the value number for the argument, not the argument itself.
1 parent 4b3d3fa commit 4408264

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

com.ibm.wala.cast.python.ml/source/com/ibm/wala/cast/python/ml/client/Constant.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ public Constant(PointsToSetVariable source, CGNode node) {
3333
protected Set<List<Dimension<?>>> getDefaultShapes(PropagationCallGraphBuilder builder) {
3434
// If the shape argument is not specified, then the shape is inferred from the shape of value.
3535
// TODO: Handle keyword arguments.
36-
return getShapes(builder, this.getValueNumberForValueArgument());
36+
return getShapes(builder, this.getValueArgumentValueNumber());
3737
}
3838

3939
@Override
4040
protected EnumSet<DType> getDefaultDTypes(PropagationCallGraphBuilder builder) {
4141
// If the dtype argument is not specified, then the type is inferred from the type of value.
4242
// TODO: Handle keyword arguments.
43-
return getDTypes(builder, this.getValueNumberForValueArgument());
43+
return getDTypes(builder, this.getValueArgumentValueNumber());
4444
}
4545

46-
protected int getValueNumberForValueArgument() {
47-
return getValueNumberForArgument(this.getValueParameterPosition());
46+
protected int getValueArgumentValueNumber() {
47+
return getArgumentValueNumber(this.getValueParameterPosition());
4848
}
4949

5050
protected int getValueParameterPosition() {

com.ibm.wala.cast.python.ml/source/com/ibm/wala/cast/python/ml/client/Fill.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public Fill(PointsToSetVariable source, CGNode node) {
3232
}
3333

3434
@Override
35-
protected int getValueNumberForDTypeArgument() {
35+
protected int getDTypeArgumentValueNumber() {
3636
return VALUE_NUMBER_FOR_DTYPE_ARGUMENT;
3737
}
3838

com.ibm.wala.cast.python.ml/source/com/ibm/wala/cast/python/ml/client/TensorGenerator.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ protected Set<List<Dimension<?>>> getShapesFromShapeArgument(
218218
* @return The value number for the shape argument in the function call. May return a number less
219219
* than or equal to 0 if there is no shape parameter.
220220
*/
221-
protected int getValueNumberForShapeArgument() {
222-
return this.getValueNumberForArgument(this.getShapeParameterPosition());
221+
protected int getShapeArgumentValueNumber() {
222+
return this.getArgumentValueNumber(this.getShapeParameterPosition());
223223
}
224224

225225
protected abstract int getShapeParameterPosition();
@@ -235,7 +235,7 @@ protected Set<List<Dimension<?>>> getShapes(PropagationCallGraphBuilder builder)
235235

236236
// Get the shape from the explicit argument.
237237
// FIXME: Handle keyword arguments.
238-
int shapeArgValueNum = this.getValueNumberForShapeArgument();
238+
int shapeArgValueNum = this.getShapeArgumentValueNumber();
239239
OrdinalSet<InstanceKey> pointsToSet = null;
240240

241241
if (shapeArgValueNum > 0) {
@@ -456,16 +456,16 @@ protected EnumSet<DType> getDTypesFromDTypeArgument(
456456
* @return The value number for the dtype argument in the function call or -1 if the dtype
457457
* argument is not supported.
458458
*/
459-
protected int getValueNumberForDTypeArgument() {
460-
return this.getValueNumberForArgument(this.getDTypeParameterPosition());
459+
protected int getDTypeArgumentValueNumber() {
460+
return this.getArgumentValueNumber(this.getDTypeParameterPosition());
461461
}
462462

463463
protected abstract int getDTypeParameterPosition();
464464

465465
protected EnumSet<DType> getDTypes(PropagationCallGraphBuilder builder) {
466466
PointerAnalysis<InstanceKey> pointerAnalysis = builder.getPointerAnalysis();
467467

468-
int valNum = this.getValueNumberForDTypeArgument();
468+
int valNum = this.getDTypeArgumentValueNumber();
469469
OrdinalSet<InstanceKey> pointsToSet = null;
470470

471471
if (valNum > 0) {
@@ -610,7 +610,7 @@ public String toString() {
610610
*/
611611
protected abstract String getSignature();
612612

613-
protected int getValueNumberForArgument(int parameterPosition) {
613+
protected int getArgumentValueNumber(int parameterPosition) {
614614
if (parameterPosition < 0) return -1; // No such argument.
615615

616616
return this.getNode().getMethod().isStatic()

com.ibm.wala.cast.python.ml/source/com/ibm/wala/cast/python/ml/client/ZerosLike.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public ZerosLike(PointsToSetVariable source, CGNode node) {
2525
}
2626

2727
@Override
28-
protected int getValueNumberForShapeArgument() {
28+
protected int getShapeArgumentValueNumber() {
2929
return VALUE_NUMBER_FOR_SHAPE_ARGUMENT;
3030
}
3131

0 commit comments

Comments
 (0)