Changes in / [06cafa4:c65a80b]
- Location:
- src
- Files:
-
- 5 edited
-
Common/Indenter.h (modified) (1 diff)
-
Parser/DeclarationNode.cc (modified) (2 diffs)
-
Parser/ParseNode.h (modified) (3 diffs)
-
Parser/TypeData.cc (modified) (4 diffs)
-
SynTree/Declaration.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/Indenter.h
r06cafa4 rc65a80b 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Indenter.h --7 // utility.h -- 8 8 // 9 // Author : R ob Schluntz10 // Created On : Fri Jun 30 16:55:23 20179 // Author : Richard C. Bilson 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Aug 11 11:15:00 201713 // Update Count : 112 // Last Modified On : Fri May 5 11:03:00 2017 13 // Update Count : 32 14 14 // 15 15 -
src/Parser/DeclarationNode.cc
r06cafa4 rc65a80b 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Aug 10 17:02:00 201713 // Update Count : 102 112 // Last Modified On : Fri Jul 14 16:55:00 2017 13 // Update Count : 1020 14 14 // 15 15 … … 275 275 return newnode; 276 276 } // DeclarationNode::newEnumConstant 277 278 DeclarationNode * DeclarationNode::newTreeStruct( Aggregate kind, const string * name, const string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body ) { 279 assert( name ); 280 DeclarationNode * newnode = new DeclarationNode; 281 newnode->type = new TypeData( TypeData::Aggregate ); 282 newnode->type->aggregate.kind = kind; 283 newnode->type->aggregate.name = name; 284 newnode->type->aggregate.actuals = actuals; 285 newnode->type->aggregate.fields = fields; 286 newnode->type->aggregate.body = body; 287 newnode->type->aggregate.tagged = true; 288 newnode->type->aggregate.parent = parent; 289 return newnode; 290 } // DeclarationNode::newTreeStruct 277 291 278 292 DeclarationNode * DeclarationNode::newName( string * name ) { -
src/Parser/ParseNode.h
r06cafa4 rc65a80b 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 13:28:16 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thu Aug 10 16:54:00201713 // Update Count : 78 911 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 27 12:08:08 2017 13 // Update Count : 788 14 14 // 15 15 … … 248 248 static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement 249 249 250 // Perhaps this would best fold into newAggragate. 251 static DeclarationNode * newTreeStruct( Aggregate kind, const std::string * name, const std::string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body ); 252 250 253 DeclarationNode(); 251 254 ~DeclarationNode(); … … 332 335 333 336 static UniqueName anonymous; 337 338 // Temp to test TreeStruct 339 const std::string * parent_name; 334 340 }; // DeclarationNode 335 341 -
src/Parser/TypeData.cc
r06cafa4 rc65a80b 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Aug 11 10:50:00 201712 // Last Modified On : Wed Aug 9 13:50:00 2017 13 13 // Update Count : 567 14 14 // … … 63 63 aggregate.fields = nullptr; 64 64 aggregate.body = false; 65 aggregate.tagged = false; 66 aggregate.parent = nullptr; 65 67 break; 66 68 case AggregateInst: … … 121 123 delete aggregate.actuals; 122 124 delete aggregate.fields; 125 delete aggregate.parent; 123 126 // delete aggregate; 124 127 break; … … 621 624 switch ( td->aggregate.kind ) { 622 625 case DeclarationNode::Struct: 626 if ( td->aggregate.tagged ) { 627 at = new StructDecl( *td->aggregate.name, td->aggregate.parent, attributes, linkage ); 628 buildForall( td->aggregate.params, at->get_parameters() ); 629 break; 630 } 623 631 case DeclarationNode::Coroutine: 624 632 case DeclarationNode::Monitor: -
src/SynTree/Declaration.h
r06cafa4 rc65a80b 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Aug 11 10:20:00 201713 // Update Count : 12 712 // Last Modified On : Wed Aug 9 14:45:00 2017 13 // Update Count : 126 14 14 // 15 15 … … 269 269 typedef AggregateDecl Parent; 270 270 public: 271 StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ) {} 272 StructDecl( const StructDecl &other ) : Parent( other ), kind( other.kind ) {} 271 StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ), tagged( false ), parent_name( "" ) {} 272 StructDecl( const std::string &name, const std::string *parent, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( DeclarationNode::Struct ), tagged( true ), parent_name( parent ? *parent : "" ) {} 273 StructDecl( const StructDecl &other ) : Parent( other ) {} 273 274 274 275 bool is_coroutine() { return kind == DeclarationNode::Coroutine; } … … 276 277 bool is_thread() { return kind == DeclarationNode::Thread; } 277 278 279 // Tagged/Tree Structure Excetion 280 bool get_tagged() { return tagged; } 281 void set_tagged( bool newValue ) { tagged = newValue; } 282 bool has_parent() { return parent_name != ""; } 283 std::string get_parentName() { return parent_name; } 284 278 285 virtual StructDecl *clone() const { return new StructDecl( *this ); } 279 286 virtual void accept( Visitor &v ) { v.visit( this ); } … … 282 289 DeclarationNode::Aggregate kind; 283 290 virtual std::string typeString() const; 291 292 bool tagged; 293 std::string parent_name; 284 294 }; 285 295
Note:
See TracChangeset
for help on using the changeset viewer.