示例#1
0
extern  bool    FindShort( ins_entry *ins, ins_entry *end )
/*********************************************************/
{
    for( ; ins != NULL && ins != end; ins = NextIns( ins ) ) {
        if( _Class( ins ) == OC_LABEL ) {
            if( _Attr( ins ) & ATTR_SHORT )
                return( true );
            _ClrStatus( _Label( ins ), SHORTREACH );
        }
    }
    return( false );
}
示例#2
0
static  void    TransformJumps( ins_entry *ins, ins_entry *first )
/****************************************************************/
{
    ins_entry           *add;
    ins_entry           *next;
    ins_entry           *lbl;
    oc_class            cl;

  optbegin
    if( _Class( ins ) == OC_RET )
        optreturnvoid;
    lbl = _Label( ins )->ins;
    if( lbl == NULL )
        optreturnvoid;
    add = lbl;
    for( ;; ) {
        if( add == NULL )
            optreturnvoid;
        cl = _Class( add );
        if( _TransferClass( cl ) )
            break;
        if( cl == OC_LABEL ) {
            if( _Attr( add ) & ATTR_SHORT )
                optreturnvoid;
            _ClrStatus( _Label( add ), SHORTREACH );
        }
        add = NextIns( add );
    }
    if( add == first || add == ins )
        optreturnvoid;
    if( FindShort( first, lbl ) )
        optreturnvoid;
    for( ;; ) {
        next = PrevIns( add );
        DeleteQueue( add );
        InsertQueue( add, first );
        if( add == lbl )
            break;
        add = next;
    }
    DeleteQueue( first );
    InsertQueue( first, next );
    Untangle( NextIns( first ) );
  optend
}