Ejemplo n.º 1
0
void CgSetType(                 // SET NORMAL TYPE FOR GENERATION
    TYPE type )                 // - the type
{
    if( OMR_CLASS_REF == ObjModelArgument( type ) ) {
        type = MakeReferenceTo( type );
    }
    CgSetTypeExact( type );
}
Ejemplo n.º 2
0
cg_type CgTypeSym(             // COMPUTE OUTPUT TYPE FOR SYMBOL
    SYMBOL sym )                // - the symbol
{
    TYPE type = sym->sym_type;
    if( SymIsArgument( sym )
     && NULL != StructType( type )
     && OMR_CLASS_REF == ObjModelArgument( type ) ) {
        type = MakeReferenceTo( type );
    }
    return CgTypeOutput( type );
}
Ejemplo n.º 3
0
TYPE TypeThisForCall(           // GET "THIS" TYPE FOR A CALL
    PTREE this_node,            // - this node
    SYMBOL sym )                // - function being called
{
    TYPE this_type;             // - target type for "this"

    this_type = SymClass( sym );
    if( ExprIsLvalue( this_node ) ) {
        this_type = MakeReferenceTo( this_type );
    } else {
        this_type = MakePointerTo( this_type );
    }
    return( this_type );
}
Ejemplo n.º 4
0
TYPE TypeCanonicalThr(          // GET CANONICAL THROW TYPE
    TYPE type )
{
    TYPE test;                  // - used to test type

    if( type != NULL ) {
        test = TypeReference( type );
        if( test == NULL ) {
            type = canonicalPtrType( type );
        } else {
            type = MakeReferenceTo( canonicalPtrType( test ) );
        }
    }
    return type;
}
Ejemplo n.º 5
0
TYPE TypeThisSymbol(            // GET TYPE OF THIS FOR SYMBOL MEMBER
    SYMBOL sym,                 // - symbol
    bool reference )            // - use reference?
{
    TYPE base;                  // - return: NULL or TYPE of "this" for symbol
    type_flag flags;            // - flags for "this" pointer

    base = getThisBaseType( sym );
    if( base != NULL ) {
        flags = FunctionThisFlags( sym );
        base = MakeModifiedType( base, flags );
        if( reference ) {
            base = MakeReferenceTo( base );
        } else {
            base = MakePointerTo( base );
        }
        base = MakeModifiedType( base, TF1_CONST );
    }
    return( base );
}