Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r746ae82 r28c89f4  
    571571
    572572        const ast::Expr * visit( const ast::AddressExpr * node ) override final {
    573                 (void)node;
     573                auto expr = visitBaseExpr( node,
     574                        new AddressExpr(
     575                                get<Expression>().accept1(node->arg)
     576                        )
     577                );
     578                this->node = expr;
    574579                return nullptr;
    575580        }
    576581
    577582        const ast::Expr * visit( const ast::LabelAddressExpr * node ) override final {
    578                 (void)node;
     583                auto expr = visitBaseExpr( node,
     584                        new LabelAddressExpr(
     585                                makeLabel(nullptr, node->arg)
     586                        )
     587                );
     588                this->node = expr;
    579589                return nullptr;
    580590        }
    581591
    582592        const ast::Expr * visit( const ast::CastExpr * node ) override final {
    583                 (void)node;
     593                auto expr = visitBaseExpr( node,
     594                        new CastExpr(
     595                                get<Expression>().accept1(node->arg),
     596                                (node->isGenerated == ast::GeneratedCast)
     597                        )
     598                );
     599                this->node = expr;
    584600                return nullptr;
    585601        }
    586602
    587603        const ast::Expr * visit( const ast::KeywordCastExpr * node ) override final {
    588                 (void)node;
     604                KeywordCastExpr::Target castTarget = KeywordCastExpr::NUMBER_OF_TARGETS;
     605                switch (node->target) {
     606                        case ast::KeywordCastExpr::Coroutine:
     607                                castTarget = KeywordCastExpr::Coroutine;
     608                                break;
     609                        case ast::KeywordCastExpr::Thread:
     610                                castTarget = KeywordCastExpr::Thread;
     611                                break;
     612                        case ast::KeywordCastExpr::Monitor:
     613                                castTarget = KeywordCastExpr::Monitor;
     614                                break;
     615                        default:
     616                                break;
     617                }
     618                assert ( castTarget < KeywordCastExpr::NUMBER_OF_TARGETS );
     619                auto expr = visitBaseExpr( node,
     620                        new KeywordCastExpr(
     621                                get<Expression>().accept1(node->arg),
     622                                castTarget
     623                        )
     624                );
     625                this->node = expr;
    589626                return nullptr;
    590627        }
    591628
    592629        const ast::Expr * visit( const ast::VirtualCastExpr * node ) override final {
    593                 (void)node;
     630                auto expr = visitBaseExpr( node,
     631                        new VirtualCastExpr(
     632                                get<Expression>().accept1(node->arg),
     633                                nullptr // cast's "to" type is expr's result type; converted in visitBaseExpr
     634                        )
     635                );
     636                this->node = expr;
    594637                return nullptr;
    595638        }
    596639
    597640        const ast::Expr * visit( const ast::UntypedMemberExpr * node ) override final {
    598                 (void)node;
     641                auto expr = visitBaseExpr( node,
     642                        new UntypedMemberExpr(
     643                                get<Expression>().accept1(node->member),
     644                                get<Expression>().accept1(node->aggregate)
     645                        )
     646                );
     647                this->node = expr;
    599648                return nullptr;
    600649        }
    601650
    602651        const ast::Expr * visit( const ast::MemberExpr * node ) override final {
    603                 (void)node;
     652                auto expr = visitBaseExpr( node,
     653                        new MemberExpr(
     654                                inCache(node->member) ?
     655                                        dynamic_cast<DeclarationWithType *>(this->node) :
     656                                        get<DeclarationWithType>().accept1(node->member),
     657                                get<Expression>().accept1(node->aggregate)
     658                        )
     659                );
     660                this->node = expr;
    604661                return nullptr;
    605662        }
    606663
    607664        const ast::Expr * visit( const ast::VariableExpr * node ) override final {
    608                 (void)node;
    609                 return nullptr;
     665                auto expr = visitBaseExpr( node,
     666                        new VariableExpr(
     667                                inCache(node->var) ?
     668                                        dynamic_cast<DeclarationWithType *>(this->node) :
     669                                        get<DeclarationWithType>().accept1(node->var)
     670                        )
     671                );
     672                this->node = expr;
     673                return nullptr;
     674        }
     675
     676        bool isIntlikeConstantType(const ast::Type *t) {
     677                if ( const ast::BasicType * basicType = dynamic_cast< const ast::BasicType * >( t ) ) {
     678                        if ( basicType->isInteger() ) {
     679                                return true;
     680                        }
     681                } else if ( dynamic_cast< const ast::OneType * >( t ) ) {
     682                        return true;
     683                } else if ( dynamic_cast< const ast::ZeroType * >( t ) ) {
     684                        return true;
     685                } else if ( dynamic_cast< const ast::PointerType * >( t ) ) {
     686                        // null pointer constants, with zero int-values
     687                        return true;
     688                }
     689                return false;
     690        }
     691
     692        bool isFloatlikeConstantType(const ast::Type *t) {
     693                if ( const ast::BasicType * bty = dynamic_cast< const ast::BasicType * >( t ) ) {
     694                        if ( ! bty->isInteger() ) {
     695                                return true;
     696                        }
     697                }
     698                return false;
     699        }
     700
     701        bool isStringlikeConstantType(const ast::Type *t) {
     702                if ( const ast::ArrayType * aty = dynamic_cast< const ast::ArrayType * >( t ) ) {
     703                        if ( const ast::BasicType * bty = aty->base.as<ast::BasicType>() ) {
     704                           if ( bty->kind == ast::BasicType::Kind::Char ) {
     705                                   return true;
     706                           }
     707                        }
     708                }
     709                return false;
    610710        }
    611711
    612712        const ast::Expr * visit( const ast::ConstantExpr * node ) override final {
    613                 (void)node;
     713                ConstantExpr *rslt = nullptr;
     714                if (isIntlikeConstantType(node->result)) {
     715                        rslt = new ConstantExpr(Constant(
     716                                get<Type>().accept1(node->result),
     717                                node->rep,
     718                                (unsigned long long) node->intValue()
     719                        ));
     720                } else if (isFloatlikeConstantType(node->result)) {
     721                        rslt = new ConstantExpr(Constant(
     722                                get<Type>().accept1(node->result),
     723                                node->rep,
     724                                (double) node->floatValue()
     725                        ));
     726                } else if (isStringlikeConstantType(node->result)) {
     727                        rslt = new ConstantExpr(Constant::from_string(
     728                                node->rep
     729                        ));
     730                }
     731                assert(rslt);
     732                auto expr = visitBaseExpr( node, rslt );
     733                this->node = expr;
    614734                return nullptr;
    615735        }
    616736
    617737        const ast::Expr * visit( const ast::SizeofExpr * node ) override final {
    618                 (void)node;
     738                assert (node->expr || node->type);
     739                assert (! (node->expr && node->type));
     740                SizeofExpr *rslt;
     741                if (node->expr) {
     742                        rslt = new SizeofExpr(
     743                                get<Expression>().accept1(node->expr)
     744                        );
     745                        assert (!rslt->isType);
     746                }
     747                if (node->type) {
     748                        rslt = new SizeofExpr(
     749                                get<Type>().accept1(node->type)
     750                        );
     751                        assert (rslt->isType);
     752                }
     753                auto expr = visitBaseExpr( node, rslt );
     754                this->node = expr;
    619755                return nullptr;
    620756        }
    621757
    622758        const ast::Expr * visit( const ast::AlignofExpr * node ) override final {
    623                 (void)node;
     759                assert (node->expr || node->type);
     760                assert (! (node->expr && node->type));
     761                AlignofExpr *rslt;
     762                if (node->expr) {
     763                        rslt = new AlignofExpr(
     764                                get<Expression>().accept1(node->expr)
     765                        );
     766                        assert (!rslt->isType);
     767                }
     768                if (node->type) {
     769                        rslt = new AlignofExpr(
     770                                get<Type>().accept1(node->type)
     771                        );
     772                        assert (rslt->isType);
     773                }
     774                auto expr = visitBaseExpr( node, rslt );
     775                this->node = expr;
    624776                return nullptr;
    625777        }
    626778
    627779        const ast::Expr * visit( const ast::UntypedOffsetofExpr * node ) override final {
    628                 (void)node;
     780                auto expr = visitBaseExpr( node,
     781                        new UntypedOffsetofExpr(
     782                                get<Type>().accept1(node->type),
     783                                node->member
     784                        )
     785                );
     786                this->node = expr;
    629787                return nullptr;
    630788        }
    631789
    632790        const ast::Expr * visit( const ast::OffsetofExpr * node ) override final {
    633                 (void)node;
     791                auto expr = visitBaseExpr( node,
     792                        new OffsetofExpr(
     793                                get<Type>().accept1(node->type),
     794                                inCache(node->member) ?
     795                                        dynamic_cast<DeclarationWithType *>(this->node) :
     796                                        get<DeclarationWithType>().accept1(node->member)
     797                        )
     798                );
     799                this->node = expr;
    634800                return nullptr;
    635801        }
    636802
    637803        const ast::Expr * visit( const ast::OffsetPackExpr * node ) override final {
    638                 (void)node;
     804                auto expr = visitBaseExpr( node,
     805                        new OffsetPackExpr(
     806                                get<StructInstType>().accept1(node->type)
     807                        )
     808                );
     809                this->node = expr;
    639810                return nullptr;
    640811        }
    641812
    642813        const ast::Expr * visit( const ast::LogicalExpr * node ) override final {
    643                 (void)node;
     814                assert (node->isAnd == ast::LogicalFlag::AndExpr ||
     815                                node->isAnd == ast::LogicalFlag::OrExpr );
     816                auto expr = visitBaseExpr( node,
     817                        new LogicalExpr(
     818                                get<Expression>().accept1(node->arg1),
     819                                get<Expression>().accept1(node->arg2),
     820                                (node->isAnd == ast::LogicalFlag::AndExpr)
     821                        )
     822                );
     823                this->node = expr;
    644824                return nullptr;
    645825        }
    646826
    647827        const ast::Expr * visit( const ast::ConditionalExpr * node ) override final {
    648                 (void)node;
     828                auto expr = visitBaseExpr( node,
     829                        new ConditionalExpr(
     830                                get<Expression>().accept1(node->arg1),
     831                                get<Expression>().accept1(node->arg2),
     832                                get<Expression>().accept1(node->arg3)
     833                        )
     834                );
     835                this->node = expr;
    649836                return nullptr;
    650837        }
    651838
    652839        const ast::Expr * visit( const ast::CommaExpr * node ) override final {
    653                 (void)node;
     840                auto expr = visitBaseExpr( node,
     841                        new CommaExpr(
     842                                get<Expression>().accept1(node->arg1),
     843                                get<Expression>().accept1(node->arg2)
     844                        )
     845                );
     846                this->node = expr;
    654847                return nullptr;
    655848        }
     
    755948                        get<Type>().accept1( node->base ),
    756949                        get<Expression>().accept1( node->dimension ),
    757                         (bool)node->isVarLen,
    758                         (bool)node->isStatic
     950                        node->isVarLen,
     951                        node->isStatic
    759952                };
    760953                return nullptr;
     
    766959                        get<Type>().accept1( node->base ),
    767960                        get<Expression>().accept1( node->dimension ),
    768                         (bool)node->isVarLen,
    769                         (bool)node->isStatic
     961                        node->isVarLen,
     962                        node->isStatic
    770963                };
    771964                return nullptr;
     
    790983
    791984        const ast::Type * visit( const ast::FunctionType * node ) override final {
    792                 auto ty = new FunctionType {
    793                         cv( node ),
    794                         (bool)node->isVarArgs
    795                 };
     985                auto ty = new FunctionType { cv( node ), node->isVarArgs };
    796986                ty->returnVals = get<DeclarationWithType>().acceptL( node->returns );
    797987                ty->parameters = get<DeclarationWithType>().acceptL( node->params );
     
    9101100
    9111101        const ast::Type * visit( const ast::TupleType * node ) override final {
    912                 this->node = new TupleType{
    913                         cv( node ),
    914                         get<Type>().acceptL( node->types )
    915                         // members generated by TupleType c'tor
    916                 };
     1102                (void)node;
    9171103                return nullptr;
    9181104        }
    9191105
    9201106        const ast::Type * visit( const ast::TypeofType * node ) override final {
    921                 this->node = new TypeofType{
    922                         cv( node ),
    923                         get<Expression>().accept1( node->expr ),
    924                         (bool)node->kind
    925                 };
     1107                (void)node;
    9261108                return nullptr;
    9271109        }
    9281110
    9291111        const ast::Type * visit( const ast::VarArgsType * node ) override final {
    930                 this->node = new VarArgsType{ cv( node ) };
     1112                (void)node;
    9311113                return nullptr;
    9321114        }
    9331115
    9341116        const ast::Type * visit( const ast::ZeroType * node ) override final {
    935                 this->node = new ZeroType{ cv( node ) };
     1117                (void)node;
    9361118                return nullptr;
    9371119        }
    9381120
    9391121        const ast::Type * visit( const ast::OneType * node ) override final {
    940                 this->node = new OneType{ cv( node ) };
    941                 return nullptr;
    942         }
    943 
    944         const ast::Type * visit( const ast::GlobalScopeType * ) override final {
    945                 this->node = new GlobalScopeType{};
     1122                (void)node;
     1123                return nullptr;
     1124        }
     1125
     1126        const ast::Type * visit( const ast::GlobalScopeType * node ) override final {
     1127                (void)node;
    9461128                return nullptr;
    9471129        }
     
    15471729                        new ast::CastExpr(
    15481730                                old->location,
    1549                                 nullptr, // cast's "to" type is expr's result type; converted in visitBaseExpr
     1731                                GET_ACCEPT_1(arg, Expr),
    15501732                                old->isGenerated ? ast::GeneratedCast : ast::ExplicitCast
    15511733                        )
     
    15531735        }
    15541736
    1555         virtual void visit( KeywordCastExpr * ) override final {
    1556 
    1557         }
    1558 
    1559         virtual void visit( VirtualCastExpr * ) override final {
    1560 
    1561         }
    1562 
    1563         virtual void visit( AddressExpr * ) override final {
    1564 
    1565         }
    1566 
    1567         virtual void visit( LabelAddressExpr * ) override final {
    1568 
    1569         }
    1570 
    1571         virtual void visit( UntypedMemberExpr * ) override final {
    1572 
    1573         }
    1574 
    1575         virtual void visit( MemberExpr * ) override final {
    1576 
    1577         }
    1578 
    1579         virtual void visit( VariableExpr * ) override final {
    1580 
    1581         }
    1582 
    1583         virtual void visit( ConstantExpr * ) override final {
    1584 
    1585         }
    1586 
    1587         virtual void visit( SizeofExpr * ) override final {
    1588 
    1589         }
    1590 
    1591         virtual void visit( AlignofExpr * ) override final {
    1592 
    1593         }
    1594 
    1595         virtual void visit( UntypedOffsetofExpr * ) override final {
    1596 
    1597         }
    1598 
    1599         virtual void visit( OffsetofExpr * ) override final {
    1600 
    1601         }
    1602 
    1603         virtual void visit( OffsetPackExpr * ) override final {
    1604 
    1605         }
    1606 
    1607         virtual void visit( LogicalExpr * ) override final {
    1608 
    1609         }
    1610 
    1611         virtual void visit( ConditionalExpr * ) override final {
    1612 
    1613         }
    1614 
    1615         virtual void visit( CommaExpr * ) override final {
    1616 
     1737        virtual void visit( KeywordCastExpr * old) override final {
     1738                ast::KeywordCastExpr::Target castTarget = ast::KeywordCastExpr::NUMBER_OF_TARGETS;
     1739                switch (old->target) {
     1740                        case KeywordCastExpr::Coroutine:
     1741                                castTarget = ast::KeywordCastExpr::Coroutine;
     1742                                break;
     1743                        case KeywordCastExpr::Thread:
     1744                                castTarget = ast::KeywordCastExpr::Thread;
     1745                                break;
     1746                        case KeywordCastExpr::Monitor:
     1747                                castTarget = ast::KeywordCastExpr::Monitor;
     1748                                break;
     1749                        default:
     1750                                break;
     1751                }
     1752                assert ( castTarget < ast::KeywordCastExpr::NUMBER_OF_TARGETS );
     1753                this->node = visitBaseExpr( old,
     1754                        new ast::KeywordCastExpr(
     1755                                old->location,
     1756                                GET_ACCEPT_1(arg, Expr),
     1757                                castTarget
     1758                        )
     1759                );
     1760        }
     1761
     1762        virtual void visit( VirtualCastExpr * old ) override final {
     1763                this->node = visitBaseExpr( old,
     1764                        new ast::VirtualCastExpr(
     1765                                old->location,
     1766                                GET_ACCEPT_1(arg, Expr),
     1767                                nullptr // cast's "to" type is expr's result type; converted in visitBaseExpr
     1768                        )
     1769                );
     1770        }
     1771
     1772        virtual void visit( AddressExpr * old ) override final {
     1773                this->node = visitBaseExpr( old,
     1774                        new ast::AddressExpr(
     1775                                old->location,
     1776                                GET_ACCEPT_1(arg, Expr)
     1777                        )
     1778                );
     1779        }
     1780
     1781        virtual void visit( LabelAddressExpr * old ) override final {
     1782                this->node = visitBaseExpr( old,
     1783                        new ast::LabelAddressExpr(
     1784                                old->location,
     1785                                make_label(&old->arg)
     1786                        )
     1787                );
     1788        }
     1789
     1790        virtual void visit( UntypedMemberExpr * old ) override final {
     1791                this->node = visitBaseExpr( old,
     1792                        new ast::UntypedMemberExpr(
     1793                                old->location,
     1794                                GET_ACCEPT_1(member, Expr),
     1795                                GET_ACCEPT_1(aggregate, Expr)
     1796                        )
     1797                );
     1798        }
     1799
     1800        virtual void visit( MemberExpr * old ) override final {
     1801                this->node = visitBaseExpr( old,
     1802                        new ast::MemberExpr(
     1803                                old->location,
     1804                                inCache(old->member) ?
     1805                                        dynamic_cast<ast::DeclWithType *>(this->node) :
     1806                                        GET_ACCEPT_1(member, DeclWithType),
     1807                                GET_ACCEPT_1(aggregate, Expr)
     1808                        )
     1809                );
     1810        }
     1811
     1812        virtual void visit( VariableExpr * old ) override final {
     1813                this->node = visitBaseExpr( old,
     1814                        new ast::VariableExpr(
     1815                                old->location,
     1816                                inCache(old->var) ?
     1817                                        dynamic_cast<ast::DeclWithType *>(this->node) :
     1818                                        GET_ACCEPT_1(var, DeclWithType)
     1819                        )
     1820                );
     1821        }
     1822
     1823        bool isIntlikeConstantType(const Type *t) {
     1824                if ( const BasicType * basicType = dynamic_cast< const BasicType * >( t ) ) {
     1825                        if ( basicType->isInteger() ) {
     1826                                return true;
     1827                        }
     1828                } else if ( dynamic_cast< const OneType * >( t ) ) {
     1829                        return true;
     1830                } else if ( dynamic_cast< const ZeroType * >( t ) ) {
     1831                        return true;
     1832                } else if ( dynamic_cast< const PointerType * >( t ) ) {
     1833                        // null pointer constants, with zero int-values
     1834                        return true;
     1835                }
     1836                return false;
     1837        }
     1838
     1839        int isFloatlikeConstantType(const Type *t) {
     1840                if ( const BasicType * bty = dynamic_cast< const BasicType * >( t ) ) {
     1841                        if ( ! bty->isInteger() ) {
     1842                                return true;
     1843                        }
     1844                }
     1845                return false;
     1846        }
     1847
     1848        int isStringlikeConstantType(const Type *t) {
     1849                if ( const ArrayType * aty = dynamic_cast< const ArrayType * >( t ) ) {
     1850                        if ( const BasicType * bty = dynamic_cast< const BasicType * >( aty->base ) ) {
     1851                           if ( bty->kind == BasicType::Kind::Char ) {
     1852                                   return true;
     1853                           }
     1854                        }
     1855                }
     1856                return false;
     1857        }
     1858
     1859        virtual void visit( ConstantExpr * old ) override final {
     1860                ast::ConstantExpr *rslt = nullptr;
     1861                if (isIntlikeConstantType(old->result)) {
     1862                        rslt = new ast::ConstantExpr(
     1863                                old->location,
     1864                                GET_ACCEPT_1(result, Type),
     1865                                old->constant.get_value(),
     1866                                (unsigned long long) old->intValue()
     1867                        );
     1868                } else if (isFloatlikeConstantType(old->result)) {
     1869                        rslt = new ast::ConstantExpr(
     1870                                old->location,
     1871                                GET_ACCEPT_1(result, Type),
     1872                                old->constant.get_value(),
     1873                                (double) old->constant.get_dval()
     1874                        );
     1875                } else if (isStringlikeConstantType(old->result)) {
     1876                        rslt = ast::ConstantExpr::from_string(
     1877                                old->location,
     1878                                old->constant.get_value()
     1879                        );
     1880                }
     1881                assert(rslt);
     1882                this->node = visitBaseExpr( old, rslt );
     1883        }
     1884
     1885        virtual void visit( SizeofExpr * old ) override final {
     1886                assert (old->expr || old->type);
     1887                assert (! (old->expr && old->type));
     1888                ast::SizeofExpr *rslt;
     1889                if (old->expr) {
     1890                        assert(!old->isType);
     1891                        rslt = new ast::SizeofExpr(
     1892                                old->location,
     1893                                GET_ACCEPT_1(expr, Expr)
     1894                        );
     1895                }
     1896                if (old->type) {
     1897                        assert(old->isType);
     1898                        rslt = new ast::SizeofExpr(
     1899                                old->location,
     1900                                GET_ACCEPT_1(type, Type)
     1901                        );
     1902                }
     1903                this->node = visitBaseExpr( old, rslt );
     1904        }
     1905
     1906        virtual void visit( AlignofExpr * old ) override final {
     1907                assert (old->expr || old->type);
     1908                assert (! (old->expr && old->type));
     1909                ast::AlignofExpr *rslt;
     1910                if (old->expr) {
     1911                        assert(!old->isType);
     1912                        rslt = new ast::AlignofExpr(
     1913                                old->location,
     1914                                GET_ACCEPT_1(expr, Expr)
     1915                        );
     1916                }
     1917                if (old->type) {
     1918                        assert(old->isType);
     1919                        rslt = new ast::AlignofExpr(
     1920                                old->location,
     1921                                GET_ACCEPT_1(type, Type)
     1922                        );
     1923                }
     1924                this->node = visitBaseExpr( old, rslt );
     1925        }
     1926
     1927        virtual void visit( UntypedOffsetofExpr * old ) override final {
     1928                this->node = visitBaseExpr( old,
     1929                        new ast::UntypedOffsetofExpr(
     1930                                old->location,
     1931                                GET_ACCEPT_1(type, Type),
     1932                                old->member
     1933                        )
     1934                );
     1935        }
     1936
     1937        virtual void visit( OffsetofExpr * old ) override final {
     1938                this->node = visitBaseExpr( old,
     1939                        new ast::OffsetofExpr(
     1940                                old->location,
     1941                                GET_ACCEPT_1(type, Type),
     1942                                inCache(old->member) ?
     1943                                        dynamic_cast<ast::DeclWithType *>(this->node) :
     1944                                        GET_ACCEPT_1(member, DeclWithType)
     1945                        )
     1946                );
     1947        }
     1948
     1949        virtual void visit( OffsetPackExpr * old ) override final {
     1950                this->node = visitBaseExpr( old,
     1951                        new ast::OffsetPackExpr(
     1952                                old->location,
     1953                                GET_ACCEPT_1(type, StructInstType)
     1954                        )
     1955                );
     1956        }
     1957
     1958        virtual void visit( LogicalExpr * old ) override final {
     1959                this->node = visitBaseExpr( old,
     1960                        new ast::LogicalExpr(
     1961                                old->location,
     1962                                GET_ACCEPT_1(arg1, Expr),
     1963                                GET_ACCEPT_1(arg2, Expr),
     1964                                old->get_isAnd() ?
     1965                                        ast::LogicalFlag::AndExpr :
     1966                                        ast::LogicalFlag::OrExpr
     1967                        )
     1968                );
     1969        }
     1970
     1971        virtual void visit( ConditionalExpr * old ) override final {
     1972                this->node = visitBaseExpr( old,
     1973                        new ast::ConditionalExpr(
     1974                                old->location,
     1975                                GET_ACCEPT_1(arg1, Expr),
     1976                                GET_ACCEPT_1(arg2, Expr),
     1977                                GET_ACCEPT_1(arg3, Expr)
     1978                        )
     1979                );
     1980        }
     1981
     1982        virtual void visit( CommaExpr * old ) override final {
     1983                this->node = visitBaseExpr( old,
     1984                        new ast::CommaExpr(
     1985                                old->location,
     1986                                GET_ACCEPT_1(arg1, Expr),
     1987                                GET_ACCEPT_1(arg2, Expr)
     1988                        )
     1989                );
    16171990        }
    16181991
     
    18422215        }
    18432216
    1844         virtual void visit( TupleType * old ) override final {
    1845                 this->node = new ast::TupleType{
    1846                         GET_ACCEPT_V( types, Type ),
    1847                         // members generated by TupleType c'tor
    1848                         cv( old )
    1849                 };
    1850         }
    1851 
    1852         virtual void visit( TypeofType * old ) override final {
    1853                 this->node = new ast::TypeofType{
    1854                         GET_ACCEPT_1( expr, Expr ),
    1855                         (ast::TypeofType::Kind)old->is_basetypeof,
    1856                         cv( old )
    1857                 };
     2217        virtual void visit( TupleType * ) override final {
     2218
     2219        }
     2220
     2221        virtual void visit( TypeofType * ) override final {
     2222
    18582223        }
    18592224
    18602225        virtual void visit( AttrType * ) override final {
    1861                 assertf( false, "AttrType deprecated in new AST." );
    1862         }
    1863 
    1864         virtual void visit( VarArgsType * old ) override final {
    1865                 this->node = new ast::VarArgsType{ cv( old ) };
    1866         }
    1867 
    1868         virtual void visit( ZeroType * old ) override final {
    1869                 this->node = new ast::ZeroType{ cv( old ) };
    1870         }
    1871 
    1872         virtual void visit( OneType * old ) override final {
    1873                 this->node = new ast::OneType{ cv( old ) };
     2226
     2227        }
     2228
     2229        virtual void visit( VarArgsType * ) override final {
     2230
     2231        }
     2232
     2233        virtual void visit( ZeroType * ) override final {
     2234
     2235        }
     2236
     2237        virtual void visit( OneType * ) override final {
     2238
    18742239        }
    18752240
    18762241        virtual void visit( GlobalScopeType * ) override final {
    1877                 this->node = new ast::GlobalScopeType{};
     2242
    18782243        }
    18792244
Note: See TracChangeset for help on using the changeset viewer.