Changeset 8a0a64d9 for src/Parser
- Timestamp:
- Nov 28, 2017, 11:49:12 AM (8 years ago)
- 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:
- 36982fc, 6c2ba38, d5a52cc
- Parents:
- 8a78dd3 (diff), 8eb348a (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. - Location:
- src/Parser
- Files:
-
- 3 edited
-
ParseNode.h (modified) (2 diffs)
-
TypeData.cc (modified) (3 diffs)
-
parser.yy (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.h
r8a78dd3 r8a0a64d9 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Sep 23 18:11:22201713 // Update Count : 82 112 // Last Modified On : Mon Nov 27 17:33:35 2017 13 // Update Count : 824 14 14 // 15 15 … … 292 292 DeclarationNode * set_extension( bool exten ) { extension = exten; return this; } 293 293 public: 294 DeclarationNode * get_last() { return (DeclarationNode *)ParseNode::get_last(); } 295 294 296 struct Variable_t { 295 297 // const std::string * name; -
src/Parser/TypeData.cc
r8a78dd3 r8a0a64d9 792 792 793 793 794 NamedTypeDecl * buildSymbolic( const TypeData * td, const string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage ) {794 NamedTypeDecl * buildSymbolic( const TypeData * td, std::list< Attribute * > attributes, const string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage ) { 795 795 assert( td->kind == TypeData::Symbolic ); 796 796 NamedTypeDecl * ret; … … 803 803 buildList( td->symbolic.params, ret->get_parameters() ); 804 804 buildList( td->symbolic.assertions, ret->get_assertions() ); 805 ret->base->attributes.splice( ret->base->attributes.end(), attributes ); 805 806 return ret; 806 807 } // buildSymbolic … … 866 867 return buildEnum( td, attributes, linkage ); 867 868 } else if ( td->kind == TypeData::Symbolic ) { 868 return buildSymbolic( td, name, scs, linkage );869 return buildSymbolic( td, attributes, name, scs, linkage ); 869 870 } else { 870 871 return (new ObjectDecl( name, scs, linkage, bitfieldWidth, typebuild( td ), init, attributes ))->set_asmName( asmName ); -
src/Parser/parser.yy
r8a78dd3 r8a0a64d9 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Nov 26 11:36:36201713 // Update Count : 29 6912 // Last Modified On : Mon Nov 27 17:23:35 2017 13 // Update Count : 2992 14 14 // 15 15 … … 1364 1364 $$ = $3->addQualifiers( $1 )->addQualifiers( $2 ); 1365 1365 } 1366 | cfa_function_declaration pop ',' push identifier_or_type_name 1367 { 1368 typedefTable.addToEnclosingScope( *$5, TypedefTable::ID ); 1369 $$ = $1->appendList( $1->cloneType( $5 ) ); 1366 | cfa_function_declaration pop ',' push identifier_or_type_name '(' push cfa_parameter_type_list_opt pop ')' 1367 { 1368 // Append the return type at the start (left-hand-side) to each identifier in the list. 1369 DeclarationNode * ret = new DeclarationNode; 1370 ret->type = maybeClone( $1->type->base ); 1371 $$ = $1->appendList( DeclarationNode::newFunction( $5, ret, $8, nullptr, true ) ); 1370 1372 } 1371 1373 ; … … 2416 2418 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2417 2419 typedefTable.leaveScope(); 2418 $$ = $1->addFunctionBody( $3 ); 2420 // Add the function body to the last identifier in the function definition list, i.e., foo3: 2421 // [const double] foo1(), foo2( int ), foo3( double ) { return 3.0; } 2422 $1->get_last()->addFunctionBody( $3 ); 2423 $$ = $1; 2419 2424 } 2420 2425 | declaration_specifier function_declarator with_clause_opt compound_statement
Note:
See TracChangeset
for help on using the changeset viewer.