Ignore:
Timestamp:
Apr 28, 2015, 4:21:36 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
42e2ad7
Parents:
ad17ba6a
Message:

fixed sizeof type variable, find lowest cost alternative for sizeof expression, removed unused classes, added compiler flag, remove temporary file for -CFA, formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/SynTree/Type.h

    rad17ba6a rbdd516a  
    1010  public:
    1111    struct Qualifiers { 
    12       Qualifiers(): isConst( false ), isVolatile( false ), isRestrict( false ), isLvalue( false ) {}
    13       Qualifiers( bool isConst, bool isVolatile, bool isRestrict, bool isLvalue ): isConst( isConst ), isVolatile( isVolatile ), isRestrict( isRestrict ), isLvalue( isLvalue ) {}
     12      Qualifiers(): isConst( false ), isVolatile( false ), isRestrict( false ), isLvalue( false ), isAtomic( false ) {}
     13      Qualifiers( bool isConst, bool isVolatile, bool isRestrict, bool isLvalue, bool isAtomic ): isConst( isConst ), isVolatile( isVolatile ), isRestrict( isRestrict ), isLvalue( isLvalue ), isAtomic( isAtomic ) {}
    1414       
    1515        Qualifiers &operator+=( const Qualifiers &other );
     
    2727        bool isRestrict;
    2828        bool isLvalue;
     29        bool isAtomic;
    2930    }; 
    3031
     
    3839    bool get_isRestrict() { return tq.isRestrict; }
    3940    bool get_isLvalue() { return tq.isLvalue; }
     41    bool get_isAtomic() { return tq.isAtomic; }
    4042    void set_isConst( bool newValue ) { tq.isConst = newValue; }
    4143    void set_iisVolatile( bool newValue ) { tq.isVolatile = newValue; }
    4244    void set_isRestrict( bool newValue ) { tq.isRestrict = newValue; }
    4345    void set_isLvalue( bool newValue ) { tq.isLvalue = newValue; }
     46    void set_isAtomic( bool newValue ) { tq.isAtomic = newValue; }
    4447    std::list<TypeDecl*>& get_forall() { return forall; }
    4548
     
    380383    isRestrict |= other.isRestrict;
    381384    isLvalue |= other.isLvalue;
     385    isAtomic |= other.isAtomic;
    382386    return *this;
    383387}
     
    387391    if ( other.isVolatile ) isVolatile = 0;
    388392    if ( other.isRestrict ) isRestrict = 0;
     393    if ( other.isAtomic ) isAtomic = 0;
    389394    return *this;
    390395}
     
    398403inline bool Type::Qualifiers::operator==( const Qualifiers &other ) {
    399404    return isConst == other.isConst
    400     && isVolatile == other.isVolatile
    401     && isRestrict == other.isRestrict;
    402 ///         && isLvalue == other.isLvalue;
     405        && isVolatile == other.isVolatile
     406        && isRestrict == other.isRestrict
     407//      && isLvalue == other.isLvalue
     408        && isAtomic == other.isAtomic;
    403409}
    404410
     
    406412    return isConst != other.isConst
    407413        || isVolatile != other.isVolatile
    408         || isRestrict != other.isRestrict;
    409 ///         && isLvalue == other.isLvalue;
     414        || isRestrict != other.isRestrict
     415//      || isLvalue != other.isLvalue
     416        || isAtomic != other.isAtomic;
    410417}
    411418
     
    413420    return isConst <= other.isConst
    414421        && isVolatile <= other.isVolatile
    415         && isRestrict <= other.isRestrict;
    416 ///         && isLvalue >= other.isLvalue;
     422        && isRestrict <= other.isRestrict
     423//      && isLvalue >= other.isLvalue
     424        && isAtomic == other.isAtomic;
    417425}
    418426
     
    420428    return isConst >= other.isConst
    421429        && isVolatile >= other.isVolatile
    422         && isRestrict >= other.isRestrict;
    423 ///         && isLvalue <= other.isLvalue;
     430        && isRestrict >= other.isRestrict
     431//      && isLvalue <= other.isLvalue
     432        && isAtomic == other.isAtomic;
    424433}
    425434
Note: See TracChangeset for help on using the changeset viewer.