Package soot

Examples of soot.Type


                        expr.setBaseType(RefType
                                .v(PtolemyUtilities.runtimeExceptionClass));
                    }
                } else if (value instanceof CastExpr) {
                    CastExpr expr = (CastExpr) value;
                    Type castType = expr.getCastType();

                    if (castType instanceof RefType
                            && _isPtolemyException(((RefType) castType)
                                    .getSootClass())) {
                        expr.setCastType(RefType
                                .v(PtolemyUtilities.runtimeExceptionClass));
                    }
                } else if (value instanceof SpecialInvokeExpr) {
                    // Fix the exception constructors.
                    SpecialInvokeExpr expr = (SpecialInvokeExpr) value;
                    SootClass exceptionClass = ((RefType) expr.getBase()
                            .getType()).getSootClass();

                    if (_isPtolemyException(exceptionClass)) {
                        Value foundArg = null;

                        for (Iterator args = expr.getArgs().iterator(); args
                                .hasNext();) {
                            Value arg = (Value) args.next();

                            if (arg.getType().equals(
                                    RefType.v(PtolemyUtilities.stringClass))) {
                                foundArg = arg;
                                break;
                            }
                        }

                        if ((foundArg == null) || _obfuscate) {
                            box
                                    .setValue(Jimple
                                            .v()
                                            .newSpecialInvokeExpr(
                                                    (Local) expr.getBase(),
                                                    PtolemyUtilities.runtimeExceptionConstructor
                                                            .makeRef(),
                                                    Collections.EMPTY_LIST));
                        } else {
                            box
                                    .setValue(Jimple
                                            .v()
                                            .newSpecialInvokeExpr(
                                                    (Local) expr.getBase(),
                                                    PtolemyUtilities.runtimeExceptionStringConstructor
                                                            .makeRef(),
                                                    foundArg));
                        }
                    }
                } else if (value instanceof VirtualInvokeExpr) {
                    VirtualInvokeExpr expr = (VirtualInvokeExpr) value;
                    Type exceptionType = expr.getBase().getType();

                    if (exceptionType instanceof RefType) {
                        SootClass exceptionClass = ((RefType) exceptionType)
                                .getSootClass();
View Full Code Here


            }

            String className = attribute.getClass().getName();
            Scene.v().loadClassAndSupport(className);

            Type attributeType = RefType.v(className);
            String attributeName = attribute.getName(context);
            String fieldName = getFieldNameForAttribute(attribute, context);

            Local local;
View Full Code Here

            }

            // retrieve the existing field.
            SootField field = theClass.getFieldByName(fieldName);

            Type type = field.getType();

            if (!(type instanceof RefType)) {
                System.out.println("Class " + theClass
                        + " declares field for attribute "
                        + attribute.getFullName() + " but it has type " + type);
View Full Code Here

            }

            // retrieve the existing field.
            field = theClass.getFieldByName(fieldName);

            Type type = field.getType();

            if (!(type instanceof RefType)) {
                System.out.println("Class " + theClass
                        + " declares field for port " + port.getFullName()
                        + " but it has type " + type);
View Full Code Here

            String phaseName, Map options) throws IllegalActionException {
        InlinePortTransformer.setPortInliner(model, new SDFPortInliner(
                modelClass, model, options));
        System.out.println("Inlining director for " + model.getFullName());

        Type actorType = RefType.v(PtolemyUtilities.actorClass);

        SootField postfireReturnsField = new SootField("_postfireReturns",
                BooleanType.v(), Modifier.PRIVATE);
        modelClass.addField(postfireReturnsField);
View Full Code Here

  }
 
  public String mangleArgs(SootMethod method){
    String ret = "";

    Type return_type = method.getReturnType();
    ret += mangle(return_type);
   
    List parameter_types = method.getParameterTypes();
    for(int i = 0; i < parameter_types.size(); ++i){
      Type type = (Type) parameter_types.get(i);
      ret += mangle(type);
    }
    return ret;
  }
View Full Code Here

  }

  private void caseDefinitionStmt(DefinitionStmt arg0){
    Value left_op = arg0.getLeftOp();
    Value right_op = arg0.getRightOp();
    Type left_op_type = left_op.getType();
    OpenCLType ocl_left_op_type = new OpenCLType(left_op_type);

    //if the left op is a field ref or array ref we use the setter
    if(left_op instanceof FieldRef || left_op instanceof ArrayRef){
      m_valueSwitch.setLhs();
View Full Code Here

   
    //go into the method
    HierarchyValueSwitch value_switch = RootbeerClassLoader.v().getValueSwitch(signature);
    for(Integer num : value_switch.getAllTypesInteger()){
      String type_str = StringNumbers.v().getString(num);
      Type type = converter.convert(type_str);
      m_currDfsInfo.addType(type);
    }   

    for(HierarchySignature method_sig : value_switch.getMethodRefsHierarchy()){
      m_currDfsInfo.addMethod(signature.toString());
      queue.add(method_sig);
    }

    for(String field_ref : value_switch.getFieldRefs()){
      futil.parse(field_ref);
      SootField soot_field = futil.getSootField();
      m_currDfsInfo.addField(soot_field);
    }

    for(Integer num : value_switch.getInstanceOfsInteger()){
      String type_str = StringNumbers.v().getString(num);
      Type type = converter.convert(type_str);
      m_currDfsInfo.addInstanceOf(type);
    }
  }
View Full Code Here

    this.m_existingMethod = method;
  }

  public List<Local> getInputArguments() {
    List<Local> ret = new ArrayList<Local>();
    Type t = m_existingMethod.getDeclaringClass().getType();
    Local l = new JimpleLocal("r0", t);
    ret.add(l);
    return ret;
  }
View Full Code Here

    return new ArrayList<Value>();
  }

  public List<Type> getParameterTypes() {
    List<Type> ret = new ArrayList<Type>();
    Type t = m_existingMethod.getDeclaringClass().getType();
    ret.add(t);
    return ret;
  }
View Full Code Here

TOP

Related Classes of soot.Type

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.