Changeset 90152a4 for src/SynTree/Declaration.h
- Timestamp:
- Aug 27, 2018, 4:40:34 PM (7 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b7c89aa
- Parents:
- f9feab8 (diff), 305581d (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/Declaration.h
rf9feab8 r90152a4 84 84 Expression *asmName; 85 85 std::list< Attribute * > attributes; 86 bool isDeleted = false; 86 87 87 88 DeclarationWithType( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, Type::FuncSpecifiers fs ); … … 151 152 FunctionType *type; 152 153 CompoundStmt *statements; 154 std::list< Expression * > withExprs; 153 155 154 156 FunctionDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, … … 200 202 typedef NamedTypeDecl Parent; 201 203 public: 202 enum Kind { Dtype, Ftype, Ttype };204 enum Kind { Dtype, Ftype, Ttype, NUMBER_OF_KINDS }; 203 205 204 206 Type * init; … … 244 246 typedef NamedTypeDecl Parent; 245 247 public: 246 TypedefDecl( const std::string &name, Type::StorageClasses scs, Type *type, LinkageSpec::Spec spec = LinkageSpec::Cforall ) : Parent( name, scs, type ) { set_linkage( spec ); } 248 TypedefDecl( const std::string &name, CodeLocation location, Type::StorageClasses scs, Type *type, LinkageSpec::Spec spec = LinkageSpec::Cforall ) 249 : Parent( name, scs, type ) { set_linkage( spec ); this->location = location; } 250 247 251 TypedefDecl( const TypedefDecl &other ) : Parent( other ) {} 248 252 … … 262 266 bool body; 263 267 std::list< Attribute * > attributes; 268 AggregateDecl * parent = nullptr; 264 269 265 270 AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ); … … 319 324 EnumDecl( const EnumDecl &other ) : Parent( other ) {} 320 325 326 bool valueOf( Declaration * enumerator, long long int & value ); 327 321 328 virtual EnumDecl *clone() const override { return new EnumDecl( *this ); } 322 329 virtual void accept( Visitor &v ) override { v.visit( this ); } 323 330 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 324 331 private: 332 std::map< std::string, long long int > enumValues; 325 333 virtual std::string typeString() const override; 326 334 }; … … 355 363 virtual void accept( Visitor &v ) override { v.visit( this ); } 356 364 virtual AsmDecl *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 365 virtual void print( std::ostream &os, Indenter indent = {} ) const override; 366 virtual void printShort( std::ostream &os, Indenter indent = {} ) const override; 367 }; 368 369 class StaticAssertDecl : public Declaration { 370 public: 371 Expression * condition; 372 ConstantExpr * message; // string literal 373 374 StaticAssertDecl( Expression * condition, ConstantExpr * message ); 375 StaticAssertDecl( const StaticAssertDecl & other ); 376 virtual ~StaticAssertDecl(); 377 378 virtual StaticAssertDecl * clone() const override { return new StaticAssertDecl( *this ); } 379 virtual void accept( Visitor &v ) override { v.visit( this ); } 380 virtual StaticAssertDecl * acceptMutator( Mutator &m ) override { return m.mutate( this ); } 357 381 virtual void print( std::ostream &os, Indenter indent = {} ) const override; 358 382 virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
Note:
See TracChangeset
for help on using the changeset viewer.