Examples of ImType


Examples of org.renjin.gcc.translate.type.ImType

    }
  }

  private void buildFields(SimpleRecordType struct, JimpleClassBuilder recordClass, GimpleRecordTypeDef def) {
    for (GimpleField member : def.getFields()) {
      ImType type = context.resolveType(member.getType());
      struct.addMember(member.getName(), type);

      JimpleFieldBuilder field = recordClass.newField();
      field.setName(member.getName());
      field.setType(type.returnType()); // TODO: probably need a fieldType()
      field.setModifiers(JimpleModifiers.PUBLIC);
    }

  }
View Full Code Here

Examples of org.renjin.gcc.translate.type.ImType

      symbolTable.put(decl.getId(), localVariable);
    }

    for (GimpleParameter param : gimpleFunction.getParameters()) {
      ImType type = translationContext.resolveType(param.getType());
      builder.addParameter(type.paramType(), "p_" + param.getName());
      ImExpr paramExpr = JvmExprs.toExpr(this, new JimpleExpr("p_" + param.getName()), type.paramType(), true);

      Variable variable = type.createLocalVariable(this, param.getName(), varUsage.getUsage(param.getId()));
      variable.writeAssignment(this, paramExpr);


      symbolTable.put(param.getId(), variable);
    }
View Full Code Here

Examples of org.renjin.gcc.translate.type.ImType

  private void translateGlobalVarDecl(GimpleVarDecl varDecl) {
  
    try {
     
      ImType type = resolveType(varDecl.getType());
 
      type.defineField(mainClass, varDecl.getName(), false);

      globalVariables.put(varDecl.getName(), type.createFieldExpr(
          null, new SyntheticJimpleType(mainClass.getFqcn()),
          varDecl.getName()));
     
    } catch(Exception e) {
      throw new RuntimeException("Exception translating global variable '" + varDecl.getName() + "'", e);
View Full Code Here

Examples of org.renjin.gcc.translate.type.ImType

    }
    return (FunPtrVar) var;
  }

  private ImFunctionType getFunctionType(FunctionContext context, GimpleCall call) {
    ImType type = context.resolveExpr(call.getFunction()).type();
    if (!(type instanceof ImFunctionPtrType)) {
      throw new UnsupportedOperationException("Function value must be of type ImFunctionPtrType, got: " + type);
    }
    return ((ImFunctionPtrType) type).baseType();
  }
View Full Code Here

Examples of org.renjin.gcc.translate.type.ImType

  public String toString() {
    return "<struct: "  + jimpleType + ">";
  }

  public ImPrimitiveType getMemberType(String member) {
    ImType type = types.get(member);
    if(type == null) {
      throw new IllegalArgumentException("no member named '" + member + "'");
    }
    return (ImPrimitiveType) type;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.