Package org.renjin.gcc.jimple

Examples of org.renjin.gcc.jimple.RealJimpleType


  public String declareTemp(JimpleType type) {
    return getBuilder().addTempVarDecl(type);
  }

  public String declareTemp(Class clazz) {
    return declareTemp(new RealJimpleType(clazz));
  }
View Full Code Here


    this.method = method;
  }

  @Override
  public JimpleType getReturnType() {
    return new RealJimpleType(method.getReturnType());
  }
View Full Code Here

  @Override
  public List<JimpleType> getParameterTypes() {
    List<JimpleType> types = Lists.newArrayList();
    for (Class type : method.getParameterTypes()) {
      types.add(new RealJimpleType(type));
    }
    return types;
  }
View Full Code Here

      compiler.getMethodTable().addMethod("Rf_pbeta",distributionsClass,"pbeta");

      compiler.getMethodTable().addReferenceClass(RenjinCApi.class);
      compiler.getMethodTable().addReferenceClass(Sort.class);

      compiler.provideType("SEXP_T", new SimpleRecordType(new RealJimpleType(GnuSEXP.class)));

      compiler.compile(units);
    }
  }
View Full Code Here

 
  public ImWrappedPtrExpr(JimpleExpr expr, JimpleType type) {
    this.expr = expr;
    this.wrapperType = type;
    try {
      this.arrayType = new RealJimpleType(Class.forName(wrapperType.toString()).getField("array").getType());
    } catch (Exception e) {
      throw new RuntimeException(e); // should not happen
    }
  }
View Full Code Here

  public JimpleType paramType() {
    throw new UnsupportedOperationException("arrays as parameters not supported");
  }

  public JimpleType asJimple() {
    return new RealJimpleType(componentType.getArrayClass());
  }
View Full Code Here


  public static JimpleType getArrayType(GimplePrimitiveType type) {
    if (type instanceof GimpleRealType) {
      if (((GimpleRealType) type).getPrecision() == 64) {
        return new RealJimpleType(double[].class);
      } else if (((GimpleRealType) type).getPrecision() == 32) {
        return new RealJimpleType(float[].class);
      }
    } else if (type instanceof GimpleIntegerType) {
      int precision = ((GimpleIntegerType) type).getPrecision();
      switch(precision) {
      case 8:
        return new RealJimpleType(char[].class);
      case 32:
        return new RealJimpleType(int[].class);
      case 64:
        return new RealJimpleType(long[].class);
      }
    } else if (type instanceof GimpleBooleanType) {
      return new RealJimpleType(boolean[].class);
    }
    throw new UnsupportedOperationException(type.toString());
  }
View Full Code Here

  }

  public static JimpleType getWrapperType(GimplePrimitiveType type) {
    if (type instanceof GimpleRealType) {
      if (((GimpleRealType) type).getPrecision() == 64) {
        return new RealJimpleType(DoublePtr.class);
      } else if (((GimpleRealType) type).getPrecision() == 32) {
        // TODO
      }
    } else if (type instanceof GimpleIntegerType) {
      int precision = ((GimpleIntegerType) type).getPrecision();
      switch(precision) {
      case 8:
        return new RealJimpleType(CharPtr.class);
      case 32:
        return new RealJimpleType(IntPtr.class);
      case 64:
        return new RealJimpleType(LongPtr.class);
      }
    } else if (type instanceof GimpleBooleanType) {
      // TODO
    }
    throw new UnsupportedOperationException(type.toString());
View Full Code Here

  }


  @Override
  public JimpleType paramType() {
    return new RealJimpleType(Object.class);
  }
View Full Code Here

    return new RealJimpleType(Object.class);
  }

  @Override
  public JimpleType returnType() {
    return new RealJimpleType(Ptr.class);
  }
View Full Code Here

TOP

Related Classes of org.renjin.gcc.jimple.RealJimpleType

Copyright © 2018 www.massapicom. 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.