Ignore:
Timestamp:
Jun 4, 2019, 6:39:23 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
c6a1e8a
Parents:
7564e10 (diff), 1346914 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/WidenMode.h

    r7564e10 r67130fe  
    1818namespace ResolvExpr {
    1919        struct WidenMode {
    20                 WidenMode( bool widenFirst, bool widenSecond ): widenFirst( widenFirst ), widenSecond( widenSecond ) {}
    21                 WidenMode &operator|=( const WidenMode &other ) { widenFirst |= other.widenFirst; widenSecond |= other.widenSecond; return *this; }
    22                 WidenMode &operator&=( const WidenMode &other ) { widenFirst &= other.widenFirst; widenSecond &= other.widenSecond; return *this; }
    23                 WidenMode operator|( const WidenMode &other ) { WidenMode newWM( *this ); newWM |= other; return newWM; }
    24                 WidenMode operator&( const WidenMode &other ) { WidenMode newWM( *this ); newWM &= other; return newWM; }
    25                 operator bool() { return widenFirst && widenSecond; }
     20                WidenMode( bool first, bool second ): first( first ), second( second ) {}
     21               
     22                WidenMode &operator|=( const WidenMode &other ) {
     23                        first |= other.first; second |= other.second; return *this;
     24                }
    2625
    27                 bool widenFirst : 1, widenSecond : 1;
     26                WidenMode &operator&=( const WidenMode &other ) {
     27                        first &= other.first; second &= other.second; return *this;
     28                }
     29
     30                WidenMode operator|( const WidenMode &other ) {
     31                        WidenMode newWM( *this ); newWM |= other; return newWM;
     32                }
     33
     34                WidenMode operator&( const WidenMode &other ) {
     35                        WidenMode newWM( *this ); newWM &= other; return newWM;
     36                }
     37               
     38                operator bool() { return first && second; }
     39
     40                bool first : 1, second : 1;
    2841        };
     42
     43        static inline WidenMode noWiden() { return { false, false }; }
    2944} // namespace ResolvExpr
    3045
Note: See TracChangeset for help on using the changeset viewer.