Skip to content

Commit

Permalink
Change return type of some APIs from PrimitiveType to more accurate t…
Browse files Browse the repository at this point in the history
…ypes
  • Loading branch information
silverbullettt committed Jan 20, 2024
1 parent 2e4d316 commit 648b3a6
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 16 deletions.
3 changes: 1 addition & 2 deletions src/main/java/pascal/taie/ir/exp/ArrayLengthExp.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import pascal.taie.language.type.ArrayType;
import pascal.taie.language.type.IntType;
import pascal.taie.language.type.PrimitiveType;

/**
* Representation of array length expression, e.g., arr.length.
Expand All @@ -48,7 +47,7 @@ public Var getOperand() {
}

@Override
public PrimitiveType getType() {
public IntType getType() {
return IntType.INT;
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/pascal/taie/ir/exp/ComparisonExp.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import pascal.taie.language.type.FloatType;
import pascal.taie.language.type.IntType;
import pascal.taie.language.type.LongType;
import pascal.taie.language.type.PrimitiveType;
import pascal.taie.language.type.Type;

/**
Expand Down Expand Up @@ -75,7 +74,7 @@ public Op getOperator() {
}

@Override
public PrimitiveType getType() {
public IntType getType() {
return IntType.INT;
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/pascal/taie/ir/exp/ConditionExp.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
package pascal.taie.ir.exp;

import pascal.taie.language.type.IntType;
import pascal.taie.language.type.PrimitiveType;

/**
* Representation of condition expression, e.g., a == b.
Expand Down Expand Up @@ -71,7 +70,7 @@ public Op getOperator() {
}

@Override
public PrimitiveType getType() {
public IntType getType() {
return IntType.INT;
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/pascal/taie/ir/exp/DoubleLiteral.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
package pascal.taie.ir.exp;

import pascal.taie.language.type.DoubleType;
import pascal.taie.language.type.PrimitiveType;

public class DoubleLiteral implements FloatingPointLiteral {

Expand All @@ -43,7 +42,7 @@ public static DoubleLiteral get(double value) {
}

@Override
public PrimitiveType getType() {
public DoubleType getType() {
return DoubleType.DOUBLE;
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/pascal/taie/ir/exp/FloatLiteral.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
package pascal.taie.ir.exp;

import pascal.taie.language.type.FloatType;
import pascal.taie.language.type.PrimitiveType;

public class FloatLiteral implements FloatingPointLiteral {

Expand All @@ -43,7 +42,7 @@ public static FloatLiteral get(float value) {
}

@Override
public PrimitiveType getType() {
public FloatType getType() {
return FloatType.FLOAT;
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/pascal/taie/ir/exp/InstanceOfExp.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
package pascal.taie.ir.exp;

import pascal.taie.language.type.BooleanType;
import pascal.taie.language.type.PrimitiveType;
import pascal.taie.language.type.ReferenceType;

import java.util.Set;
Expand Down Expand Up @@ -54,7 +53,7 @@ public ReferenceType getCheckedType() {
}

@Override
public PrimitiveType getType() {
public BooleanType getType() {
return BooleanType.BOOLEAN;
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/pascal/taie/ir/exp/IntLiteral.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
package pascal.taie.ir.exp;

import pascal.taie.language.type.IntType;
import pascal.taie.language.type.PrimitiveType;

/**
* Representation of int literals.
Expand Down Expand Up @@ -59,7 +58,7 @@ public static IntLiteral get(int value) {
}

@Override
public PrimitiveType getType() {
public IntType getType() {
return IntType.INT;
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/pascal/taie/ir/exp/LongLiteral.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
package pascal.taie.ir.exp;

import pascal.taie.language.type.LongType;
import pascal.taie.language.type.PrimitiveType;

/**
* Representation of long literals.
Expand Down Expand Up @@ -59,7 +58,7 @@ public static LongLiteral get(long value) {
}

@Override
public PrimitiveType getType() {
public LongType getType() {
return LongType.LONG;
}

Expand Down

0 comments on commit 648b3a6

Please sign in to comment.