Package soot

Examples of soot.Type


        // Check to see if we have anything to do.
        if (namedObj.attributeList().size() == 0) {
            return;
        }

        Type variableType = RefType.v(PtolemyUtilities.variableClass);

        // A local that we will use to set the value of our
        // settable attributes.
        Local attributeLocal = Jimple.v().newLocal("attribute",
                PtolemyUtilities.attributeType);
View Full Code Here


                // named objects, except for the CGInit method, which
                // is always inlined.
                boolean hasDangerousType = false;

                {
                    Type type = targetMethod.getReturnType();

                    if (type instanceof RefType) {
                        SootClass typeClass = ((RefType) type).getSootClass();

                        if (SootUtilities.derivesFrom(typeClass,
                                PtolemyUtilities.namedObjClass)) {
                            hasDangerousType = true;
                        }
                    }
                }

                for (Iterator argTypes = targetMethod.getParameterTypes()
                        .iterator(); argTypes.hasNext();) {
                    Type type = (Type) argTypes.next();

                    if (type instanceof RefType) {
                        SootClass typeClass = ((RefType) type).getSootClass();

                        if (SootUtilities.derivesFrom(typeClass,
View Full Code Here

     @param method The method.
     *  @return The header code.
     */
    protected String _generateMethodHeader(SootMethod method) {
        StringBuffer header = new StringBuffer();
        Type returnType = method.getReturnType();
        header.append(CNames.typeNameOf(returnType));
        _updateRequiredTypes(returnType);
        header.append(" ");
        header.append(CNames.functionNameOf(method));
        header.append("(");
View Full Code Here

        while (parameters.hasNext()) {
            if ((++numberOfParameters) > 1) {
                code.append(", ");
            }

            Type parameterType = (Type) (parameters.next());
            code.append(CNames.typeNameOf(parameterType));

            _updateRequiredTypes(parameterType);

            if (parameterType instanceof ArrayType) {
View Full Code Here

    /** Generate code for an instanceof expression.
     *  @param v The instanceof expression.
     */
    public void caseInstanceOfExpr(InstanceOfExpr v) {
        // instanceof is needed only for RefTypes.
        Type type = v.getCheckType();

        if ((type instanceof RefType)) {
            v.getOp().apply(this);
            _push(CNames.instanceOfFunction + "(" + "(PCCG_CLASS_INSTANCE*)"
                    + _pop() + ", "
View Full Code Here

    /** Generate code for a "new object" expression.
     *  @param v The expression.
     */
    public void caseNewExpr(NewExpr v) {
        Type type = v.getType();

        if (_debug) {
            System.out.println("new expr types: "
                    + v.getBaseType().getClass().getName() + ", "
                    + v.getType().getClass().getName() + ", "
View Full Code Here

        int dataWidth = 32;

        // Number of bits in "int" for C. Java has 64bits, but we can't
        // implement that in C yet.
        Type dataType = v.getOp1().getType();

        if (dataType instanceof PrimType) {
            if (dataType instanceof ByteType) {
                dataWidth = 8;
            } else if (dataType instanceof IntType) {
View Full Code Here

        int dataWidth = 32;

        // Number of bits in "int" for C. Java has 64bits, but we can't
        // implement that in C yet.
        Type dataType = v.getOp1().getType();

        if (dataType instanceof PrimType) {
            if (dataType instanceof ByteType) {
                dataWidth = 8;
            } else if (dataType instanceof IntType) {
View Full Code Here

        int dataWidth = 32;

        // Number of bits in "int" for C. Java has 64bits, but we can't
        // implement that in C yet.
        Type dataType = v.getOp1().getType();

        // The "ifs" are in this order so that only the shortest data type
        // is chosen.
        if (dataType instanceof PrimType) {
            if (dataType instanceof ByteType) {
View Full Code Here

        SootMethod method = expression.getMethod();

        int count = previousArguments;

        while (args.hasNext()) {
            Type expectedParamType = method.getParameterType(count
                    - previousArguments);

            if (count++ > 0) {
                code.append(", ");
            }
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.