Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r6355ba7 r60aaa51d  
    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                        }
    156159                        return nullptr;
    157160                }
     
    166169                        Type::FuncSpecifiers( node->funcSpec.val )
    167170                );
     171                if(node->name == "tmp") {
     172                        std::cerr << (void*)node << "(new) created " << (void*)decl << "(old)" << std::endl;
     173                }
    168174                return declWithTypePostamble( decl, node );
    169175        }
     
    730736                expr->var = get<DeclarationWithType>().accept1(node->var);
    731737                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->result = type ;
     739                expr->set_result( type );
    740740                this->node = expr;
    741741                return nullptr;
     
    783783                        assert (!rslt->isType);
    784784                }
    785                 else {
    786                         assert(node->type);
     785                if (node->type) {
    787786                        rslt = new SizeofExpr(
    788787                                get<Type>().accept1(node->type)
     
    805804                        assert (!rslt->isType);
    806805                }
    807                 else {
    808                         assert(node->type);
     806                if (node->type) {
    809807                        rslt = new AlignofExpr(
    810808                                get<Type>().accept1(node->type)
     
    14161414#       define GET_ACCEPT_V(child, type) \
    14171415                getAcceptV< ast::type, decltype( old->child ) >( old->child )
    1418 
     1416       
    14191417        template<typename NewT, typename OldC>
    14201418        std::deque< ast::ptr<NewT> > getAcceptD( OldC& old ) {
     
    14641462
    14651463        virtual void visit( ObjectDecl * old ) override final {
     1464                if( old->name == "tmp" ) {
     1465                        std::cerr << "building parameters for" << (void*)old << std::endl;
     1466                }
    14661467                auto&& type = GET_ACCEPT_1(type, Type);
    14671468                auto&& init = GET_ACCEPT_1(init, Init);
    14681469                auto&& bfwd = GET_ACCEPT_1(bitfieldWidth, Expr);
    14691470                auto&& attr = GET_ACCEPT_V(attributes, Attribute);
     1471                if( old->name == "tmp" ) {
     1472                        std::cerr << "checking cache for " << (void*)old << std::endl;
     1473                }
    14701474                if ( inCache( old ) ) {
     1475                        if( old->name == "tmp" ) {
     1476                                std::cerr << (void*)old << "(old) in cache " << (void*)this->node << "(new)" << std::endl;
     1477                        }
    14711478                        return;
    14721479                }
     
    14831490                );
    14841491                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                }
    14851495                assert(cache.find( old ) != cache.end());
    14861496                decl->scopeLevel = old->scopeLevel;
     
    14911501
    14921502                this->node = decl;
     1503
     1504                if( old->name == "tmp" ) {
     1505                        std::cerr << (void*)old << "(old) created " << (void*)this->node << "(new)" << std::endl;
     1506                }
    14931507        }
    14941508
     
    21502164                );
    21512165
    2152                 visitBaseExpr_SkipResultType( old,
     2166                visitBaseExpr( old,
    21532167                        expr
    21542168                );
     
    21562170                expr->var = GET_ACCEPT_1(var, DeclWithType);
    21572171                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                 }
    21632172                add_qualifiers( expr->result, ast::CV::Lvalue );
    21642173                this->node = expr;
Note: See TracChangeset for help on using the changeset viewer.