Changeset 168c007 for src/SynTree


Ignore:
Timestamp:
Mar 21, 2017, 12:50:27 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
da6d4566, f5392c1
Parents:
94a8123 (diff), e04b636 (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:/u/cforall/software/cfa/cfa-cc

Location:
src/SynTree
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r94a8123 r168c007  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 08:34:11 2017
    13 // Update Count     : 118
     12// Last Modified On : Fri Mar 17 16:05:08 2017
     13// Update Count     : 121
    1414//
    1515
     
    255255        typedef AggregateDecl Parent;
    256256  public:
    257         StructDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes ) {}
     257        StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes ), kind( kind ) {}
    258258        StructDecl( const StructDecl &other ) : Parent( other ) {}
    259259
     260        bool is_coroutine() { return kind == DeclarationNode::Coroutine; }
     261        bool is_monitor() { return kind == DeclarationNode::Monitor; }
     262        bool is_thread() { return kind == DeclarationNode::Thread; }
     263
    260264        virtual StructDecl *clone() const { return new StructDecl( *this ); }
    261265        virtual void accept( Visitor &v ) { v.visit( this ); }
    262266        virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    263267  private:
     268        DeclarationNode::Aggregate kind;
    264269        virtual std::string typeString() const;
    265270};
  • src/SynTree/Type.h

    r94a8123 r168c007  
    117117                bool operator!=( Qualifiers other ) const { return (val & Mask) != (other.val & Mask); }
    118118                bool operator<=( Qualifiers other ) const {
    119                         return is_const <= other.is_const && is_volatile <= other.is_volatile &&
    120                                 is_mutex >= other.is_mutex && is_atomic == other.is_atomic;
     119                        return is_const    <= other.is_const        //Any non-const converts to const without cost
     120                                        && is_volatile <= other.is_volatile     //Any non-volatile converts to volatile without cost
     121                                        && is_mutex    >= other.is_mutex        //Any mutex converts to non-mutex without cost
     122                                        && is_atomic   == other.is_atomic;      //No conversion from atomic to non atomic is free
    121123                }
    122124                bool operator<( Qualifiers other ) const { return *this != other && *this <= other; }
Note: See TracChangeset for help on using the changeset viewer.