Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r0bd46fd r1931bb01  
    277277                std::list< Declaration* > &memb = enumDecl->get_members();
    278278                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;
    281280                        for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end();  i++) {
    282281                                ObjectDecl * obj = dynamic_cast< ObjectDecl* >( *i );
    283282                                assert( obj );
    284                                 output << "static ";
    285                                 output << genType(enumDecl->base, "", options) << " const ";
     283                                output << "static const ";
     284                                output << genType(enumDecl->base, "", options) << " ";
    286285                                output << mangleName( obj ) << " ";
    287286                                output << " = ";
     
    494493                                        assert( false );
    495494                                } // 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 << ")";
    502495                        } else {
    503496                                varExpr->accept( *visitor );
     
    696689                        output << opInfo->symbol;
    697690                } 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                        // }
    698695                        output << mangleName( variableExpr->get_var() );
    699696                } // if
     
    914911        }
    915912
    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         }
    921913
    922914        // *** Statements
Note: See TracChangeset for help on using the changeset viewer.