Changes in src/Parser/DeclarationNode.cc [ca1a547:3a5131ed]
- File:
-
- 1 edited
-
src/Parser/DeclarationNode.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
rca1a547 r3a5131ed 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 23 15:45:02201713 // Update Count : 75 912 // Last Modified On : Thu Feb 16 13:06:50 2017 13 // Update Count : 753 14 14 // 15 15 … … 174 174 } // if 175 175 176 if ( body ) { 177 newnode->type->function.hasBody = true; 178 } // if 179 176 180 if ( ret ) { 177 181 newnode->type->base = ret->type; … … 255 259 } // DeclarationNode::newAggregate 256 260 257 DeclarationNode * DeclarationNode::newEnum( string * name, DeclarationNode * constants , bool body) {261 DeclarationNode * DeclarationNode::newEnum( string * name, DeclarationNode * constants ) { 258 262 DeclarationNode * newnode = new DeclarationNode; 259 263 newnode->type = new TypeData( TypeData::Enum ); … … 264 268 } // if 265 269 newnode->type->enumeration.constants = constants; 266 newnode->type->enumeration.body = body;267 270 return newnode; 268 271 } // DeclarationNode::newEnum … … 695 698 assert( ! type->function.body ); 696 699 type->function.body = body; 700 type->function.hasBody = true; 697 701 return this; 698 702 } … … 1036 1040 switch ( type->kind ) { 1037 1041 case TypeData::Enum: { 1038 if ( type->enumeration.body ) { 1039 EnumDecl * typedecl = buildEnum( type, attributes ); 1040 return new EnumInstType( buildQualifiers( type ), typedecl ); 1041 } else { 1042 return new EnumInstType( buildQualifiers( type ), *type->enumeration.name ); 1043 } 1042 EnumDecl * typedecl = buildEnum( type, attributes ); 1043 return new EnumInstType( buildQualifiers( type ), typedecl ); 1044 1044 } 1045 1045 case TypeData::Aggregate: { 1046 AggregateDecl * typedecl = buildAggregate( type, attributes ); 1046 1047 ReferenceToType * ret; 1047 if ( type->aggregate.body ) { 1048 AggregateDecl * typedecl = buildAggregate( type, attributes ); 1049 switch ( type->aggregate.kind ) { 1050 case DeclarationNode::Struct: 1051 ret = new StructInstType( buildQualifiers( type ), (StructDecl *)typedecl ); 1052 break; 1053 case DeclarationNode::Union: 1054 ret = new UnionInstType( buildQualifiers( type ), (UnionDecl *)typedecl ); 1055 break; 1056 case DeclarationNode::Trait: 1057 assert( false ); 1058 //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl ); 1059 break; 1060 default: 1061 assert( false ); 1062 } // switch 1063 } else { 1064 switch ( type->aggregate.kind ) { 1065 case DeclarationNode::Struct: 1066 ret = new StructInstType( buildQualifiers( type ), *type->aggregate.name ); 1067 break; 1068 case DeclarationNode::Union: 1069 ret = new UnionInstType( buildQualifiers( type ), *type->aggregate.name ); 1070 break; 1071 case DeclarationNode::Trait: 1072 assert( false ); 1073 //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl ); 1074 break; 1075 default: 1076 assert( false ); 1077 } // switch 1078 } // if 1048 switch ( type->aggregate.kind ) { 1049 case DeclarationNode::Struct: 1050 ret = new StructInstType( buildQualifiers( type ), (StructDecl *)typedecl ); 1051 break; 1052 case DeclarationNode::Union: 1053 ret = new UnionInstType( buildQualifiers( type ), (UnionDecl *)typedecl ); 1054 break; 1055 case DeclarationNode::Trait: 1056 assert( false ); 1057 //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl ); 1058 break; 1059 default: 1060 assert( false ); 1061 } // switch 1079 1062 buildList( type->aggregate.actuals, ret->get_parameters() ); 1080 1063 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.