Changeset c75b30a for src/CodeGen
- Timestamp:
- Jan 31, 2024, 6:25:02 PM (11 months ago)
- Branches:
- master
- Children:
- 32490deb
- Parents:
- 16afb2a
- Location:
- src/CodeGen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cpp
r16afb2a rc75b30a 331 331 extension( decl ); 332 332 auto members = decl->members; 333 if ( decl->base && !members.empty() ) {334 long long curVal = 0;335 for ( auto member : members ) {336 auto obj = member.strict_as<ast::ObjectDecl>();337 output << "static ";338 output << genType( decl->base, mangleName( obj ), options );339 genEnumInitializer( visitor, decl->base, output, obj->init, &curVal, options );340 output << ";" << endl;341 }342 } else {333 // if ( decl->base && !members.empty() ) { 334 // long long curVal = 0; 335 // for ( auto member : members ) { 336 // auto obj = member.strict_as<ast::ObjectDecl>(); 337 // output << "static "; 338 // output << genType( decl->base, mangleName( obj ), options ); 339 // genEnumInitializer( visitor, decl->base, output, obj->init, &curVal, options ); 340 // output << ";" << endl; 341 // } 342 // } else { 343 343 output << "enum "; 344 344 genAttributes( decl->attributes ); … … 353 353 auto obj = member.strict_as<ast::ObjectDecl>(); 354 354 output << indent << mangleName( obj ); 355 if ( obj->init ) {355 if ( !decl->base && obj->init ) { 356 356 output << " = "; 357 357 obj->init->accept( *visitor ); … … 363 363 output << indent << "}"; 364 364 } 365 }365 // } 366 366 } 367 367 -
src/CodeGen/GenType.cc
r16afb2a rc75b30a 228 228 229 229 void GenType::postvisit( ast::EnumInstType const * type ) { 230 if ( type->base && type->base->base ) {231 result = genType( type->base->base, result, options );232 } else {230 // if ( type->base && type->base->base ) { 231 // result = genType( type->base->base, result, options ); 232 // } else { 233 233 result = type->name + " " + result; 234 234 if ( options.genC ) { 235 235 result = "enum " + result; 236 236 } 237 }237 // } 238 238 handleQualifiers( type ); 239 239 }
Note: See TracChangeset
for help on using the changeset viewer.