Changeset 3d5701e for src/SynTree/Type.h


Ignore:
Timestamp:
Feb 25, 2020, 1:17:33 PM (6 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:
7dc2e015
Parents:
9fb8f01 (diff), dd9e1ca (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:

resolve conflict

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Type.h

    r9fb8f01 r3d5701e  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 14 17:11:24 2019
    13 // Update Count     : 169
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Sep  4 09:58:00 2019
     13// Update Count     : 170
    1414//
    1515
     
    102102        }; // StorageClasses
    103103
    104         enum { Const = 1 << 0, Restrict = 1 << 1, Volatile = 1 << 2, Lvalue = 1 << 3, Mutex = 1 << 4, Atomic = 1 << 5, NumTypeQualifier = 6 };
     104        enum { Const = 1 << 0, Restrict = 1 << 1, Volatile = 1 << 2, Mutex = 1 << 3, Atomic = 1 << 4, NumTypeQualifier = 5 };
    105105        static const char * QualifiersNames[];
    106106        union Qualifiers {
    107                 enum { Mask = ~(Restrict | Lvalue) };
     107                enum { Mask = ~Restrict };
    108108                unsigned int val;
    109109                struct {
     
    111111                        bool is_restrict : 1;
    112112                        bool is_volatile : 1;
    113                         bool is_lvalue : 1;
    114113                        bool is_mutex : 1;
    115114                        bool is_atomic : 1;
     
    131130                bool operator>( Qualifiers other ) const { return *this != other && *this >= other; }
    132131                BFCommon( Qualifiers, NumTypeQualifier )
     132
     133                Qualifiers unify( Qualifiers const & other ) const {
     134                        int or_flags = Mask & (val | other.val);
     135                        int and_flags = val & other.val;
     136                        return Qualifiers( or_flags | and_flags );
     137                }
    133138        }; // Qualifiers
    134139
     
    147152        bool get_volatile() const { return tq.is_volatile; }
    148153        bool get_restrict() const { return tq.is_restrict; }
    149         bool get_lvalue() const { return tq.is_lvalue; }
    150154        bool get_mutex() const { return tq.is_mutex; }
    151155        bool get_atomic() const { return tq.is_atomic; }
     
    153157        void set_volatile( bool newValue ) { tq.is_volatile = newValue; }
    154158        void set_restrict( bool newValue ) { tq.is_restrict = newValue; }
    155         void set_lvalue( bool newValue ) { tq.is_lvalue = newValue; }
    156159        void set_mutex( bool newValue ) { tq.is_mutex = newValue; }
    157160        void set_atomic( bool newValue ) { tq.is_atomic = newValue; }
Note: See TracChangeset for help on using the changeset viewer.