llvmir some opt

This commit is contained in:
邓智航
2025-12-10 17:58:17 +08:00
commit 84827838e2
103 changed files with 5838 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package midend.llvm.instr;
import midend.llvm.type.IrPointerType;
import midend.llvm.type.IrType;
public class AllocateInstr extends IrInstr {
private IrType pointeeType;
public AllocateInstr(IrType pointeeType, String name) { // name即为局部变量的name因为要声明一个局部变量
super(new IrPointerType(pointeeType), name, IrInstrType.ALLOCA);
this.pointeeType = pointeeType;
}
public IrType getPointeeType() {
return pointeeType;
}
public String toString() {
return getName() + " = alloca " + this.pointeeType;
}
}