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