Changeset 083cf31 for src/SynTree/Type.h


Ignore:
Timestamp:
Jan 7, 2016, 11:28:48 AM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, with_gc
Children:
1e9d87b
Parents:
267cb3d (diff), de91427b (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 with master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Type.h

    r267cb3d r083cf31  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Type.h -- 
     7// Type.h --
    88//
    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 : Fri Nov 20 12:54:09 2015
    13 // Update Count     : 15
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Fri Dec 18 14:46:18 2015
     13// Update Count     : 18
    1414//
    1515
     
    2323class Type {
    2424  public:
    25         struct Qualifiers { 
     25        struct Qualifiers {
    2626                Qualifiers(): isConst( false ), isVolatile( false ), isRestrict( false ), isLvalue( false ), isAtomic( false ), isAttribute( false ) {}
    2727                Qualifiers( bool isConst, bool isVolatile, bool isRestrict, bool isLvalue, bool isAtomic, bool isAttribute ): isConst( isConst ), isVolatile( isVolatile ), isRestrict( isRestrict ), isLvalue( isLvalue ), isAtomic( isAtomic ), isAttribute( isAttribute ) {}
    28        
     28
    2929                Qualifiers &operator+=( const Qualifiers &other );
    3030                Qualifiers &operator-=( const Qualifiers &other );
     
    3636                bool operator<( const Qualifiers &other );
    3737                bool operator>( const Qualifiers &other );
    38        
     38
    3939                bool isConst;
    4040                bool isVolatile;
     
    4343                bool isAtomic;
    4444                bool isAttribute;
    45         };     
     45        };
    4646
    4747        Type( const Qualifiers &tq );
     
    8585class BasicType : public Type {
    8686  public:
    87         enum Kind { 
     87        enum Kind {
    8888                Bool,
    8989                Char,
     
    108108                LongDoubleImaginary,
    109109                NUMBER_OF_BASIC_TYPES
    110         }; 
     110        };
    111111
    112112        static const char *typeNames[];                                         // string names for basic types, MUST MATCH with Kind
     
    149149  private:
    150150        Type *base;
    151        
     151
    152152        // In C99, pointer types can be qualified in many ways e.g., int f( int a[ static 3 ] )
    153153        Expression *dimension;
     
    188188        virtual ~FunctionType();
    189189
    190         std::list<DeclarationWithType*>& get_returnVals() { return returnVals; }
    191         std::list<DeclarationWithType*>& get_parameters() { return parameters; }
     190        std::list<DeclarationWithType*> & get_returnVals() { return returnVals; }
     191        std::list<DeclarationWithType*> & get_parameters() { return parameters; }
    192192        bool get_isVarArgs() { return isVarArgs; }
    193193        void set_isVarArgs( bool newValue ) { isVarArgs = newValue; }
     
    217217        void set_name( std::string newValue ) { name = newValue; }
    218218        std::list< Expression* >& get_parameters() { return parameters; }
    219        
     219
    220220        virtual ReferenceToType *clone() const = 0;
    221221        virtual void accept( Visitor &v ) = 0;
     
    240240        /// Accesses generic parameters of base struct (NULL if none such)
    241241        std::list<TypeDecl*> * get_baseParameters();
    242        
     242
    243243        /// Looks up the members of this struct named "name" and places them into "foundDecls".
    244244        /// Clones declarations into "foundDecls", caller responsible for freeing
     
    250250  private:
    251251        virtual std::string typeString() const;
    252        
     252
    253253        // this decl is not "owned" by the struct inst; it is merely a pointer to elsewhere in the tree,
    254254        // where the structure used in this type is actually defined
     
    267267        /// Accesses generic parameters of base union (NULL if none such)
    268268        std::list<TypeDecl*> * get_baseParameters();
    269        
     269
    270270        /// looks up the members of this union named "name" and places them into "foundDecls"
    271271        /// Clones declarations into "foundDecls", caller responsible for freeing
     
    277277  private:
    278278        virtual std::string typeString() const;
    279        
     279
    280280        // this decl is not "owned" by the union inst; it is merely a pointer to elsewhere in the tree,
    281281        // where the union used in this type is actually defined
     
    310310  private:
    311311        virtual std::string typeString() const;
    312        
     312
    313313        // this member is filled in by the validate pass, which instantiates the members of the correponding
    314314        // aggregate with the actual type parameters specified for this use of the context
     
    327327        bool get_isFtype() const { return isFtype; }
    328328        void set_isFtype( bool newValue ) { isFtype = newValue; }
    329        
     329
    330330        virtual TypeInstType *clone() const { return new TypeInstType( *this ); }
    331331        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    463463}
    464464
     465std::ostream & operator<<( std::ostream & out, Type * type );
     466
    465467#endif // TYPE_H
    466468
Note: See TracChangeset for help on using the changeset viewer.