Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r60aaa51d r6355ba7  
    154154                auto&& attr = get<Attribute>().acceptL( node->attributes );
    155155                if ( inCache( node ) ) {
    156                         if(node->name == "tmp") {
    157                                 std::cerr << (void*)node << "(new) in cache " << (void*)this->node << "(old)" << std::endl;
    158                         }
    159156                        return nullptr;
    160157                }
     
    169166                        Type::FuncSpecifiers( node->funcSpec.val )
    170167                );
    171                 if(node->name == "tmp") {
    172                         std::cerr << (void*)node << "(new) created " << (void*)decl << "(old)" << std::endl;
    173                 }
    174168                return declWithTypePostamble( decl, node );
    175169        }
     
    736730                expr->var = get<DeclarationWithType>().accept1(node->var);
    737731                Type * type = expr->var->get_type()->clone();
     732                if(FunctionType * ft = dynamic_cast<FunctionType*>(type)) {
     733                        if(node->result.as<ast::PointerType>()) {
     734                                type = new PointerType({}, ft);
     735                        }
     736                }
     737
    738738                type->set_lvalue( true );
    739                 expr->set_result( type );
     739                expr->result = type ;
    740740                this->node = expr;
    741741                return nullptr;
     
    783783                        assert (!rslt->isType);
    784784                }
    785                 if (node->type) {
     785                else {
     786                        assert(node->type);
    786787                        rslt = new SizeofExpr(
    787788                                get<Type>().accept1(node->type)
     
    804805                        assert (!rslt->isType);
    805806                }
    806                 if (node->type) {
     807                else {
     808                        assert(node->type);
    807809                        rslt = new AlignofExpr(
    808810                                get<Type>().accept1(node->type)
     
    14141416#       define GET_ACCEPT_V(child, type) \
    14151417                getAcceptV< ast::type, decltype( old->child ) >( old->child )
    1416        
     1418
    14171419        template<typename NewT, typename OldC>
    14181420        std::deque< ast::ptr<NewT> > getAcceptD( OldC& old ) {
     
    14621464
    14631465        virtual void visit( ObjectDecl * old ) override final {
    1464                 if( old->name == "tmp" ) {
    1465                         std::cerr << "building parameters for" << (void*)old << std::endl;
    1466                 }
    14671466                auto&& type = GET_ACCEPT_1(type, Type);
    14681467                auto&& init = GET_ACCEPT_1(init, Init);
    14691468                auto&& bfwd = GET_ACCEPT_1(bitfieldWidth, Expr);
    14701469                auto&& attr = GET_ACCEPT_V(attributes, Attribute);
    1471                 if( old->name == "tmp" ) {
    1472                         std::cerr << "checking cache for " << (void*)old << std::endl;
    1473                 }
    14741470                if ( inCache( old ) ) {
    1475                         if( old->name == "tmp" ) {
    1476                                 std::cerr << (void*)old << "(old) in cache " << (void*)this->node << "(new)" << std::endl;
    1477                         }
    14781471                        return;
    14791472                }
     
    14901483                );
    14911484                cache.emplace(old, decl);
    1492                 if( old->name == "tmp" ) {
    1493                         std::cerr << (void*)old << "(old) added to cache with " << (void*)decl << "(new)" << std::endl;
    1494                 }
    14951485                assert(cache.find( old ) != cache.end());
    14961486                decl->scopeLevel = old->scopeLevel;
     
    15011491
    15021492                this->node = decl;
    1503 
    1504                 if( old->name == "tmp" ) {
    1505                         std::cerr << (void*)old << "(old) created " << (void*)this->node << "(new)" << std::endl;
    1506                 }
    15071493        }
    15081494
     
    21642150                );
    21652151
    2166                 visitBaseExpr( old,
     2152                visitBaseExpr_SkipResultType( old,
    21672153                        expr
    21682154                );
     
    21702156                expr->var = GET_ACCEPT_1(var, DeclWithType);
    21712157                expr->result = expr->var->get_type();
     2158                if(const ast::FunctionType * ft = expr->result.as<ast::FunctionType>()) {
     2159                        if(dynamic_cast<PointerType *>(old->result)) {
     2160                                expr->result = new ast::PointerType(ft);
     2161                        }
     2162                }
    21722163                add_qualifiers( expr->result, ast::CV::Lvalue );
    21732164                this->node = expr;
Note: See TracChangeset for help on using the changeset viewer.