Search in sources :

Example 1 with StringConstant

use of org.robovm.compiler.llvm.StringConstant in project robovm by robovm.

the class ModuleBuilder method getString.

public Constant getString(String string) {
    Global g = strings.get(string);
    if (g == null) {
        byte[] modUtf8 = stringToModifiedUtf8Z(string);
        g = new Global(getStringVarName(modUtf8), Linkage.weak, new StringConstant(modUtf8), true);
        addGlobal(g);
        strings.put(string, g);
    }
    return new ConstantGetelementptr(new GlobalRef(g), 0, 0);
}
Also used : GlobalRef(org.robovm.compiler.llvm.GlobalRef) StringConstant(org.robovm.compiler.llvm.StringConstant) ConstantGetelementptr(org.robovm.compiler.llvm.ConstantGetelementptr) Global(org.robovm.compiler.llvm.Global)

Aggregations

ConstantGetelementptr (org.robovm.compiler.llvm.ConstantGetelementptr)1 Global (org.robovm.compiler.llvm.Global)1 GlobalRef (org.robovm.compiler.llvm.GlobalRef)1 StringConstant (org.robovm.compiler.llvm.StringConstant)1