26 lines
522 B
Java
Executable File
26 lines
522 B
Java
Executable File
package midend.llvm.constant;
|
|
|
|
import backend.mips.instr.data.MipsWord;
|
|
import midend.llvm.type.IrInterType;
|
|
|
|
public class IrConstantInt extends IrConstant {
|
|
private int value;
|
|
|
|
public IrConstantInt(int value) {
|
|
super(IrInterType.INT32, value + "");
|
|
this.value = value;
|
|
}
|
|
|
|
public int getValue() {
|
|
return value;
|
|
}
|
|
|
|
public String toString() {
|
|
return "i32 " + value;
|
|
}
|
|
|
|
public void toMips(String label) {
|
|
new MipsWord(label, value);
|
|
}
|
|
}
|