Changes in / [5b35c21:a1b154d]


Ignore:
Location:
src
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r5b35c21 ra1b154d  
    1010// Created On       : Thu May 09 15::37::05 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri May 17 16:01:00 2019
    13 // Update Count     : 4
     12// Last Modified On : Tue May 21 15:30:00 2019
     13// Update Count     : 5
    1414//
    1515
    1616#include "Convert.hpp"
     17
     18#include <unordered_map>
    1719
    1820#include "AST/Attribute.hpp"
     
    4244class ConverterNewToOld : public ast::Visitor {
    4345        BaseSyntaxNode * node = nullptr;
     46        std::unordered_map< ast::Node *, BaseSyntaxNode * > cache;
    4447
    4548        template<typename T>
     
    4750                ConverterNewToOld & visitor;
    4851
    49                 template<typename U>
    50                 T * accept1( const ast::ptr<U> & ptr ) {
     52                template<typename U, enum ast::Node::ref_type R>
     53                T * accept1( const ast::ptr_base<U, R> & ptr ) {
     54                        if ( ! ptr ) return nullptr;
    5155                        ptr->accept( visitor );
    5256                        T * ret = strict_dynamic_cast< T * >( visitor.node );
     
    8791        }
    8892
     93        /// get new qualifiers from old type
     94        Type::Qualifiers cv( const ast::Type * ty ) { return { ty->qualifiers.val }; }
     95
     96        template<typename NewT, typename OldT>
     97        NewT * cached( const OldT & old ) {
     98                auto it = cache.find( old.get() );
     99                if ( it == cache.end() ) {
     100                        // doesn't update cache, that should be handled by the accept function
     101                        return get< NewT >().accept1( old );
     102                } else {
     103                        return strict_dynamic_cast< NewT * >( it->second );
     104                }
     105        }
     106
    89107public:
    90108        Declaration * decl( const ast::Decl * declNode ) {
     
    93111
    94112private:
     113        void declPostamble( Declaration * decl, const ast::Decl * node ) {
     114                decl->location = node->location;
     115                // name comes from constructor
     116                // linkage comes from constructor
     117                decl->extension = node->extension;
     118                decl->uniqueId = node->uniqueId;
     119                // storageClasses comes from constructor
     120                this->node = decl;
     121        }
     122
     123        const ast::DeclWithType * declWithTypePostamble (
     124                        DeclarationWithType * decl, const ast::DeclWithType * node ) {
     125                declPostamble( decl, node );
     126                decl->mangleName = node->mangleName;
     127                decl->scopeLevel = node->scopeLevel;
     128                decl->asmName = get<Expression>().accept1( node->asmName );
     129                // attributes comes from constructor
     130                decl->isDeleted = node->isDeleted;
     131                // fs comes from constructor
     132                return nullptr;
     133        }
     134
    95135        const ast::DeclWithType * visit( const ast::ObjectDecl * node ) override final {
    96                 (void)node;
    97                 return nullptr;
     136                auto decl = new ObjectDecl(
     137                        node->name,
     138                        Type::StorageClasses( node->storage.val ),
     139                        LinkageSpec::Spec( node->linkage.val ),
     140                        get<Expression>().accept1( node->bitfieldWidth ),
     141                        get<Type>().accept1( node->type ),
     142                        get<Initializer>().accept1( node->init ),
     143                        get<Attribute>().acceptL( node->attributes ),
     144                        Type::FuncSpecifiers( node->funcSpec.val )
     145                );
     146                return declWithTypePostamble( decl, node );
    98147        }
    99148
    100149        const ast::DeclWithType * visit( const ast::FunctionDecl * node ) override final {
    101                 (void)node;
     150                auto decl = new FunctionDecl(
     151                        node->name,
     152                        Type::StorageClasses( node->storage.val ),
     153                        LinkageSpec::Spec( node->linkage.val ),
     154                        get<FunctionType>().accept1( node->type ),
     155                        get<CompoundStmt>().accept1( node->stmts ),
     156                        get<Attribute>().acceptL( node->attributes ),
     157                        Type::FuncSpecifiers( node->funcSpec.val )
     158                );
     159                decl->withExprs = get<Expression>().acceptL( node->withExprs );
     160                return declWithTypePostamble( decl, node );
     161        }
     162
     163        // NamedTypeDecl
     164        const ast::Decl * namedTypePostamble( NamedTypeDecl * decl, const ast::NamedTypeDecl * node ) {
     165                declPostamble( decl, node );
     166                // base comes from constructor
     167                decl->parameters = get<TypeDecl>().acceptL( node->params );
     168                decl->assertions = get<DeclarationWithType>().acceptL( node->assertions );
     169                return nullptr;
     170        }
     171
     172        const ast::Decl * visit( const ast::TypeDecl * node ) override final {
     173                TypeDecl::Kind kind;
     174                switch (node->kind) {
     175                case ast::TypeVar::Dtype:
     176                        kind = TypeDecl::Dtype;
     177                        break;
     178                case ast::TypeVar::Ftype:
     179                        kind = TypeDecl::Ftype;
     180                        break;
     181                case ast::TypeVar::Ttype:
     182                        kind = TypeDecl::Ttype;
     183                        break;
     184                default:
     185                        assertf(false, "Invalid ast::TypeVar::Kind: %d\n", node->kind);
     186                };
     187                auto decl = new TypeDecl(
     188                        node->name,
     189                        Type::StorageClasses( node->storage.val ),
     190                        get<Type>().accept1( node->base ),
     191                        kind,
     192                        node->sized,
     193                        get<Type>().accept1( node->init )
     194                );
     195                return namedTypePostamble( decl, node );
     196        }
     197
     198        const ast::Decl * visit( const ast::TypedefDecl * node ) override final {
     199                auto decl = new TypedefDecl(
     200                        node->name,
     201                        node->location,
     202                        Type::StorageClasses( node->storage.val ),
     203            get<Type>().accept1( node->base ),
     204                        LinkageSpec::Spec( node->linkage.val )
     205                );
     206                return namedTypePostamble( decl, node );
     207        }
     208
     209        const ast::Decl * aggregatePostamble( AggregateDecl * decl, const ast::AggregateDecl * node ) {
     210                decl->members = get<Declaration>().acceptL( node->members );
     211                decl->parameters = get<TypeDecl>().acceptL( node->params );
     212                decl->body = node->body;
     213                // attributes come from constructor
     214                // TODO: Need caching for: decl->parent = node->parent;
    102215                return nullptr;
    103216        }
    104217
    105218        const ast::Decl * visit( const ast::StructDecl * node ) override final {
    106                 (void)node;
    107                 return nullptr;
     219                auto decl = new StructDecl(
     220                        node->name,
     221                        node->kind,
     222                        get<Attribute>().acceptL( node->attributes ),
     223                        LinkageSpec::Spec( node->linkage.val )
     224                );
     225                return aggregatePostamble( decl, node );
    108226        }
    109227
    110228        const ast::Decl * visit( const ast::UnionDecl * node ) override final {
    111                 (void)node;
    112                 return nullptr;
     229                auto decl = new UnionDecl(
     230                        node->name,
     231                        get<Attribute>().acceptL( node->attributes ),
     232                        LinkageSpec::Spec( node->linkage.val )
     233                );
     234                return aggregatePostamble( decl, node );
    113235        }
    114236
    115237        const ast::Decl * visit( const ast::EnumDecl * node ) override final {
    116                 (void)node;
    117                 return nullptr;
     238                auto decl = new EnumDecl(
     239                        node->name,
     240                        get<Attribute>().acceptL( node->attributes ),
     241                        LinkageSpec::Spec( node->linkage.val )
     242                );
     243                return aggregatePostamble( decl, node );
    118244        }
    119245
    120246        const ast::Decl * visit( const ast::TraitDecl * node ) override final {
    121                 (void)node;
    122                 return nullptr;
    123         }
    124 
    125         const ast::Decl * visit( const ast::TypeDecl * node ) override final {
    126                 (void)node;
    127                 return nullptr;
    128         }
    129 
    130         const ast::Decl * visit( const ast::TypedefDecl * node ) override final {
    131                 (void)node;
    132                 return nullptr;
     247                auto decl = new TraitDecl(
     248                        node->name,
     249                        {},
     250                        LinkageSpec::Spec( node->linkage.val )
     251                );
     252                return aggregatePostamble( decl, node );
    133253        }
    134254
    135255        const ast::AsmDecl * visit( const ast::AsmDecl * node ) override final {
    136                 (void)node;
     256                auto decl = new AsmDecl( get<AsmStmt>().accept1( node->stmt ) );
     257                declPostamble( decl, node );
    137258                return nullptr;
    138259        }
    139260
    140261        const ast::StaticAssertDecl * visit( const ast::StaticAssertDecl * node ) override final {
    141                 (void)node;
    142                 return nullptr;
    143         }
    144 
    145         const ast::CompoundStmt * visit( const ast::CompoundStmt * node ) override final {
    146                 auto stmt = new CompoundStmt( get<Statement>().acceptL( node->kids ) );
     262                auto decl = new StaticAssertDecl(
     263                        get<Expression>().accept1( node->cond ),
     264                        get<ConstantExpr>().accept1( node->msg )
     265                );
     266                declPostamble( decl, node );
     267                return nullptr;
     268        }
     269
     270        const ast::Stmt * stmtPostamble( Statement * stmt, const ast::Stmt * node ) {
    147271                stmt->location = node->location;
    148272                stmt->labels = makeLabelL( stmt, node->labels );
     
    151275        }
    152276
     277        const ast::CompoundStmt * visit( const ast::CompoundStmt * node ) override final {
     278                auto stmt = new CompoundStmt( get<Statement>().acceptL( node->kids ) );
     279                stmtPostamble( stmt, node );
     280                return nullptr;
     281        }
     282
    153283        const ast::Stmt * visit( const ast::ExprStmt * node ) override final {
    154284                auto stmt = new ExprStmt( get<Expression>().accept1( node->expr ) );
    155                 stmt->location = node->location;
    156                 stmt->labels = makeLabelL( stmt, node->labels );
    157                 this->node = stmt;
    158                 return nullptr;
     285                return stmtPostamble( stmt, node );
    159286        }
    160287
     
    168295                        makeLabelL( nullptr, node->gotoLabels ) // What are these labelling?
    169296                );
    170                 stmt->location = node->location;
    171                 stmt->labels = makeLabelL( stmt, node->labels );
    172                 this->node = stmt;
    173                 return nullptr;
     297                return stmtPostamble( stmt, node );
    174298        }
    175299
    176300        const ast::Stmt * visit( const ast::DirectiveStmt * node ) override final {
    177301                auto stmt = new DirectiveStmt( node->directive );
    178                 stmt->location = node->location;
    179                 stmt->labels = makeLabelL( stmt, node->labels );
    180                 this->node = stmt;
    181                 return nullptr;
     302                return stmtPostamble( stmt, node );
    182303        }
    183304
     
    189310                        get<Statement>().acceptL( node->inits )
    190311                );
    191                 stmt->location = node->location;
    192                 stmt->labels = makeLabelL( stmt, node->labels );
    193                 this->node = stmt;
    194                 return nullptr;
     312                return stmtPostamble( stmt, node );
    195313        }
    196314
     
    200318                        get<Statement>().acceptL( node->stmts )
    201319                );
    202                 stmt->location = node->location;
    203                 stmt->labels = makeLabelL( stmt, node->labels );
    204                 this->node = stmt;
    205                 return nullptr;
     320                return stmtPostamble( stmt, node );
    206321        }
    207322
     
    212327                        node->isDefault()
    213328                );
    214                 stmt->location = node->location;
    215                 stmt->labels = makeLabelL( stmt, node->labels );
    216                 this->node = stmt;
    217                 return nullptr;
     329                return stmtPostamble( stmt, node );
    218330        }
    219331
     
    226338                        node->isDoWhile
    227339                );
    228                 stmt->location = node->location;
    229                 stmt->labels = makeLabelL( stmt, node->labels );
    230                 this->node = stmt;
    231                 return nullptr;
     340                return stmtPostamble( stmt, node );
    232341        }
    233342
     
    239348                        get<Statement>().accept1( node->body )
    240349                );
    241                 stmt->location = node->location;
    242                 stmt->labels = makeLabelL( stmt, node->labels );
    243                 this->node = stmt;
    244                 return nullptr;
     350                return stmtPostamble( stmt, node );
    245351        }
    246352
     
    271377                        stmt->target = makeLabel( stmt, node->target );
    272378                }
    273                 stmt->location = node->location;
    274                 stmt->labels = makeLabelL( stmt, node->labels );
    275                 this->node = stmt;
    276                 return nullptr;
     379                return stmtPostamble( stmt, node );
    277380        }
    278381
    279382        const ast::Stmt * visit( const ast::ReturnStmt * node ) override final {
    280383                auto stmt = new ReturnStmt( get<Expression>().accept1( node->expr ) );
    281                 stmt->location = node->location;
    282                 stmt->labels = makeLabelL( stmt, node->labels );
    283                 this->node = stmt;
    284                 return nullptr;
     384                return stmtPostamble( stmt, node );
    285385        }
    286386
     
    302402                        get<Expression>().accept1( node->target )
    303403                );
    304                 stmt->location = node->location;
    305                 stmt->labels = makeLabelL( stmt, node->labels );
    306                 this->node = stmt;
    307                 return nullptr;
     404                return stmtPostamble( stmt, node );
    308405        }
    309406
     
    315412                        get<FinallyStmt>().accept1( node->finally )
    316413                );
    317                 stmt->location = node->location;
    318                 stmt->labels = makeLabelL( stmt, node->labels );
    319                 this->node = stmt;
    320                 return nullptr;
     414                return stmtPostamble( stmt, node );
    321415        }
    322416
     
    339433                        get<Statement>().accept1( node->body )
    340434                );
    341                 stmt->location = node->location;
    342                 stmt->labels = makeLabelL( stmt, node->labels );
    343                 this->node = stmt;
    344                 return nullptr;
     435                return stmtPostamble( stmt, node );
    345436        }
    346437
    347438        const ast::Stmt * visit( const ast::FinallyStmt * node ) override final {
    348439                auto stmt = new FinallyStmt( get<CompoundStmt>().accept1( node->body ) );
    349                 stmt->location = node->location;
    350                 stmt->labels = makeLabelL( stmt, node->labels );
    351                 this->node = stmt;
    352                 return nullptr;
     440                return stmtPostamble( stmt, node );
    353441        }
    354442
     
    358446                for ( auto clause : node->clauses ) {
    359447                        stmt->clauses.push_back({{
    360                                         get<Expression>().accept1( clause.target.function ),
    361                                         get<Expression>().acceptL( clause.target.arguments ),
     448                                        get<Expression>().accept1( clause.target.func ),
     449                                        get<Expression>().acceptL( clause.target.args ),
    362450                                },
    363451                                get<Statement>().accept1( clause.stmt ),
     
    374462                        get<Expression>().accept1( node->orElse.cond ),
    375463                };
    376                 stmt->location = node->location;
    377                 stmt->labels = makeLabelL( stmt, node->labels );
    378                 this->node = stmt;
    379                 return nullptr;
     464                return stmtPostamble( stmt, node );
    380465        }
    381466
     
    385470                        get<Statement>().accept1( node->stmt )
    386471                );
    387                 stmt->location = node->location;
    388                 stmt->labels = makeLabelL( stmt, node->labels );
    389                 this->node = stmt;
    390                 return nullptr;
     472                return stmtPostamble( stmt, node );
    391473        }
    392474
    393475        const ast::NullStmt * visit( const ast::NullStmt * node ) override final {
    394476                auto stmt = new NullStmt();
    395                 stmt->location = node->location;
    396                 stmt->labels = makeLabelL( stmt, node->labels );
    397                 this->node = stmt;
     477                stmtPostamble( stmt, node );
    398478                return nullptr;
    399479        }
     
    401481        const ast::Stmt * visit( const ast::DeclStmt * node ) override final {
    402482                auto stmt = new DeclStmt( get<Declaration>().accept1( node->decl ) );
    403                 stmt->location = node->location;
    404                 stmt->labels = makeLabelL( stmt, node->labels );
    405                 this->node = stmt;
    406                 return nullptr;
     483                return stmtPostamble( stmt, node );
    407484        }
    408485
     
    670747
    671748        const ast::Type * visit( const ast::VoidType * node ) override final {
    672                 (void)node;
     749                this->node = new VoidType{ cv( node ) };
    673750                return nullptr;
    674751        }
    675752
    676753        const ast::Type * visit( const ast::BasicType * node ) override final {
    677                 (void)node;
     754                this->node = new BasicType{ cv( node ), (BasicType::Kind)(unsigned)node->kind };
    678755                return nullptr;
    679756        }
    680757
    681758        const ast::Type * visit( const ast::PointerType * node ) override final {
    682                 (void)node;
     759                this->node = new PointerType{
     760                        cv( node ),
     761                        get<Type>().accept1( node->base ),
     762                        get<Expression>().accept1( node->dimension ),
     763                        node->isVarLen,
     764                        node->isStatic
     765                };
    683766                return nullptr;
    684767        }
    685768
    686769        const ast::Type * visit( const ast::ArrayType * node ) override final {
    687                 (void)node;
     770                this->node = new ArrayType{
     771                        cv( node ),
     772                        get<Type>().accept1( node->base ),
     773                        get<Expression>().accept1( node->dimension ),
     774                        node->isVarLen,
     775                        node->isStatic
     776                };
    688777                return nullptr;
    689778        }
    690779
    691780        const ast::Type * visit( const ast::ReferenceType * node ) override final {
    692                 (void)node;
     781                this->node = new ReferenceType{
     782                        cv( node ),
     783                        get<Type>().accept1( node->base )
     784                };
    693785                return nullptr;
    694786        }
    695787
    696788        const ast::Type * visit( const ast::QualifiedType * node ) override final {
    697                 (void)node;
     789                this->node = new QualifiedType{
     790                        cv( node ),
     791                        get<Type>().accept1( node->parent ),
     792                        get<Type>().accept1( node->child )
     793                };
    698794                return nullptr;
    699795        }
    700796
    701797        const ast::Type * visit( const ast::FunctionType * node ) override final {
    702                 (void)node;
     798                auto ty = new FunctionType { cv( node ), node->isVarArgs };
     799                ty->returnVals = get<DeclarationWithType>().acceptL( node->returns );
     800                ty->parameters = get<DeclarationWithType>().acceptL( node->params );
     801                ty->forall = get<TypeDecl>().acceptL( node->forall );
     802                this->node = ty;
    703803                return nullptr;
    704804        }
     
    808908        }
    809909private:
     910        /// conversion output
    810911        ast::Node * node;
     912        /// cache of nodes that might be referenced by readonly<> for de-duplication
     913        std::unordered_map< BaseSyntaxNode *, ast::Node * > cache;
    811914
    812915        // Local Utilities:
     
    814917        template<typename NewT, typename OldT>
    815918        NewT * getAccept1( OldT old ) {
     919                if ( ! old ) return nullptr;
    816920                old->accept(*this);
    817921                return strict_dynamic_cast< NewT * >( node );
     
    854958#       define GET_LABELS_V(labels) \
    855959                to<std::vector>::from( make_labels( std::move( labels ) ) )
     960       
     961        static ast::CV::Qualifiers cv( Type * ty ) { return { ty->get_qualifiers().val }; }
     962
     963        template<typename NewT, typename OldT>
     964        NewT * cached( OldT * old ) {
     965                auto it = cache.find( old );
     966                // doesn't update cache, that should be handled by the accept function
     967                ast::Node * nw = it == cache.end() ? getAccept1< NewT >( old ) : it->second;
     968                return strict_dynamic_cast< NewT * >( nw );
     969        }
    856970
    857971        // Now all the visit functions:
     
    12601374        }
    12611375
    1262         void convertInferUnion(ast::Expr::InferUnion               &newInferred, 
     1376        void convertInferUnion(ast::Expr::InferUnion               &newInferred,
    12631377                                                   const std::map<UniqueId,ParamEntry> &oldInferParams,
    12641378                                                   const std::vector<UniqueId>         &oldResnSlots) {
     
    14671581        }
    14681582
    1469         virtual void visit( VoidType * ) override final {
    1470 
    1471         }
    1472 
    1473         virtual void visit( BasicType * ) override final {
    1474 
    1475         }
    1476 
    1477         virtual void visit( PointerType * ) override final {
    1478 
    1479         }
    1480 
    1481         virtual void visit( ArrayType * ) override final {
    1482 
    1483         }
    1484 
    1485         virtual void visit( ReferenceType * ) override final {
    1486 
    1487         }
    1488 
    1489         virtual void visit( QualifiedType * ) override final {
    1490 
    1491         }
    1492 
    1493         virtual void visit( FunctionType * ) override final {
    1494 
    1495         }
    1496 
    1497         virtual void visit( StructInstType * ) override final {
    1498 
    1499         }
    1500 
    1501         virtual void visit( UnionInstType * ) override final {
    1502 
    1503         }
    1504 
    1505         virtual void visit( EnumInstType * ) override final {
    1506 
    1507         }
    1508 
    1509         virtual void visit( TraitInstType * ) override final {
    1510 
    1511         }
    1512 
    1513         virtual void visit( TypeInstType * ) override final {
    1514 
     1583        virtual void visit( VoidType * old ) override final {
     1584                this->node = new ast::VoidType{ cv( old ) };
     1585        }
     1586
     1587        virtual void visit( BasicType * old ) override final {
     1588                this->node = new ast::BasicType{ (ast::BasicType::Kind)(unsigned)old->kind, cv( old ) };
     1589        }
     1590
     1591        virtual void visit( PointerType * old ) override final {
     1592                this->node = new ast::PointerType{
     1593                        GET_ACCEPT_1( base, Type ),
     1594                        GET_ACCEPT_1( dimension, Expr ),
     1595                        (ast::LengthFlag)old->isVarLen,
     1596                        (ast::DimensionFlag)old->isStatic,
     1597                        cv( old )
     1598                };
     1599        }
     1600
     1601        virtual void visit( ArrayType * old ) override final {
     1602                this->node = new ast::ArrayType{
     1603                        GET_ACCEPT_1( base, Type ),
     1604                        GET_ACCEPT_1( dimension, Expr ),
     1605                        (ast::LengthFlag)old->isVarLen,
     1606                        (ast::DimensionFlag)old->isStatic,
     1607                        cv( old )
     1608                };
     1609        }
     1610
     1611        virtual void visit( ReferenceType * old ) override final {
     1612                this->node = new ast::ReferenceType{
     1613                        GET_ACCEPT_1( base, Type ),
     1614                        cv( old )
     1615                };
     1616        }
     1617
     1618        virtual void visit( QualifiedType * old ) override final {
     1619                this->node = new ast::QualifiedType{
     1620                        GET_ACCEPT_1( parent, Type ),
     1621                        GET_ACCEPT_1( child, Type ),
     1622                        cv( old )
     1623                };
     1624        }
     1625
     1626        virtual void visit( FunctionType * old ) override final {
     1627                auto ty = new ast::FunctionType {
     1628                        (ast::ArgumentFlag)old->isVarArgs,
     1629                        cv( old )
     1630                };
     1631                ty->returns = GET_ACCEPT_V( returnVals, DeclWithType );
     1632                ty->params = GET_ACCEPT_V( parameters, DeclWithType );
     1633                ty->forall = GET_ACCEPT_V( forall, TypeDecl );
     1634                this->node = ty;
     1635        }
     1636
     1637        void postvisit( ReferenceToType * old, ast::ReferenceToType * ty ) {
     1638                ty->forall = GET_ACCEPT_V( forall, TypeDecl );
     1639                ty->params = GET_ACCEPT_V( parameters, Expr );
     1640                ty->hoistType = old->hoistType;
     1641        }
     1642
     1643        virtual void visit( StructInstType * old ) override final {
     1644                auto ty = new ast::StructInstType{
     1645                        cached< ast::StructDecl >( old->baseStruct ),
     1646                        cv( old ),
     1647                        GET_ACCEPT_V( attributes, Attribute )
     1648                };
     1649                postvisit( old, ty );
     1650                this->node = ty;
     1651        }
     1652
     1653        virtual void visit( UnionInstType * old ) override final {
     1654                auto ty = new ast::UnionInstType{
     1655                        cached< ast::UnionDecl >( old->baseUnion ),
     1656                        cv( old ),
     1657                        GET_ACCEPT_V( attributes, Attribute )
     1658                };
     1659                postvisit( old, ty );
     1660                this->node = ty;
     1661        }
     1662
     1663        virtual void visit( EnumInstType * old ) override final {
     1664                auto ty = new ast::EnumInstType{
     1665                        cached< ast::EnumDecl >( old->baseEnum ),
     1666                        cv( old ),
     1667                        GET_ACCEPT_V( attributes, Attribute )
     1668                };
     1669                postvisit( old, ty );
     1670                this->node = ty;
     1671        }
     1672
     1673        virtual void visit( TraitInstType * old ) override final {
     1674                auto ty = new ast::TraitInstType{
     1675                        cached< ast::TraitDecl >( old->baseTrait ),
     1676                        cv( old ),
     1677                        GET_ACCEPT_V( attributes, Attribute )
     1678                };
     1679                postvisit( old, ty );
     1680                this->node = ty;
     1681        }
     1682
     1683        virtual void visit( TypeInstType * old ) override final {
     1684                ast::TypeInstType * ty;
     1685                if ( old->baseType ) {
     1686                        ty = new ast::TypeInstType{
     1687                                old->name,
     1688                                cached< ast::TypeDecl >( old->baseType ),
     1689                                cv( old ),
     1690                                GET_ACCEPT_V( attributes, Attribute )
     1691                        };
     1692                } else {
     1693                        ty = new ast::TypeInstType{
     1694                                old->name,
     1695                                old->isFtype ? ast::TypeVar::Ftype : ast::TypeVar::Dtype,
     1696                                cv( old ),
     1697                                GET_ACCEPT_V( attributes, Attribute )
     1698                        };
     1699                }
     1700                postvisit( old, ty );
     1701                this->node = ty;
    15151702        }
    15161703
  • src/AST/Decl.cpp

    r5b35c21 ra1b154d  
    8181                                auto result = eval( init->value );
    8282                                if ( ! result.second ) {
    83                                         SemanticError( init->location, toString( "Non-constexpr in initialization of "
     83                                        SemanticError( init->location, ::toString( "Non-constexpr in initialization of "
    8484                                                "enumerator: ", field ) );
    8585                                }
     
    8787                        }
    8888                        if ( enumValues.count( field->name ) != 0 ) {
    89                                 SemanticError( location, toString( "Enum ", name, " has multiple members with the "     "name ", field->name ) );
     89                                SemanticError( location, ::toString( "Enum ", name, " has multiple members with the "   "name ", field->name ) );
    9090                        }
    9191                        enumValues[ field->name ] = crntVal;
  • src/AST/Decl.hpp

    r5b35c21 ra1b154d  
    329329class StaticAssertDecl : public Decl {
    330330public:
    331         ptr<Expr> condition;
     331        ptr<Expr> cond;
    332332        ptr<ConstantExpr> msg;   // string literal
    333333
    334334        StaticAssertDecl( const CodeLocation & loc, const Expr * condition, const ConstantExpr * msg )
    335         : Decl( loc, "", {}, {} ), condition( condition ), msg( msg ) {}
     335        : Decl( loc, "", {}, {} ), cond( condition ), msg( msg ) {}
    336336
    337337        const StaticAssertDecl * accept( Visitor &v ) const override { return v.visit( this ); }
  • src/AST/Expr.cpp

    r5b35c21 ra1b154d  
    2222#include "Stmt.hpp"
    2323#include "Type.hpp"
     24#include "Common/utility.h"
    2425#include "Common/SemanticError.h"
    2526#include "GenPoly/Lvalue.h"        // for referencesPermissable
  • src/AST/Expr.hpp

    r5b35c21 ra1b154d  
    521521};
    522522
    523 /// The application of a function to a set of parameters, along with a set of copy constructor 
     523/// The application of a function to a set of parameters, along with a set of copy constructor
    524524/// calls, one for each argument
    525525class ImplicitCopyCtorExpr final : public Expr {
     
    621621};
    622622
    623 /// A multiple- or mass-assignment operation, or a tuple ctor/dtor expression. 
    624 /// multiple-assignment: both sides of the assignment have tuple type, 
     623/// A multiple- or mass-assignment operation, or a tuple ctor/dtor expression.
     624/// multiple-assignment: both sides of the assignment have tuple type,
    625625///     e.g. `[a, b, c] = [d, e, f];`
    626626/// mass-assignment: left-hand side has tuple type and right-hand side does not:
     
    630630        ptr<StmtExpr> stmtExpr;
    631631
    632         TupleAssignExpr( 
    633                 const CodeLocation & loc, std::vector<ptr<Expr>> && assigns, 
     632        TupleAssignExpr(
     633                const CodeLocation & loc, std::vector<ptr<Expr>> && assigns,
    634634                std::vector<ptr<ObjectDecl>> && tempDecls );
    635        
     635
    636636        const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
    637637private:
  • src/AST/Fwd.hpp

    r5b35c21 ra1b154d  
    131131class TypeSubstitution;
    132132
    133 std::string toString( const Node * );
    134 
    135 template < typename ... Params >
    136 std::string toString( const Params & ... params );
    137 
    138133typedef unsigned int UniqueId;
    139134
  • src/AST/Node.cpp

    r5b35c21 ra1b154d  
    1616#include "Node.hpp"
    1717#include "Fwd.hpp"
     18
     19#include <iostream>
    1820
    1921#include "Attribute.hpp"
     
    4244        assign( r );
    4345        return r;
     46}
     47
     48std::ostream & ast::operator<< ( std::ostream & out, const ast::Node * node ) {
     49        (void)node;
     50        #warning unimplemented
     51        assertf(false, "Unimplemented");
     52        return out;
    4453}
    4554
  • src/AST/Pass.impl.hpp

    r5b35c21 ra1b154d  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Pass.impl.hpp --
     7// ast::Pass.impl.hpp --
    88//
    99// Author           : Thierry Delisle
     
    121121        template< typename pass_t >
    122122        template< typename node_t >
    123         auto Pass< pass_t >::call_accept( const node_t * node )
     123        auto ast::Pass< pass_t >::call_accept( const node_t * node )
    124124                -> typename std::enable_if<
    125125                                !std::is_base_of<ast::Expr, node_t>::value &&
     
    139139
    140140        template< typename pass_t >
    141         const ast::Expr * Pass< pass_t >::call_accept( const ast::Expr * expr ) {
     141        const ast::Expr * ast::Pass< pass_t >::call_accept( const ast::Expr * expr ) {
    142142                __pedantic_pass_assert( __visit_children() );
    143143                __pedantic_pass_assert( expr );
     
    152152
    153153        template< typename pass_t >
    154         const ast::Stmt * Pass< pass_t >::call_accept( const ast::Stmt * stmt ) {
     154        const ast::Stmt * ast::Pass< pass_t >::call_accept( const ast::Stmt * stmt ) {
    155155                __pedantic_pass_assert( __visit_children() );
    156156                __pedantic_pass_assert( stmt );
     
    204204        template< typename pass_t >
    205205        template< template <class...> class container_t >
    206         container_t< ptr<Stmt> > Pass< pass_t >::call_accept( const container_t< ptr<Stmt> > & statements ) {
     206        container_t< ptr<Stmt> > ast::Pass< pass_t >::call_accept( const container_t< ptr<Stmt> > & statements ) {
    207207                __pedantic_pass_assert( __visit_children() );
    208208                if( statements.empty() ) return {};
     
    270270        template< typename pass_t >
    271271        template< template <class...> class container_t, typename node_t >
    272         container_t< ast::ptr<node_t> > Pass< pass_t >::call_accept( const container_t< ast::ptr<node_t> > & container ) {
     272        container_t< ast::ptr<node_t> > ast::Pass< pass_t >::call_accept( const container_t< ast::ptr<node_t> > & container ) {
    273273                __pedantic_pass_assert( __visit_children() );
    274274                if( container.empty() ) return {};
     
    301301        template< typename pass_t >
    302302        template<typename node_t, typename parent_t, typename child_t>
    303         void Pass< pass_t >::maybe_accept(
     303        void ast::Pass< pass_t >::maybe_accept(
    304304                const node_t * & parent,
    305305                child_t parent_t::*child
     
    571571        __pass::indexer::addType( pass, 0, node );
    572572
    573         maybe_accept( node, &TypedefDecl::assertions );
     573        VISIT( maybe_accept( node, &TypedefDecl::assertions ); )
    574574
    575575        VISIT_END( Decl, node );
     
    596596
    597597        VISIT(
    598                 maybe_accept( node, &StaticAssertDecl::condition );
    599                 maybe_accept( node, &StaticAssertDecl::msg       );
     598                maybe_accept( node, &StaticAssertDecl::cond );
     599                maybe_accept( node, &StaticAssertDecl::msg  );
    600600        )
    601601
     
    626626// ExprStmt
    627627template< typename pass_t >
    628 const ast::Stmt * ast::Pass< pass_t >::visit( const ExprStmt * node ) {
     628const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ExprStmt * node ) {
    629629        VISIT_START( node );
    630630
     
    666666const ast::Stmt * ast::Pass< pass_t >::visit( const ast::IfStmt * node ) {
    667667        VISIT_START( node );
     668
    668669        VISIT({
    669670                // if statements introduce a level of scope (for the initialization)
     
    674675                maybe_accept( node, &IfStmt::elsePart );
    675676        })
     677
    676678        VISIT_END( Stmt, node );
    677679}
     
    680682// WhileStmt
    681683template< typename pass_t >
    682 const ast::Stmt * ast::Pass< pass_t >::visit( const WhileStmt * node ) {
     684const ast::Stmt * ast::Pass< pass_t >::visit( const ast::WhileStmt * node ) {
    683685        VISIT_START( node );
    684686
     
    832834                //      maybeAccept_impl( clause.condition, *this );
    833835                // }
     836
     837        VISIT({
     838                std::vector<WaitForStmt::Clause> new_clauses;
     839                new_clauses.reserve( node->clauses.size() );
     840                bool mutated = false;
     841                for( const auto & clause : node->clauses ) {
     842
     843                        Expr * func = clause.target.func ? clause.target.func->accept(*this) : nullptr;
     844                        if(func != clause.target.func) mutated = true;
     845
     846                        std::vector<ptr<Expr>> new_args;
     847                        new_args.reserve(clause.target.args.size());
     848                        for( const auto & arg : clause.target.args ) {
     849                                auto a = arg->accept(*this);
     850                                new_args.push_back( a );
     851                                if( a != arg ) mutated = true;
     852                        }
     853
     854                        Stmt * stmt = clause.stmt ? clause.stmt->accept(*this) : nullptr;
     855                        if(stmt != clause.stmt) mutated = true;
     856
     857                        Expr * cond = clause.cond ? clause.cond->accept(*this) : nullptr;
     858                        if(cond != clause.cond) mutated = true;
     859
     860                        new_clauses.push_back( WaitForStmt::Clause{ {func, std::move(new_args) }, stmt, cond } );
     861                }
     862
     863                if(mutated) {
     864                        auto n = mutate(node);
     865                        n->clauses = std::move( new_clauses );
     866                        node = n;
     867                }
     868        })
    834869
    835870        #define maybe_accept(field) \
     
    910945}
    911946
    912 
    913 
    914 
    915 
     947//--------------------------------------------------------------------------
     948// ApplicationExpr
     949template< typename pass_t >
     950const ast::Expr * ast::Pass< pass_t >::visit( const ast::ApplicationExpr * node ) {
     951        VISIT_START( node );
     952
     953        VISIT(
     954                {
     955                        guard_indexer guard { *this };
     956                        maybe_accept( node, &ApplicationExpr::result );
     957                }
     958                maybe_accept( node, &ApplicationExpr::func );
     959                maybe_accept( node, &ApplicationExpr::args );
     960        )
     961
     962        VISIT_END( Expr, node );
     963}
     964
     965//--------------------------------------------------------------------------
     966// UntypedExpr
     967template< typename pass_t >
     968const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedExpr * node ) {
     969        VISIT_START( node );
     970
     971        VISIT(
     972                {
     973                        guard_indexer guard { *this };
     974                        maybe_accept( node, &UntypedExpr::result );
     975                }
     976
     977                maybe_accept( node, &UntypedExpr::args );
     978        )
     979
     980        VISIT_END( Expr, node );
     981}
     982
     983//--------------------------------------------------------------------------
     984// NameExpr
     985template< typename pass_t >
     986const ast::Expr * ast::Pass< pass_t >::visit( const ast::NameExpr * node ) {
     987        VISIT_START( node );
     988
     989        VISIT({
     990                guard_indexer guard { *this };
     991                maybe_accept( node, &NameExpr::result );
     992        })
     993
     994        VISIT_END( Expr, node );
     995}
     996
     997//--------------------------------------------------------------------------
     998// CastExpr
     999template< typename pass_t >
     1000const ast::Expr * ast::Pass< pass_t >::visit( const ast::CastExpr * node ) {
     1001        VISIT_START( node );
     1002
     1003        VISIT({
     1004                        guard_indexer guard { *this };
     1005                        maybe_accept( node, &CastExpr::result );
     1006                }
     1007                maybe_accept( node, &CastExpr::arg );
     1008        )
     1009
     1010        VISIT_END( Expr, node );
     1011}
     1012
     1013//--------------------------------------------------------------------------
     1014// KeywordCastExpr
     1015template< typename pass_t >
     1016const ast::Expr * ast::Pass< pass_t >::visit( const ast::KeywordCastExpr * node ) {
     1017        VISIT_START( node );
     1018
     1019        VISIT({
     1020                        guard_indexer guard { *this };
     1021                        maybe_accept( node, &KeywordCastExpr::result );
     1022                }
     1023                maybe_accept( node, &KeywordCastExpr::arg );
     1024        )
     1025
     1026        VISIT_END( Expr, node );
     1027}
     1028
     1029//--------------------------------------------------------------------------
     1030// VirtualCastExpr
     1031template< typename pass_t >
     1032const ast::Expr * ast::Pass< pass_t >::visit( const ast::VirtualCastExpr * node ) {
     1033        VISIT_START( node );
     1034
     1035        VISIT({
     1036                        guard_indexer guard { *this };
     1037                        maybe_accept( node, &VirtualCastExpr::result );
     1038                }
     1039                maybe_accept( node, &VirtualCastExpr::arg );
     1040        )
     1041
     1042        VISIT_END( Expr, node );
     1043}
     1044
     1045//--------------------------------------------------------------------------
     1046// AddressExpr
     1047template< typename pass_t >
     1048const ast::Expr * ast::Pass< pass_t >::visit( const ast::AddressExpr * node ) {
     1049        VISIT_START( node );
     1050
     1051        VISIT({
     1052                        guard_indexer guard { *this };
     1053                        maybe_accept( node, &AddressExpr::result );
     1054                }
     1055                maybe_accept( node, &AddressExpr::arg );
     1056        )
     1057
     1058        VISIT_END( Expr, node );
     1059}
     1060
     1061//--------------------------------------------------------------------------
     1062// LabelAddressExpr
     1063template< typename pass_t >
     1064const ast::Expr * ast::Pass< pass_t >::visit( const ast::LabelAddressExpr * node ) {
     1065        VISIT_START( node );
     1066
     1067        VISIT({
     1068                guard_indexer guard { *this };
     1069                maybe_accept( node, &LabelAddressExpr::result );
     1070        })
     1071
     1072        VISIT_END( Expr, node );
     1073}
     1074
     1075//--------------------------------------------------------------------------
     1076// UntypedMemberExpr
     1077template< typename pass_t >
     1078const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedMemberExpr * node ) {
     1079        VISIT_START( node );
     1080
     1081        VISIT({
     1082                        guard_indexer guard { *this };
     1083                        maybe_accept( node, &UntypedMemberExpr::result );
     1084                }
     1085                maybe_accept( node, &UntypedMemberExpr::aggregate );
     1086                maybe_accept( node, &UntypedMemberExpr::member    );
     1087        )
     1088
     1089        VISIT_END( Expr, node );
     1090}
     1091
     1092//--------------------------------------------------------------------------
     1093// MemberExpr
     1094template< typename pass_t >
     1095const ast::Expr * ast::Pass< pass_t >::visit( const ast::MemberExpr * node ) {
     1096        VISIT_START( node );
     1097
     1098        VISIT({
     1099                        guard_indexer guard { *this };
     1100                        maybe_accept( node, &MemberExpr::result );
     1101                }
     1102                maybe_accept( node, &MemberExpr::aggregate );
     1103        )
     1104
     1105        VISIT_END( Expr, node );
     1106}
     1107
     1108//--------------------------------------------------------------------------
     1109// VariableExpr
     1110template< typename pass_t >
     1111const ast::Expr * ast::Pass< pass_t >::visit( const ast::VariableExpr * node ) {
     1112        VISIT_START( node );
     1113
     1114        VISIT({
     1115                guard_indexer guard { *this };
     1116                maybe_accept( node, &VariableExpr::result );
     1117        })
     1118
     1119        VISIT_END( Expr, node );
     1120}
     1121
     1122//--------------------------------------------------------------------------
     1123// ConstantExpr
     1124template< typename pass_t >
     1125const ast::Expr * ast::Pass< pass_t >::visit( const ast::ConstantExpr * node ) {
     1126        VISIT_START( node );
     1127
     1128        VISIT({
     1129                guard_indexer guard { *this };
     1130                maybe_accept( node, &ConstantExpr::result );
     1131        })
     1132
     1133        VISIT_END( Expr, node );
     1134}
     1135
     1136//--------------------------------------------------------------------------
     1137// SizeofExpr
     1138template< typename pass_t >
     1139const ast::Expr * ast::Pass< pass_t >::visit( const ast::SizeofExpr * node ) {
     1140        VISIT_START( node );
     1141
     1142        VISIT({
     1143                        guard_indexer guard { *this };
     1144                        maybe_accept( node, &SizeofExpr::result );
     1145                }
     1146                if ( node->type ) {
     1147                        maybe_accept( node, &SizeofExpr::type );
     1148                } else {
     1149                        maybe_accept( node, &SizeofExpr::expr );
     1150                }
     1151        )
     1152
     1153        VISIT_END( Expr, node );
     1154}
     1155
     1156//--------------------------------------------------------------------------
     1157// AlignofExpr
     1158template< typename pass_t >
     1159const ast::Expr * ast::Pass< pass_t >::visit( const ast::AlignofExpr * node ) {
     1160        VISIT_START( node );
     1161
     1162        VISIT({
     1163                        guard_indexer guard { *this };
     1164                        maybe_accept( node, &AlignofExpr::result );
     1165                }
     1166                if ( node->type ) {
     1167                        maybe_accept( node, &AlignofExpr::type );
     1168                } else {
     1169                        maybe_accept( node, &AlignofExpr::expr );
     1170                }
     1171        )
     1172
     1173        VISIT_END( Expr, node );
     1174}
     1175
     1176//--------------------------------------------------------------------------
     1177// UntypedOffsetofExpr
     1178template< typename pass_t >
     1179const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedOffsetofExpr * node ) {
     1180        VISIT_START( node );
     1181
     1182        VISIT({
     1183                        guard_indexer guard { *this };
     1184                        maybe_accept( node, &UntypedOffsetofExpr::result );
     1185                }
     1186                maybe_accept( node, &UntypedOffsetofExpr::type   );
     1187        )
     1188
     1189        VISIT_END( Expr, node );
     1190}
     1191
     1192//--------------------------------------------------------------------------
     1193// OffsetofExpr
     1194template< typename pass_t >
     1195const ast::Expr * ast::Pass< pass_t >::visit( const ast::OffsetofExpr * node ) {
     1196        VISIT_START( node );
     1197
     1198        VISIT({
     1199                        guard_indexer guard { *this };
     1200                        maybe_accept( node, &OffsetofExpr::result );
     1201                }
     1202                maybe_accept( node, &OffsetofExpr::type   );
     1203        )
     1204
     1205        VISIT_END( Expr, node );
     1206}
     1207
     1208//--------------------------------------------------------------------------
     1209// OffsetPackExpr
     1210template< typename pass_t >
     1211const ast::Expr * ast::Pass< pass_t >::visit( const ast::OffsetPackExpr * node ) {
     1212        VISIT_START( node );
     1213
     1214        VISIT({
     1215                        guard_indexer guard { *this };
     1216                        maybe_accept( node, &OffsetPackExpr::result );
     1217                }
     1218                maybe_accept( node, &OffsetPackExpr::type   );
     1219        )
     1220
     1221        VISIT_END( Expr, node );
     1222}
     1223
     1224//--------------------------------------------------------------------------
     1225// LogicalExpr
     1226template< typename pass_t >
     1227const ast::Expr * ast::Pass< pass_t >::visit( const ast::LogicalExpr * node ) {
     1228        VISIT_START( node );
     1229
     1230        VISIT({
     1231                        guard_indexer guard { *this };
     1232                        maybe_accept( node, &LogicalExpr::result );
     1233                }
     1234                maybe_accept( node, &LogicalExpr::arg1 );
     1235                maybe_accept( node, &LogicalExpr::arg2 );
     1236        )
     1237
     1238        VISIT_END( Expr, node );
     1239}
     1240
     1241//--------------------------------------------------------------------------
     1242// ConditionalExpr
     1243template< typename pass_t >
     1244const ast::Expr * ast::Pass< pass_t >::visit( const ast::ConditionalExpr * node ) {
     1245        VISIT_START( node );
     1246
     1247        VISIT({
     1248                        guard_indexer guard { *this };
     1249                        maybe_accept( node, &ConditionalExpr::result );
     1250                }
     1251                maybe_accept( node, &ConditionalExpr::arg1 );
     1252                maybe_accept( node, &ConditionalExpr::arg2 );
     1253                maybe_accept( node, &ConditionalExpr::arg3 );
     1254        )
     1255
     1256        VISIT_END( Expr, node );
     1257}
     1258
     1259//--------------------------------------------------------------------------
     1260// CommaExpr
     1261template< typename pass_t >
     1262const ast::Expr * ast::Pass< pass_t >::visit( const ast::CommaExpr * node ) {
     1263        VISIT_START( node );
     1264
     1265        VISIT({
     1266                        guard_indexer guard { *this };
     1267                        maybe_accept( node, &CommaExpr::result );
     1268                }
     1269                maybe_accept( node, &CommaExpr::arg1 );
     1270                maybe_accept( node, &CommaExpr::arg2 );
     1271        )
     1272
     1273        VISIT_END( Expr, node );
     1274}
     1275
     1276//--------------------------------------------------------------------------
     1277// TypeExpr
     1278template< typename pass_t >
     1279const ast::Expr * ast::Pass< pass_t >::visit( const ast::TypeExpr * node ) {
     1280        VISIT_START( node );
     1281
     1282        VISIT({
     1283                        guard_indexer guard { *this };
     1284                        maybe_accept( node, &TypeExpr::result );
     1285                }
     1286                maybe_accept( node, &TypeExpr::type );
     1287        )
     1288
     1289        VISIT_END( Expr, node );
     1290}
     1291
     1292//--------------------------------------------------------------------------
     1293// AsmExpr
     1294template< typename pass_t >
     1295const ast::Expr * ast::Pass< pass_t >::visit( const ast::AsmExpr * node ) {
     1296        VISIT_START( node );
     1297
     1298        VISIT({
     1299                        guard_indexer guard { *this };
     1300                        maybe_accept( node, &AsmExpr::result );
     1301                }
     1302                maybe_accept( node, &AsmExpr::inout      );
     1303                maybe_accept( node, &AsmExpr::constraint );
     1304                maybe_accept( node, &AsmExpr::operand    );
     1305        )
     1306
     1307        VISIT_END( Expr, node );
     1308}
     1309
     1310//--------------------------------------------------------------------------
     1311// ImplicitCopyCtorExpr
     1312template< typename pass_t >
     1313const ast::Expr * ast::Pass< pass_t >::visit( const ast::ImplicitCopyCtorExpr * node ) {
     1314        VISIT_START( node );
     1315
     1316        VISIT({
     1317                        guard_indexer guard { *this };
     1318                        maybe_accept( node, &ImplicitCopyCtorExpr::result );
     1319                }
     1320                maybe_accept( node, &ImplicitCopyCtorExpr::callExpr    );
     1321                maybe_accept( node, &ImplicitCopyCtorExpr::tempDecls   );
     1322                maybe_accept( node, &ImplicitCopyCtorExpr::returnDecls );
     1323                maybe_accept( node, &ImplicitCopyCtorExpr::dtors       );
     1324        )
     1325
     1326        VISIT_END( Expr, node );
     1327}
     1328
     1329//--------------------------------------------------------------------------
     1330// ConstructorExpr
     1331template< typename pass_t >
     1332const ast::Expr * ast::Pass< pass_t >::visit( const ast::ConstructorExpr * node ) {
     1333        VISIT_START( node );
     1334
     1335        VISIT({
     1336                        guard_indexer guard { *this };
     1337                        maybe_accept( node, &ConstructorExpr::result );
     1338                }
     1339                maybe_accept( node, &ConstructorExpr::callExpr );
     1340        )
     1341
     1342        VISIT_END( Expr, node );
     1343}
     1344
     1345//--------------------------------------------------------------------------
     1346// CompoundLiteralExpr
     1347template< typename pass_t >
     1348const ast::Expr * ast::Pass< pass_t >::visit( const ast::CompoundLiteralExpr * node ) {
     1349        VISIT_START( node );
     1350
     1351        VISIT({
     1352                        guard_indexer guard { *this };
     1353                        maybe_accept( node, &CompoundLiteralExpr::result );
     1354                }
     1355                maybe_accept( node, &CompoundLiteralExpr::init );
     1356        )
     1357
     1358        VISIT_END( Expr, node );
     1359}
     1360
     1361//--------------------------------------------------------------------------
     1362// RangeExpr
     1363template< typename pass_t >
     1364const ast::Expr * ast::Pass< pass_t >::visit( const ast::RangeExpr * node ) {
     1365        VISIT_START( node );
     1366
     1367        VISIT({
     1368                        guard_indexer guard { *this };
     1369                        maybe_accept( node, &RangeExpr::result );
     1370                }
     1371                maybe_accept( node, &RangeExpr::low    );
     1372                maybe_accept( node, &RangeExpr::high   );
     1373        )
     1374
     1375        VISIT_END( Expr, node );
     1376}
     1377
     1378//--------------------------------------------------------------------------
     1379// UntypedTupleExpr
     1380template< typename pass_t >
     1381const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedTupleExpr * node ) {
     1382        VISIT_START( node );
     1383
     1384        VISIT({
     1385                        guard_indexer guard { *this };
     1386                        maybe_accept( node, &UntypedTupleExpr::result );
     1387                }
     1388                maybe_accept( node, &UntypedTupleExpr::exprs  );
     1389        )
     1390
     1391        VISIT_END( Expr, node );
     1392}
     1393
     1394//--------------------------------------------------------------------------
     1395// TupleExpr
     1396template< typename pass_t >
     1397const ast::Expr * ast::Pass< pass_t >::visit( const ast::TupleExpr * node ) {
     1398        VISIT_START( node );
     1399
     1400        VISIT({
     1401                        guard_indexer guard { *this };
     1402                        maybe_accept( node, &TupleExpr::result );
     1403                }
     1404                maybe_accept( node, &TupleExpr::exprs  );
     1405        )
     1406
     1407        VISIT_END( Expr, node );
     1408}
     1409
     1410//--------------------------------------------------------------------------
     1411// TupleIndexExpr
     1412template< typename pass_t >
     1413const ast::Expr * ast::Pass< pass_t >::visit( const ast::TupleIndexExpr * node ) {
     1414        VISIT_START( node );
     1415
     1416        VISIT({
     1417                        guard_indexer guard { *this };
     1418                        maybe_accept( node, &TupleIndexExpr::result );
     1419                }
     1420                maybe_accept( node, &TupleIndexExpr::tuple  );
     1421        )
     1422
     1423        VISIT_END( Expr, node );
     1424}
     1425
     1426//--------------------------------------------------------------------------
     1427// TupleAssignExpr
     1428template< typename pass_t >
     1429const ast::Expr * ast::Pass< pass_t >::visit( const ast::TupleAssignExpr * node ) {
     1430        VISIT_START( node );
     1431
     1432        VISIT({
     1433                        guard_indexer guard { *this };
     1434                        maybe_accept( node, &TupleAssignExpr::result );
     1435                }
     1436                maybe_accept( node, &TupleAssignExpr::stmtExpr );
     1437        )
     1438
     1439        VISIT_END( Expr, node );
     1440}
     1441
     1442//--------------------------------------------------------------------------
     1443// StmtExpr
     1444template< typename pass_t >
     1445const ast::Expr * ast::Pass< pass_t >::visit( const ast::StmtExpr * node ) {
     1446        VISIT_START( node );
     1447
     1448        VISIT(// don't want statements from outer CompoundStmts to be added to this StmtExpr
     1449                // get the stmts that will need to be spliced in
     1450                auto stmts_before = __pass::stmtsToAddBefore( pass, 0);
     1451                auto stmts_after  = __pass::stmtsToAddAfter ( pass, 0);
     1452
     1453                // These may be modified by subnode but most be restored once we exit this statemnet.
     1454                ValueGuardPtr< const ast::TypeSubstitution * > __old_env( __pass::env( pass, 0) );
     1455                ValueGuardPtr< typename std::remove_pointer< decltype(stmts_before) >::type > __old_decls_before( stmts_before );
     1456                ValueGuardPtr< typename std::remove_pointer< decltype(stmts_after ) >::type > __old_decls_after ( stmts_after  );
     1457
     1458                {
     1459                        guard_indexer guard { *this };
     1460                        maybe_accept( node, &StmtExpr::result );
     1461                }
     1462                maybe_accept( node, &StmtExpr::stmts       );
     1463                maybe_accept( node, &StmtExpr::returnDecls );
     1464                maybe_accept( node, &StmtExpr::dtors       );
     1465        )
     1466
     1467        VISIT_END( Expr, node );
     1468}
     1469
     1470//--------------------------------------------------------------------------
     1471// UniqueExpr
     1472template< typename pass_t >
     1473const ast::Expr * ast::Pass< pass_t >::visit( const ast::UniqueExpr * node ) {
     1474        VISIT_START( node );
     1475
     1476        VISIT({
     1477                        guard_indexer guard { *this };
     1478                        maybe_accept( node, &UniqueExpr::result );
     1479                }
     1480                maybe_accept( node, &UniqueExpr::expr   );
     1481        )
     1482
     1483        VISIT_END( Expr, node );
     1484}
     1485
     1486//--------------------------------------------------------------------------
     1487// UntypedInitExpr
     1488template< typename pass_t >
     1489const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedInitExpr * node ) {
     1490        VISIT_START( node );
     1491
     1492        VISIT({
     1493                        guard_indexer guard { *this };
     1494                        maybe_accept( node, &UntypedInitExpr::result );
     1495                }
     1496                maybe_accept( node, &UntypedInitExpr::expr   );
     1497                // not currently visiting initAlts, but this doesn't matter since this node is only used in the resolver.
     1498        )
     1499
     1500        VISIT_END( Expr, node );
     1501}
     1502
     1503//--------------------------------------------------------------------------
     1504// InitExpr
     1505template< typename pass_t >
     1506const ast::Expr * ast::Pass< pass_t >::visit( const ast::InitExpr * node ) {
     1507        VISIT_START( node );
     1508
     1509        VISIT({
     1510                        guard_indexer guard { *this };
     1511                        maybe_accept( node, &InitExpr::result );
     1512                }
     1513                maybe_accept( node, &InitExpr::expr   );
     1514                maybe_accept( node, &InitExpr::designation );
     1515        )
     1516
     1517        VISIT_END( Expr, node );
     1518}
     1519
     1520//--------------------------------------------------------------------------
     1521// DeletedExpr
     1522template< typename pass_t >
     1523const ast::Expr * ast::Pass< pass_t >::visit( const ast::DeletedExpr * node ) {
     1524        VISIT_START( node );
     1525
     1526        VISIT({
     1527                        guard_indexer guard { *this };
     1528                        maybe_accept( node, &DeletedExpr::result );
     1529                }
     1530                maybe_accept( node, &DeletedExpr::expr );
     1531                // don't visit deleteStmt, because it is a pointer to somewhere else in the tree.
     1532        )
     1533
     1534        VISIT_END( Expr, node );
     1535}
     1536
     1537//--------------------------------------------------------------------------
     1538// DefaultArgExpr
     1539template< typename pass_t >
     1540const ast::Expr * ast::Pass< pass_t >::visit( const ast::DefaultArgExpr * node ) {
     1541        VISIT_START( node );
     1542
     1543        VISIT({
     1544                        guard_indexer guard { *this };
     1545                        maybe_accept( node, &DefaultArgExpr::result );
     1546                }
     1547                maybe_accept( node, &DefaultArgExpr::expr );
     1548        )
     1549
     1550        VISIT_END( Expr, node );
     1551}
     1552
     1553//--------------------------------------------------------------------------
     1554// GenericExpr
     1555template< typename pass_t >
     1556const ast::Expr * ast::Pass< pass_t >::visit( const ast::GenericExpr * node ) {
     1557        VISIT_START( node );
     1558
     1559        VISIT({
     1560                        guard_indexer guard { *this };
     1561                        maybe_accept( node, &GenericExpr::result );
     1562                }
     1563                maybe_accept( node, &GenericExpr::control );
     1564
     1565                std::vector<GenericExpr::Association> new_kids;
     1566                new_kids.reserve(node->associations.size());
     1567                bool mutated = false;
     1568                for( const auto & assoc : node->associations ) {
     1569                        Type * type = nullptr;
     1570                        if( assoc.type ) {
     1571                                guard_indexer guard { *this };
     1572                                type = assoc.type->accept( *this );
     1573                                if( type != assoc.type ) mutated = true;
     1574                        }
     1575                        Expr * expr = nullptr;
     1576                        if( assoc.expr ) {
     1577                                expr = assoc.expr->accept( *this );
     1578                                if( expr != assoc.expr ) mutated = true;
     1579                        }
     1580                        new_kids.emplace_back( type, expr );
     1581                }
     1582
     1583                if(mutated) {
     1584                        auto n = mutate(node);
     1585                        n->associations = std::move( new_kids );
     1586                        node = n;
     1587                }
     1588        )
     1589
     1590        VISIT_END( Expr, node );
     1591}
     1592
     1593//--------------------------------------------------------------------------
     1594// VoidType
     1595template< typename pass_t >
     1596const ast::Type * ast::Pass< pass_t >::visit( const ast::VoidType * node ) {
     1597        VISIT_START( node );
     1598
     1599        VISIT_END( Type, node );
     1600}
     1601
     1602//--------------------------------------------------------------------------
     1603// BasicType
     1604template< typename pass_t >
     1605const ast::Type * ast::Pass< pass_t >::visit( const ast::BasicType * node ) {
     1606        VISIT_START( node );
     1607
     1608        VISIT_END( Type, node );
     1609}
     1610
     1611//--------------------------------------------------------------------------
     1612// PointerType
     1613template< typename pass_t >
     1614const ast::Type * ast::Pass< pass_t >::visit( const ast::PointerType * node ) {
     1615        VISIT_START( node );
     1616
     1617        VISIT(
     1618                // xxx - should PointerType visit/mutate dimension?
     1619                maybe_accept( node, &PointerType::base );
     1620        )
     1621
     1622        VISIT_END( Type, node );
     1623}
     1624
     1625//--------------------------------------------------------------------------
     1626// ArrayType
     1627template< typename pass_t >
     1628const ast::Type * ast::Pass< pass_t >::visit( const ast::ArrayType * node ) {
     1629        VISIT_START( node );
     1630
     1631        VISIT(
     1632                maybe_accept( node, &ArrayType::dimension );
     1633                maybe_accept( node, &ArrayType::base );
     1634        )
     1635
     1636        VISIT_END( Type, node );
     1637}
     1638
     1639//--------------------------------------------------------------------------
     1640// ReferenceType
     1641template< typename pass_t >
     1642const ast::Type * ast::Pass< pass_t >::visit( const ast::ReferenceType * node ) {
     1643        VISIT_START( node );
     1644
     1645        VISIT(
     1646                maybe_accept( node, &ReferenceType::base );
     1647        )
     1648
     1649        VISIT_END( Type, node );
     1650}
     1651
     1652//--------------------------------------------------------------------------
     1653// QualifiedType
     1654template< typename pass_t >
     1655const ast::Type * ast::Pass< pass_t >::visit( const ast::QualifiedType * node ) {
     1656        VISIT_START( node );
     1657
     1658        VISIT(
     1659                maybe_accept( node, &QualifiedType::parent );
     1660                maybe_accept( node, &QualifiedType::child );
     1661        )
     1662
     1663        VISIT_END( Type, node );
     1664}
     1665
     1666//--------------------------------------------------------------------------
     1667// FunctionType
     1668template< typename pass_t >
     1669const ast::Type * ast::Pass< pass_t >::visit( const ast::FunctionType * node ) {
     1670        VISIT_START( node );
     1671
     1672        VISIT(
     1673                maybe_accept( node, &FunctionType::forall  );
     1674                maybe_accept( node, &FunctionType::returns );
     1675                maybe_accept( node, &FunctionType::params  );
     1676        )
     1677
     1678        VISIT_END( Type, node );
     1679}
     1680
     1681//--------------------------------------------------------------------------
     1682// StructInstType
     1683template< typename pass_t >
     1684const ast::Type * ast::Pass< pass_t >::visit( const ast::StructInstType * node ) {
     1685        VISIT_START( node );
     1686
     1687        __pass::indexer::addStruct( node->name, 0, pass );
     1688
     1689        VISIT({
     1690                guard_indexer guard { *this };
     1691                maybe_accept( node, &StructInstType::forall );
     1692                maybe_accept( node, &StructInstType::params );
     1693        })
     1694
     1695        VISIT_END( Type, node );
     1696}
     1697
     1698//--------------------------------------------------------------------------
     1699// UnionInstType
     1700template< typename pass_t >
     1701const ast::Type * ast::Pass< pass_t >::visit( const ast::UnionInstType * node ) {
     1702        VISIT_START( node );
     1703
     1704        __pass::indexer::addStruct( node->name, 0, pass );
     1705
     1706        {
     1707                guard_indexer guard { *this };
     1708                maybe_accept( node, &UnionInstType::forall );
     1709                maybe_accept( node, &UnionInstType::params );
     1710        }
     1711
     1712        VISIT_END( Type, node );
     1713}
     1714
     1715//--------------------------------------------------------------------------
     1716// EnumInstType
     1717template< typename pass_t >
     1718const ast::Type * ast::Pass< pass_t >::visit( const ast::EnumInstType * node ) {
     1719        VISIT_START( node );
     1720
     1721        VISIT(
     1722                maybe_accept( node, &EnumInstType::forall );
     1723                maybe_accept( node, &EnumInstType::params );
     1724        )
     1725
     1726        VISIT_END( Type, node );
     1727}
     1728
     1729//--------------------------------------------------------------------------
     1730// TraitInstType
     1731template< typename pass_t >
     1732const ast::Type * ast::Pass< pass_t >::visit( const ast::TraitInstType * node ) {
     1733        VISIT_START( node );
     1734
     1735        VISIT(
     1736                maybe_accept( node, &TraitInstType::forall );
     1737                maybe_accept( node, &TraitInstType::params );
     1738        )
     1739
     1740        VISIT_END( Type, node );
     1741}
     1742
     1743//--------------------------------------------------------------------------
     1744// TypeInstType
     1745template< typename pass_t >
     1746const ast::Type * ast::Pass< pass_t >::visit( const ast::TypeInstType * node ) {
     1747        VISIT_START( node );
     1748
     1749        VISIT(
     1750                maybe_accept( node, &TypeInstType::forall );
     1751                maybe_accept( node, &TypeInstType::params );
     1752        )
     1753
     1754        VISIT_END( Type, node );
     1755}
     1756
     1757//--------------------------------------------------------------------------
     1758// TupleType
     1759template< typename pass_t >
     1760const ast::Type * ast::Pass< pass_t >::visit( const ast::TupleType * node ) {
     1761        VISIT_START( node );
     1762
     1763        VISIT(
     1764                maybe_accept( node, &TupleType::types );
     1765                maybe_accept( node, &TupleType::members );
     1766        )
     1767
     1768        VISIT_END( Type, node );
     1769}
     1770
     1771//--------------------------------------------------------------------------
     1772// TypeofType
     1773template< typename pass_t >
     1774const ast::Type * ast::Pass< pass_t >::visit( const ast::TypeofType * node ) {
     1775        VISIT_START( node );
     1776
     1777        VISIT(
     1778                maybe_accept( node, &TypeofType::expr );
     1779        )
     1780
     1781        VISIT_END( Type, node );
     1782}
     1783
     1784//--------------------------------------------------------------------------
     1785// VarArgsType
     1786template< typename pass_t >
     1787const ast::Type * ast::Pass< pass_t >::visit( const ast::VarArgsType * node ) {
     1788        VISIT_START( node );
     1789
     1790        VISIT_END( Type, node );
     1791}
     1792
     1793//--------------------------------------------------------------------------
     1794// ZeroType
     1795template< typename pass_t >
     1796const ast::Type * ast::Pass< pass_t >::visit( const ast::ZeroType * node ) {
     1797        VISIT_START( node );
     1798
     1799        VISIT_END( Type, node );
     1800}
     1801
     1802//--------------------------------------------------------------------------
     1803// OneType
     1804template< typename pass_t >
     1805const ast::Type * ast::Pass< pass_t >::visit( const ast::OneType * node ) {
     1806        VISIT_START( node );
     1807
     1808        VISIT_END( Type, node );
     1809}
     1810
     1811//--------------------------------------------------------------------------
     1812// GlobalScopeType
     1813template< typename pass_t >
     1814const ast::Type * ast::Pass< pass_t >::visit( const ast::GlobalScopeType * node ) {
     1815        VISIT_START( node );
     1816
     1817        VISIT_END( Type, node );
     1818}
     1819
     1820
     1821//--------------------------------------------------------------------------
     1822// Designation
     1823template< typename pass_t >
     1824const ast::Designation * ast::Pass< pass_t >::visit( const ast::Designation * node ) {
     1825        VISIT_START( node );
     1826
     1827        VISIT( maybe_accept( node, &Designation::designators ); )
     1828
     1829        VISIT_END( Designation, node );
     1830}
    9161831
    9171832//--------------------------------------------------------------------------
     
    9701885}
    9711886
    972 //--------------------------------------------------------------------------
    973 // TypeSubstitution
    974 template< typename pass_t >
    975 const ast::TypeSubstitution * ast::Pass< pass_t >::visit( const ast::TypeSubstitution * node ) {
    976         VISIT_START( node );
    977 
    978         VISIT(
    979                 {
    980                         bool mutated = false;
    981                         std::unordered_map< std::string, ast::ptr< ast::Type > > new_map;
    982                         for ( const auto & p : node->typeEnv ) {
    983                                 guard_indexer guard { *this };
    984                                 auto new_node = p.second->accept( *this );
    985                                 if (new_node != p.second) mutated = false;
    986                                 new_map.insert({ p.first, new_node });
    987                         }
    988                         if (mutated) {
    989                                 auto new_node = mutate( node );
    990                                 new_node->typeEnv.swap( new_map );
    991                                 node = new_node;
    992                         }
    993                 }
    994 
    995                 {
    996                         bool mutated = false;
    997                         std::unordered_map< std::string, ast::ptr< ast::Expr > > new_map;
    998                         for ( const auto & p : node->varEnv ) {
    999                                 guard_indexer guard { *this };
    1000                                 auto new_node = p.second->accept( *this );
    1001                                 if (new_node != p.second) mutated = false;
    1002                                 new_map.insert({ p.first, new_node });
    1003                         }
    1004                         if (mutated) {
    1005                                 auto new_node = mutate( node );
    1006                                 new_node->varEnv.swap( new_map );
    1007                                 node = new_node;
    1008                         }
    1009                 }
    1010         )
    1011 
    1012         VISIT_END( TypeSubstitution, node );
    1013 }
     1887// //--------------------------------------------------------------------------
     1888// // TypeSubstitution
     1889// template< typename pass_t >
     1890// const ast::TypeSubstitution * ast::Pass< pass_t >::visit( const ast::TypeSubstitution * node ) {
     1891//      VISIT_START( node );
     1892
     1893//      VISIT(
     1894//              {
     1895//                      bool mutated = false;
     1896//                      std::unordered_map< std::string, ast::ptr< ast::Type > > new_map;
     1897//                      for ( const auto & p : node->typeEnv ) {
     1898//                              guard_indexer guard { *this };
     1899//                              auto new_node = p.second->accept( *this );
     1900//                              if (new_node != p.second) mutated = false;
     1901//                              new_map.insert({ p.first, new_node });
     1902//                      }
     1903//                      if (mutated) {
     1904//                              auto new_node = mutate( node );
     1905//                              new_node->typeEnv.swap( new_map );
     1906//                              node = new_node;
     1907//                      }
     1908//              }
     1909
     1910//              {
     1911//                      bool mutated = false;
     1912//                      std::unordered_map< std::string, ast::ptr< ast::Expr > > new_map;
     1913//                      for ( const auto & p : node->varEnv ) {
     1914//                              guard_indexer guard { *this };
     1915//                              auto new_node = p.second->accept( *this );
     1916//                              if (new_node != p.second) mutated = false;
     1917//                              new_map.insert({ p.first, new_node });
     1918//                      }
     1919//                      if (mutated) {
     1920//                              auto new_node = mutate( node );
     1921//                              new_node->varEnv.swap( new_map );
     1922//                              node = new_node;
     1923//                      }
     1924//              }
     1925//      )
     1926
     1927//      VISIT_END( TypeSubstitution, node );
     1928// }
    10141929
    10151930#undef VISIT_START
  • src/AST/Stmt.hpp

    r5b35c21 ra1b154d  
    330330public:
    331331        struct Target {
    332                 ptr<Expr> function;
    333                 std::vector<ptr<Expr>> arguments;
     332                ptr<Expr> func;
     333                std::vector<ptr<Expr>> args;
    334334        };
    335335
  • src/AST/Type.cpp

    r5b35c21 ra1b154d  
    141141bool EnumInstType::isComplete() const { return base ? base->body : false; }
    142142
     143// --- TraitInstType
     144
     145TraitInstType::TraitInstType( const TraitDecl * b, CV::Qualifiers q,
     146        std::vector<ptr<Attribute>>&& as )
     147: ReferenceToType( b->name, q, std::move(as) ), base( b ) {}
     148
    143149// --- TypeInstType
    144150
  • src/AST/module.mk

    r5b35c21 ra1b154d  
    1 ######################### -*- Mode: Makefile-Gmake -*-
    2 ########################
     1######################### -*- Mode: Makefile-Gmake -*- ########################
    32##
    43## Cforall Version 1.0.0 Copyright (C) 2019 University of Waterloo
     
    1716
    1817SRC_AST = \
    19      AST/Convert.cpp \
    20      AST/Node.cpp \
    21      AST/TypeSubstitution.cpp
     18        AST/Attribute.cpp \
     19        AST/Convert.cpp \
     20        AST/Decl.cpp \
     21        AST/DeclReplacer.cpp \
     22        AST/Expr.cpp \
     23        AST/Init.cpp \
     24        AST/LinkageSpec.cpp \
     25        AST/Node.cpp \
     26        AST/Stmt.cpp \
     27        AST/Type.cpp \
     28        AST/TypeSubstitution.cpp
    2229
    2330
     
    2532SRC += $(SRC_AST)
    2633SRCDEMANGLE += $(SRC_AST)
    27 
  • src/Common/Eval.cc

    r5b35c21 ra1b154d  
    9090}
    9191
     92std::pair<long long int, bool> eval(const ast::Expr * expr) {
     93        #warning not implemented
     94        return { 0, false };
     95}
     96
    9297// Local Variables: //
    9398// tab-width: 4 //
  • src/Makefile.am

    r5b35c21 ra1b154d  
    3737endif
    3838
     39include AST/module.mk
    3940include CodeGen/module.mk
    4041include CodeTools/module.mk
  • src/Makefile.in

    r5b35c21 ra1b154d  
    1616
    1717######################## -*- Mode: Makefile-Automake -*- ######################
     18###############################################################################
     19
     20######################### -*- Mode: Makefile-Gmake -*- ########################
    1821###############################################################################
    1922
     
    162165libdemangle_a_LIBADD =
    163166am__dirstamp = $(am__leading_dot)dirstamp
    164 am__objects_1 = CodeGen/CodeGenerator.$(OBJEXT) \
     167am__objects_1 = AST/Attribute.$(OBJEXT) AST/Convert.$(OBJEXT) \
     168        AST/Decl.$(OBJEXT) AST/DeclReplacer.$(OBJEXT) \
     169        AST/Expr.$(OBJEXT) AST/Init.$(OBJEXT) \
     170        AST/LinkageSpec.$(OBJEXT) AST/Node.$(OBJEXT) \
     171        AST/Stmt.$(OBJEXT) AST/Type.$(OBJEXT) \
     172        AST/TypeSubstitution.$(OBJEXT)
     173am__objects_2 = CodeGen/CodeGenerator.$(OBJEXT) \
    165174        CodeGen/FixMain.$(OBJEXT) CodeGen/GenType.$(OBJEXT) \
    166175        CodeGen/OperatorTable.$(OBJEXT)
    167 am__objects_2 = Common/Assert.$(OBJEXT) Common/Eval.$(OBJEXT) \
     176am__objects_3 = Common/Assert.$(OBJEXT) Common/Eval.$(OBJEXT) \
    168177        Common/PassVisitor.$(OBJEXT) Common/SemanticError.$(OBJEXT) \
    169178        Common/Stats/Counter.$(OBJEXT) Common/Stats/Heap.$(OBJEXT) \
    170179        Common/Stats/Stats.$(OBJEXT) Common/Stats/Time.$(OBJEXT) \
    171180        Common/UniqueName.$(OBJEXT)
    172 am__objects_3 = ControlStruct/ForExprMutator.$(OBJEXT) \
     181am__objects_4 = ControlStruct/ForExprMutator.$(OBJEXT) \
    173182        ControlStruct/LabelFixer.$(OBJEXT) \
    174183        ControlStruct/LabelGenerator.$(OBJEXT) \
    175184        ControlStruct/MLEMutator.$(OBJEXT) \
    176185        ControlStruct/Mutate.$(OBJEXT)
    177 am__objects_4 = ResolvExpr/AdjustExprType.$(OBJEXT) \
     186am__objects_5 = ResolvExpr/AdjustExprType.$(OBJEXT) \
    178187        ResolvExpr/Alternative.$(OBJEXT) \
    179188        ResolvExpr/AlternativeFinder.$(OBJEXT) \
     
    193202        ResolvExpr/TypeEnvironment.$(OBJEXT) \
    194203        ResolvExpr/Unify.$(OBJEXT)
    195 am__objects_5 = SymTab/Autogen.$(OBJEXT) SymTab/FixFunction.$(OBJEXT) \
     204am__objects_6 = SymTab/Autogen.$(OBJEXT) SymTab/FixFunction.$(OBJEXT) \
    196205        SymTab/Indexer.$(OBJEXT) SymTab/Mangler.$(OBJEXT) \
    197206        SymTab/ManglerCommon.$(OBJEXT) SymTab/Validate.$(OBJEXT)
    198 am__objects_6 = SynTree/Type.$(OBJEXT) SynTree/VoidType.$(OBJEXT) \
     207am__objects_7 = SynTree/Type.$(OBJEXT) SynTree/VoidType.$(OBJEXT) \
    199208        SynTree/BasicType.$(OBJEXT) SynTree/PointerType.$(OBJEXT) \
    200209        SynTree/ArrayType.$(OBJEXT) SynTree/ReferenceType.$(OBJEXT) \
     
    216225        SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \
    217226        SynTree/DeclReplacer.$(OBJEXT)
    218 am__objects_7 = CompilationState.$(OBJEXT) $(am__objects_1) \
    219         Concurrency/Keywords.$(OBJEXT) $(am__objects_2) \
    220         $(am__objects_3) GenPoly/GenPoly.$(OBJEXT) \
     227am__objects_8 = CompilationState.$(OBJEXT) $(am__objects_1) \
     228        $(am__objects_2) Concurrency/Keywords.$(OBJEXT) \
     229        $(am__objects_3) $(am__objects_4) GenPoly/GenPoly.$(OBJEXT) \
    221230        GenPoly/Lvalue.$(OBJEXT) InitTweak/GenInit.$(OBJEXT) \
    222231        InitTweak/InitTweak.$(OBJEXT) Parser/LinkageSpec.$(OBJEXT) \
    223         $(am__objects_4) $(am__objects_5) SymTab/Demangle.$(OBJEXT) \
    224         $(am__objects_6) Tuples/TupleAssignment.$(OBJEXT) \
     232        $(am__objects_5) $(am__objects_6) SymTab/Demangle.$(OBJEXT) \
     233        $(am__objects_7) Tuples/TupleAssignment.$(OBJEXT) \
    225234        Tuples/TupleExpansion.$(OBJEXT) Tuples/Explode.$(OBJEXT) \
    226235        Validate/HandleAttributes.$(OBJEXT)
    227 am_libdemangle_a_OBJECTS = $(am__objects_7)
     236am_libdemangle_a_OBJECTS = $(am__objects_8)
    228237libdemangle_a_OBJECTS = $(am_libdemangle_a_OBJECTS)
    229238am__installdirs = "$(DESTDIR)$(cfa_cpplibdir)"
    230239PROGRAMS = $(cfa_cpplib_PROGRAMS)
    231 am__objects_8 = main.$(OBJEXT) MakeLibCfa.$(OBJEXT) \
    232         CompilationState.$(OBJEXT) $(am__objects_1) \
     240am__objects_9 = main.$(OBJEXT) MakeLibCfa.$(OBJEXT) \
     241        CompilationState.$(OBJEXT) $(am__objects_1) $(am__objects_2) \
    233242        CodeGen/Generate.$(OBJEXT) CodeGen/FixNames.$(OBJEXT) \
    234243        CodeTools/DeclStats.$(OBJEXT) \
    235244        CodeTools/ResolvProtoDump.$(OBJEXT) \
    236245        CodeTools/TrackLoc.$(OBJEXT) Concurrency/Keywords.$(OBJEXT) \
    237         Concurrency/Waitfor.$(OBJEXT) $(am__objects_2) \
    238         Common/DebugMalloc.$(OBJEXT) $(am__objects_3) \
     246        Concurrency/Waitfor.$(OBJEXT) $(am__objects_3) \
     247        Common/DebugMalloc.$(OBJEXT) $(am__objects_4) \
    239248        ControlStruct/ExceptTranslate.$(OBJEXT) GenPoly/Box.$(OBJEXT) \
    240249        GenPoly/GenPoly.$(OBJEXT) GenPoly/ScrubTyVars.$(OBJEXT) \
     
    250259        Parser/InitializerNode.$(OBJEXT) Parser/TypeData.$(OBJEXT) \
    251260        Parser/LinkageSpec.$(OBJEXT) Parser/parserutility.$(OBJEXT) \
    252         $(am__objects_4) ResolvExpr/AlternativePrinter.$(OBJEXT) \
    253         $(am__objects_5) $(am__objects_6) \
     261        $(am__objects_5) ResolvExpr/AlternativePrinter.$(OBJEXT) \
     262        $(am__objects_6) $(am__objects_7) \
    254263        Tuples/TupleAssignment.$(OBJEXT) \
    255264        Tuples/TupleExpansion.$(OBJEXT) Tuples/Explode.$(OBJEXT) \
    256265        Validate/HandleAttributes.$(OBJEXT) \
    257266        Virtual/ExpandCasts.$(OBJEXT)
    258 am____driver_cfa_cpp_OBJECTS = $(am__objects_8)
     267am____driver_cfa_cpp_OBJECTS = $(am__objects_9)
    259268___driver_cfa_cpp_OBJECTS = $(am____driver_cfa_cpp_OBJECTS)
    260269am__DEPENDENCIES_1 =
     
    366375ETAGS = etags
    367376CTAGS = ctags
    368 am__DIST_COMMON = $(srcdir)/CodeGen/module.mk \
     377am__DIST_COMMON = $(srcdir)/AST/module.mk $(srcdir)/CodeGen/module.mk \
    369378        $(srcdir)/CodeTools/module.mk $(srcdir)/Common/module.mk \
    370379        $(srcdir)/Concurrency/module.mk \
     
    526535AUTOMAKE_OPTIONS = foreign subdir-objects
    527536ACLOCAL_AMFLAGS = -I automake
    528 SRC = main.cc MakeLibCfa.cc CompilationState.cc $(SRC_CODEGEN) \
    529         CodeGen/Generate.cc CodeGen/FixNames.cc CodeTools/DeclStats.cc \
    530         CodeTools/ResolvProtoDump.cc CodeTools/TrackLoc.cc \
    531         Concurrency/Keywords.cc Concurrency/Waitfor.cc $(SRC_COMMON) \
    532         Common/DebugMalloc.cc $(SRC_CONTROLSTRUCT) \
    533         ControlStruct/ExceptTranslate.cc GenPoly/Box.cc \
    534         GenPoly/GenPoly.cc GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc \
    535         GenPoly/Specialize.cc GenPoly/FindFunction.cc \
    536         GenPoly/InstantiateGeneric.cc InitTweak/GenInit.cc \
    537         InitTweak/FixInit.cc InitTweak/FixGlobalInit.cc \
    538         InitTweak/InitTweak.cc Parser/parser.yy Parser/lex.ll \
    539         Parser/TypedefTable.cc Parser/ParseNode.cc \
    540         Parser/DeclarationNode.cc Parser/ExpressionNode.cc \
    541         Parser/StatementNode.cc Parser/InitializerNode.cc \
    542         Parser/TypeData.cc Parser/LinkageSpec.cc \
    543         Parser/parserutility.cc $(SRC_RESOLVEXPR) \
    544         ResolvExpr/AlternativePrinter.cc $(SRC_SYMTAB) $(SRC_SYNTREE) \
    545         Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \
    546         Tuples/Explode.cc Validate/HandleAttributes.cc \
    547         Virtual/ExpandCasts.cc
    548 SRCDEMANGLE = CompilationState.cc $(SRC_CODEGEN) \
     537SRC = main.cc MakeLibCfa.cc CompilationState.cc $(SRC_AST) \
     538        $(SRC_CODEGEN) CodeGen/Generate.cc CodeGen/FixNames.cc \
     539        CodeTools/DeclStats.cc CodeTools/ResolvProtoDump.cc \
     540        CodeTools/TrackLoc.cc Concurrency/Keywords.cc \
     541        Concurrency/Waitfor.cc $(SRC_COMMON) Common/DebugMalloc.cc \
     542        $(SRC_CONTROLSTRUCT) ControlStruct/ExceptTranslate.cc \
     543        GenPoly/Box.cc GenPoly/GenPoly.cc GenPoly/ScrubTyVars.cc \
     544        GenPoly/Lvalue.cc GenPoly/Specialize.cc \
     545        GenPoly/FindFunction.cc GenPoly/InstantiateGeneric.cc \
     546        InitTweak/GenInit.cc InitTweak/FixInit.cc \
     547        InitTweak/FixGlobalInit.cc InitTweak/InitTweak.cc \
     548        Parser/parser.yy Parser/lex.ll Parser/TypedefTable.cc \
     549        Parser/ParseNode.cc Parser/DeclarationNode.cc \
     550        Parser/ExpressionNode.cc Parser/StatementNode.cc \
     551        Parser/InitializerNode.cc Parser/TypeData.cc \
     552        Parser/LinkageSpec.cc Parser/parserutility.cc \
     553        $(SRC_RESOLVEXPR) ResolvExpr/AlternativePrinter.cc \
     554        $(SRC_SYMTAB) $(SRC_SYNTREE) Tuples/TupleAssignment.cc \
     555        Tuples/TupleExpansion.cc Tuples/Explode.cc \
     556        Validate/HandleAttributes.cc Virtual/ExpandCasts.cc
     557SRCDEMANGLE = CompilationState.cc $(SRC_AST) $(SRC_CODEGEN) \
    549558        Concurrency/Keywords.cc $(SRC_COMMON) $(SRC_CONTROLSTRUCT) \
    550559        GenPoly/GenPoly.cc GenPoly/Lvalue.cc InitTweak/GenInit.cc \
     
    559568@WITH_LIBTCMALLOC_TRUE@LIBTCMALLOC = -ltcmalloc
    560569@WITH_LIBTCMALLOC_TRUE@TCMALLOCFLAG = -DTCMALLOC
     570SRC_AST = \
     571        AST/Attribute.cpp \
     572        AST/Convert.cpp \
     573        AST/Decl.cpp \
     574        AST/DeclReplacer.cpp \
     575        AST/Expr.cpp \
     576        AST/Init.cpp \
     577        AST/LinkageSpec.cpp \
     578        AST/Node.cpp \
     579        AST/Stmt.cpp \
     580        AST/Type.cpp \
     581        AST/TypeSubstitution.cpp
     582
    561583SRC_CODEGEN = \
    562584        CodeGen/CodeGenerator.cc \
     
    667689
    668690.SUFFIXES:
    669 .SUFFIXES: .cc .ll .lo .o .obj .yy
    670 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__configure_deps)
     691.SUFFIXES: .cc .cpp .ll .lo .o .obj .yy
     692$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/AST/module.mk $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__configure_deps)
    671693        @for dep in $?; do \
    672694          case '$(am__configure_deps)' in \
     
    688710            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
    689711        esac;
    690 $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__empty):
     712$(srcdir)/AST/module.mk $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__empty):
    691713
    692714$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
     
    701723clean-noinstLIBRARIES:
    702724        -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
     725AST/$(am__dirstamp):
     726        @$(MKDIR_P) AST
     727        @: > AST/$(am__dirstamp)
     728AST/$(DEPDIR)/$(am__dirstamp):
     729        @$(MKDIR_P) AST/$(DEPDIR)
     730        @: > AST/$(DEPDIR)/$(am__dirstamp)
     731AST/Attribute.$(OBJEXT): AST/$(am__dirstamp) \
     732        AST/$(DEPDIR)/$(am__dirstamp)
     733AST/Convert.$(OBJEXT): AST/$(am__dirstamp) \
     734        AST/$(DEPDIR)/$(am__dirstamp)
     735AST/Decl.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp)
     736AST/DeclReplacer.$(OBJEXT): AST/$(am__dirstamp) \
     737        AST/$(DEPDIR)/$(am__dirstamp)
     738AST/Expr.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp)
     739AST/Init.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp)
     740AST/LinkageSpec.$(OBJEXT): AST/$(am__dirstamp) \
     741        AST/$(DEPDIR)/$(am__dirstamp)
     742AST/Node.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp)
     743AST/Stmt.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp)
     744AST/Type.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp)
     745AST/TypeSubstitution.$(OBJEXT): AST/$(am__dirstamp) \
     746        AST/$(DEPDIR)/$(am__dirstamp)
    703747CodeGen/$(am__dirstamp):
    704748        @$(MKDIR_P) CodeGen
     
    10971141mostlyclean-compile:
    10981142        -rm -f *.$(OBJEXT)
     1143        -rm -f AST/*.$(OBJEXT)
    10991144        -rm -f CodeGen/*.$(OBJEXT)
    11001145        -rm -f CodeTools/*.$(OBJEXT)
     
    11191164@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MakeLibCfa.Po@am__quote@
    11201165@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
     1166@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Attribute.Po@am__quote@
     1167@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Convert.Po@am__quote@
     1168@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Decl.Po@am__quote@
     1169@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/DeclReplacer.Po@am__quote@
     1170@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Expr.Po@am__quote@
     1171@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Init.Po@am__quote@
     1172@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/LinkageSpec.Po@am__quote@
     1173@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Node.Po@am__quote@
     1174@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Stmt.Po@am__quote@
     1175@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Type.Po@am__quote@
     1176@AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/TypeSubstitution.Po@am__quote@
    11211177@AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/CodeGenerator.Po@am__quote@
    11221178@AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/FixMain.Po@am__quote@
     
    12611317@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
    12621318
     1319.cpp.o:
     1320@am__fastdepCXX_TRUE@   $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
     1321@am__fastdepCXX_TRUE@   $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
     1322@am__fastdepCXX_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
     1323@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
     1324@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1325@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
     1326
     1327.cpp.obj:
     1328@am__fastdepCXX_TRUE@   $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
     1329@am__fastdepCXX_TRUE@   $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
     1330@am__fastdepCXX_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
     1331@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
     1332@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1333@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
     1334
     1335.cpp.lo:
     1336@am__fastdepCXX_TRUE@   $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
     1337@am__fastdepCXX_TRUE@   $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
     1338@am__fastdepCXX_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
     1339@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
     1340@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1341@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
     1342
    12631343.ll.cc:
    12641344        $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)
     
    13931473        -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
    13941474        -rm -f ../driver/$(am__dirstamp)
     1475        -rm -f AST/$(DEPDIR)/$(am__dirstamp)
     1476        -rm -f AST/$(am__dirstamp)
    13951477        -rm -f CodeGen/$(DEPDIR)/$(am__dirstamp)
    13961478        -rm -f CodeGen/$(am__dirstamp)
     
    14381520
    14391521distclean: distclean-am
    1440         -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Common/Stats/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)
     1522        -rm -rf ./$(DEPDIR) AST/$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Common/Stats/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)
    14411523        -rm -f Makefile
    14421524distclean-am: clean-am distclean-compile distclean-generic \
     
    14841566
    14851567maintainer-clean: maintainer-clean-am
    1486         -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Common/Stats/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)
     1568        -rm -rf ./$(DEPDIR) AST/$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Common/Stats/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)
    14871569        -rm -f Makefile
    14881570maintainer-clean-am: distclean-am maintainer-clean-generic
  • src/Tuples/TupleExpansion.cc

    r5b35c21 ra1b154d  
    353353        }
    354354
     355        const ast::TypeInstType * isTtype( const ast::Type * type ) {
     356                #warning unimplemented
     357                return nullptr;
     358        }
     359
    355360        namespace {
    356361                /// determines if impurity (read: side-effects) may exist in a piece of code. Currently gives a very crude approximation, wherein any function call expression means the code may be impure
  • src/include/cassert

    r5b35c21 ra1b154d  
    1919
    2020#include_next <cassert>
     21
     22#include <string>
     23
     24template < typename ... Params >
     25std::string toString( const Params & ... params );
    2126
    2227#ifdef NDEBUG
  • src/main.cc

    r5b35c21 ra1b154d  
    4040#include "Common/Stats.h"
    4141#include "Common/PassVisitor.h"
    42 // #include "AST/Pass.hpp"
    4342#include "Common/SemanticError.h"           // for SemanticError
    4443#include "Common/UnimplementedError.h"      // for UnimplementedError
Note: See TracChangeset for help on using the changeset viewer.