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,28 @@
package midend.llvm.value;
import midend.llvm.type.IrType;
import midend.llvm.constant.IrConstant;
public class IrGlobalValue extends IrValue {
private boolean isConstant;
private IrConstant initVal;
public IrGlobalValue(IrType type, String name, boolean isConstant, IrConstant initVal) {
super(type, name);
this.isConstant = isConstant;
this.initVal = initVal;
}
public boolean isConstant() {
return isConstant;
}
public IrConstant getInitVal() {
return initVal;
}
public String toString() {
return isConstant ? getName() + " = dso_local constant " + initVal.toString() :
getName() + " = dso_local global " + initVal.toString();
}
}