Changeset ae63a18 for src/SynTree/Type.h
- Timestamp:
- Dec 18, 2015, 2:56:11 PM (9 years ago)
- 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:
- 8762501
- Parents:
- baf7fee (diff), c23f807 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Type.h
rbaf7fee rae63a18 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Type.h -- 7 // Type.h -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Dec 09 14:08:41201513 // Update Count : 1 712 // Last Modified On : Fri Dec 18 14:46:18 2015 13 // Update Count : 18 14 14 // 15 15 … … 23 23 class Type { 24 24 public: 25 struct Qualifiers { 25 struct Qualifiers { 26 26 Qualifiers(): isConst( false ), isVolatile( false ), isRestrict( false ), isLvalue( false ), isAtomic( false ), isAttribute( false ) {} 27 27 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 29 29 Qualifiers &operator+=( const Qualifiers &other ); 30 30 Qualifiers &operator-=( const Qualifiers &other ); … … 36 36 bool operator<( const Qualifiers &other ); 37 37 bool operator>( const Qualifiers &other ); 38 38 39 39 bool isConst; 40 40 bool isVolatile; … … 43 43 bool isAtomic; 44 44 bool isAttribute; 45 }; 45 }; 46 46 47 47 Type( const Qualifiers &tq ); … … 85 85 class BasicType : public Type { 86 86 public: 87 enum Kind { 87 enum Kind { 88 88 Bool, 89 89 Char, … … 108 108 LongDoubleImaginary, 109 109 NUMBER_OF_BASIC_TYPES 110 }; 110 }; 111 111 112 112 static const char *typeNames[]; // string names for basic types, MUST MATCH with Kind … … 149 149 private: 150 150 Type *base; 151 151 152 152 // In C99, pointer types can be qualified in many ways e.g., int f( int a[ static 3 ] ) 153 153 Expression *dimension; … … 188 188 virtual ~FunctionType(); 189 189 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; } 192 192 bool get_isVarArgs() { return isVarArgs; } 193 193 void set_isVarArgs( bool newValue ) { isVarArgs = newValue; } … … 217 217 void set_name( std::string newValue ) { name = newValue; } 218 218 std::list< Expression* >& get_parameters() { return parameters; } 219 219 220 220 virtual ReferenceToType *clone() const = 0; 221 221 virtual void accept( Visitor &v ) = 0; … … 240 240 /// Accesses generic parameters of base struct (NULL if none such) 241 241 std::list<TypeDecl*> * get_baseParameters(); 242 242 243 243 /// Looks up the members of this struct named "name" and places them into "foundDecls". 244 244 /// Clones declarations into "foundDecls", caller responsible for freeing … … 250 250 private: 251 251 virtual std::string typeString() const; 252 252 253 253 // this decl is not "owned" by the struct inst; it is merely a pointer to elsewhere in the tree, 254 254 // where the structure used in this type is actually defined … … 267 267 /// Accesses generic parameters of base union (NULL if none such) 268 268 std::list<TypeDecl*> * get_baseParameters(); 269 269 270 270 /// looks up the members of this union named "name" and places them into "foundDecls" 271 271 /// Clones declarations into "foundDecls", caller responsible for freeing … … 277 277 private: 278 278 virtual std::string typeString() const; 279 279 280 280 // this decl is not "owned" by the union inst; it is merely a pointer to elsewhere in the tree, 281 281 // where the union used in this type is actually defined … … 310 310 private: 311 311 virtual std::string typeString() const; 312 312 313 313 // this member is filled in by the validate pass, which instantiates the members of the correponding 314 314 // aggregate with the actual type parameters specified for this use of the context … … 327 327 bool get_isFtype() const { return isFtype; } 328 328 void set_isFtype( bool newValue ) { isFtype = newValue; } 329 329 330 330 virtual TypeInstType *clone() const { return new TypeInstType( *this ); } 331 331 virtual void accept( Visitor &v ) { v.visit( this ); }
Note: See TracChangeset
for help on using the changeset viewer.