Пример #1
0
PCODE   ParmCode( itnode *arg ) {
//===============================

// Return the argument code.
// We cannot assume that USOPN_SAFE is PC_CONST otherwise we will not be able
// to diagnose an error in the following case (optimizing compiler only).
//      external f
//      print *, sin( f )
// "f" will be USOPN_SAFE by the time ParmCode() is called but we want to return
// PC_FN_OR_SUB.

    USOPN   opn;

    opn = arg->opn.us & USOPN_WHERE;
    if( ( arg->opn.us & USOPN_WHAT ) == USOPN_ARR ) {
        // an array name can't be part of an expression so check it first
        // so that we can detect whether an array has been passed to an
        // intrinsic function
        return( PC_ARRAY_NAME );
    } else if( opn == USOPN_VAL ) {
        return( PC_CONST );
    } else {
        return( ParmClass( arg ) );
    }
}
Пример #2
0
static  int     DumpArgInfo( itnode *node ) {
//===========================================

// Dump argument types.

    int         num_args;
    unsigned_16 arg_info;
    PTYPE       parm_type;
    PCODE       parm_code;
#if _CPU == 386
    aux_info    *aux;
#endif

    num_args = 0;
    if( node != NULL ) {
        for(;;) {
            if( node->opr == OPR_COL )
                break;
            if( node->opr == OPR_RBR )
                break;
            if( node->opn.ds == DSOPN_PHI )
                break;
            if( node->opn.us != USOPN_STN ) {
                parm_type = ParmType( node->typ, node->size );
                parm_code = ParmClass( node );
#if _CPU == 386
                if( (parm_code == PC_PROCEDURE) || (parm_code == PC_FN_OR_SUB) ) {
                    aux = AuxLookup( node->sym_ptr );
                    if( aux->cclass & FAR16_CALL ) {
                        parm_code |= PC_PROC_FAR16;
                    }
                }
#endif
                arg_info = _SetTypeInfo( parm_code, parm_type );
                OutU16( arg_info );
                ++num_args;
            }
            node = node->link;
        }
    }
    return( num_args );
}