Changes in src/CodeGen/CodeGenerator.cc [0bd46fd:1931bb01]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r0bd46fd r1931bb01 277 277 std::list< Declaration* > &memb = enumDecl->get_members(); 278 278 if (enumDecl->base && ! memb.empty()) { 279 unsigned long long last_val = -1; // if the first enum value has no explicit initializer, 280 // as other 279 unsigned long long last_val = -1; 281 280 for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end(); i++) { 282 281 ObjectDecl * obj = dynamic_cast< ObjectDecl* >( *i ); 283 282 assert( obj ); 284 output << "static ";285 output << genType(enumDecl->base, "", options) << " const";283 output << "static const "; 284 output << genType(enumDecl->base, "", options) << " "; 286 285 output << mangleName( obj ) << " "; 287 286 output << " = "; … … 494 493 assert( false ); 495 494 } // switch 496 } else if( varExpr->get_var()->get_linkage() == LinkageSpec::BuiltinCFA && varExpr->get_var()->get_name() == "intptr" ) {497 // THIS is a hack to make it a constant until a proper constexpr solution is created498 output << "((void*)";499 std::list< Expression* >::iterator arg = applicationExpr->get_args().begin();500 (*arg++)->accept( *visitor );501 output << ")";502 495 } else { 503 496 varExpr->accept( *visitor ); … … 696 689 output << opInfo->symbol; 697 690 } else { 691 // if (dynamic_cast<EnumInstType *>(variableExpr->get_var()->get_type()) 692 // && dynamic_cast<EnumInstType *>(variableExpr->get_var()->get_type())->baseEnum->base) { 693 // output << '(' <<genType(dynamic_cast<EnumInstType *>(variableExpr->get_var()->get_type())->baseEnum->base, "", options) << ')'; 694 // } 698 695 output << mangleName( variableExpr->get_var() ); 699 696 } // if … … 914 911 } 915 912 916 // QualifiedNameExpr should not reach to CodeGen.917 // FixQualifiedName Convert QualifiedNameExpr to VariableExpr918 void CodeGenerator::postvisit( QualifiedNameExpr * expr ) {919 output << "/* label */" << mangleName(expr->var);920 }921 913 922 914 // *** Statements
Note:
See TracChangeset
for help on using the changeset viewer.