Changes in / [a1b154d:5b35c21]


Ignore:
Location:
src
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    ra1b154d r5b35c21  
    1010// Created On       : Thu May 09 15::37::05 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tue May 21 15:30:00 2019
    13 // Update Count     : 5
     12// Last Modified On : Fri May 17 16:01:00 2019
     13// Update Count     : 4
    1414//
    1515
    1616#include "Convert.hpp"
    17 
    18 #include <unordered_map>
    1917
    2018#include "AST/Attribute.hpp"
     
    4442class ConverterNewToOld : public ast::Visitor {
    4543        BaseSyntaxNode * node = nullptr;
    46         std::unordered_map< ast::Node *, BaseSyntaxNode * > cache;
    4744
    4845        template<typename T>
     
    5047                ConverterNewToOld & visitor;
    5148
    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;
     49                template<typename U>
     50                T * accept1( const ast::ptr<U> & ptr ) {
    5551                        ptr->accept( visitor );
    5652                        T * ret = strict_dynamic_cast< T * >( visitor.node );
     
    9187        }
    9288
    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 
    10789public:
    10890        Declaration * decl( const ast::Decl * declNode ) {
     
    11193
    11294private:
    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 
    13595        const ast::DeclWithType * visit( const ast::ObjectDecl * node ) override final {
    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 );
     96                (void)node;
     97                return nullptr;
    14798        }
    14899
    149100        const ast::DeclWithType * visit( const ast::FunctionDecl * node ) override final {
    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 );
     101                (void)node;
     102                return nullptr;
     103        }
     104
     105        const ast::Decl * visit( const ast::StructDecl * node ) override final {
     106                (void)node;
     107                return nullptr;
     108        }
     109
     110        const ast::Decl * visit( const ast::UnionDecl * node ) override final {
     111                (void)node;
     112                return nullptr;
     113        }
     114
     115        const ast::Decl * visit( const ast::EnumDecl * node ) override final {
     116                (void)node;
     117                return nullptr;
     118        }
     119
     120        const ast::Decl * visit( const ast::TraitDecl * node ) override final {
     121                (void)node;
    169122                return nullptr;
    170123        }
    171124
    172125        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 );
     126                (void)node;
     127                return nullptr;
    196128        }
    197129
    198130        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;
    215                 return nullptr;
    216         }
    217 
    218         const ast::Decl * visit( const ast::StructDecl * node ) override final {
    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 );
    226         }
    227 
    228         const ast::Decl * visit( const ast::UnionDecl * node ) override final {
    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 );
    235         }
    236 
    237         const ast::Decl * visit( const ast::EnumDecl * node ) override final {
    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 );
    244         }
    245 
    246         const ast::Decl * visit( const ast::TraitDecl * node ) override final {
    247                 auto decl = new TraitDecl(
    248                         node->name,
    249                         {},
    250                         LinkageSpec::Spec( node->linkage.val )
    251                 );
    252                 return aggregatePostamble( decl, node );
     131                (void)node;
     132                return nullptr;
    253133        }
    254134
    255135        const ast::AsmDecl * visit( const ast::AsmDecl * node ) override final {
    256                 auto decl = new AsmDecl( get<AsmStmt>().accept1( node->stmt ) );
    257                 declPostamble( decl, node );
     136                (void)node;
    258137                return nullptr;
    259138        }
    260139
    261140        const ast::StaticAssertDecl * visit( const ast::StaticAssertDecl * node ) override final {
    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 ) {
    271                 stmt->location = node->location;
    272                 stmt->labels = makeLabelL( stmt, node->labels );
    273                 this->node = stmt;
     141                (void)node;
    274142                return nullptr;
    275143        }
     
    277145        const ast::CompoundStmt * visit( const ast::CompoundStmt * node ) override final {
    278146                auto stmt = new CompoundStmt( get<Statement>().acceptL( node->kids ) );
    279                 stmtPostamble( stmt, node );
     147                stmt->location = node->location;
     148                stmt->labels = makeLabelL( stmt, node->labels );
     149                this->node = stmt;
    280150                return nullptr;
    281151        }
     
    283153        const ast::Stmt * visit( const ast::ExprStmt * node ) override final {
    284154                auto stmt = new ExprStmt( get<Expression>().accept1( node->expr ) );
    285                 return stmtPostamble( stmt, node );
     155                stmt->location = node->location;
     156                stmt->labels = makeLabelL( stmt, node->labels );
     157                this->node = stmt;
     158                return nullptr;
    286159        }
    287160
     
    295168                        makeLabelL( nullptr, node->gotoLabels ) // What are these labelling?
    296169                );
    297                 return stmtPostamble( stmt, node );
     170                stmt->location = node->location;
     171                stmt->labels = makeLabelL( stmt, node->labels );
     172                this->node = stmt;
     173                return nullptr;
    298174        }
    299175
    300176        const ast::Stmt * visit( const ast::DirectiveStmt * node ) override final {
    301177                auto stmt = new DirectiveStmt( node->directive );
    302                 return stmtPostamble( stmt, node );
     178                stmt->location = node->location;
     179                stmt->labels = makeLabelL( stmt, node->labels );
     180                this->node = stmt;
     181                return nullptr;
    303182        }
    304183
     
    310189                        get<Statement>().acceptL( node->inits )
    311190                );
    312                 return stmtPostamble( stmt, node );
     191                stmt->location = node->location;
     192                stmt->labels = makeLabelL( stmt, node->labels );
     193                this->node = stmt;
     194                return nullptr;
    313195        }
    314196
     
    318200                        get<Statement>().acceptL( node->stmts )
    319201                );
    320                 return stmtPostamble( stmt, node );
     202                stmt->location = node->location;
     203                stmt->labels = makeLabelL( stmt, node->labels );
     204                this->node = stmt;
     205                return nullptr;
    321206        }
    322207
     
    327212                        node->isDefault()
    328213                );
    329                 return stmtPostamble( stmt, node );
     214                stmt->location = node->location;
     215                stmt->labels = makeLabelL( stmt, node->labels );
     216                this->node = stmt;
     217                return nullptr;
    330218        }
    331219
     
    338226                        node->isDoWhile
    339227                );
    340                 return stmtPostamble( stmt, node );
     228                stmt->location = node->location;
     229                stmt->labels = makeLabelL( stmt, node->labels );
     230                this->node = stmt;
     231                return nullptr;
    341232        }
    342233
     
    348239                        get<Statement>().accept1( node->body )
    349240                );
    350                 return stmtPostamble( stmt, node );
     241                stmt->location = node->location;
     242                stmt->labels = makeLabelL( stmt, node->labels );
     243                this->node = stmt;
     244                return nullptr;
    351245        }
    352246
     
    377271                        stmt->target = makeLabel( stmt, node->target );
    378272                }
    379                 return stmtPostamble( stmt, node );
     273                stmt->location = node->location;
     274                stmt->labels = makeLabelL( stmt, node->labels );
     275                this->node = stmt;
     276                return nullptr;
    380277        }
    381278
    382279        const ast::Stmt * visit( const ast::ReturnStmt * node ) override final {
    383280                auto stmt = new ReturnStmt( get<Expression>().accept1( node->expr ) );
    384                 return stmtPostamble( stmt, node );
     281                stmt->location = node->location;
     282                stmt->labels = makeLabelL( stmt, node->labels );
     283                this->node = stmt;
     284                return nullptr;
    385285        }
    386286
     
    402302                        get<Expression>().accept1( node->target )
    403303                );
    404                 return stmtPostamble( stmt, node );
     304                stmt->location = node->location;
     305                stmt->labels = makeLabelL( stmt, node->labels );
     306                this->node = stmt;
     307                return nullptr;
    405308        }
    406309
     
    412315                        get<FinallyStmt>().accept1( node->finally )
    413316                );
    414                 return stmtPostamble( stmt, node );
     317                stmt->location = node->location;
     318                stmt->labels = makeLabelL( stmt, node->labels );
     319                this->node = stmt;
     320                return nullptr;
    415321        }
    416322
     
    433339                        get<Statement>().accept1( node->body )
    434340                );
    435                 return stmtPostamble( stmt, node );
     341                stmt->location = node->location;
     342                stmt->labels = makeLabelL( stmt, node->labels );
     343                this->node = stmt;
     344                return nullptr;
    436345        }
    437346
    438347        const ast::Stmt * visit( const ast::FinallyStmt * node ) override final {
    439348                auto stmt = new FinallyStmt( get<CompoundStmt>().accept1( node->body ) );
    440                 return stmtPostamble( stmt, node );
     349                stmt->location = node->location;
     350                stmt->labels = makeLabelL( stmt, node->labels );
     351                this->node = stmt;
     352                return nullptr;
    441353        }
    442354
     
    446358                for ( auto clause : node->clauses ) {
    447359                        stmt->clauses.push_back({{
    448                                         get<Expression>().accept1( clause.target.func ),
    449                                         get<Expression>().acceptL( clause.target.args ),
     360                                        get<Expression>().accept1( clause.target.function ),
     361                                        get<Expression>().acceptL( clause.target.arguments ),
    450362                                },
    451363                                get<Statement>().accept1( clause.stmt ),
     
    462374                        get<Expression>().accept1( node->orElse.cond ),
    463375                };
    464                 return stmtPostamble( stmt, node );
     376                stmt->location = node->location;
     377                stmt->labels = makeLabelL( stmt, node->labels );
     378                this->node = stmt;
     379                return nullptr;
    465380        }
    466381
     
    470385                        get<Statement>().accept1( node->stmt )
    471386                );
    472                 return stmtPostamble( stmt, node );
     387                stmt->location = node->location;
     388                stmt->labels = makeLabelL( stmt, node->labels );
     389                this->node = stmt;
     390                return nullptr;
    473391        }
    474392
    475393        const ast::NullStmt * visit( const ast::NullStmt * node ) override final {
    476394                auto stmt = new NullStmt();
    477                 stmtPostamble( stmt, node );
     395                stmt->location = node->location;
     396                stmt->labels = makeLabelL( stmt, node->labels );
     397                this->node = stmt;
    478398                return nullptr;
    479399        }
     
    481401        const ast::Stmt * visit( const ast::DeclStmt * node ) override final {
    482402                auto stmt = new DeclStmt( get<Declaration>().accept1( node->decl ) );
    483                 return stmtPostamble( stmt, node );
     403                stmt->location = node->location;
     404                stmt->labels = makeLabelL( stmt, node->labels );
     405                this->node = stmt;
     406                return nullptr;
    484407        }
    485408
     
    747670
    748671        const ast::Type * visit( const ast::VoidType * node ) override final {
    749                 this->node = new VoidType{ cv( node ) };
     672                (void)node;
    750673                return nullptr;
    751674        }
    752675
    753676        const ast::Type * visit( const ast::BasicType * node ) override final {
    754                 this->node = new BasicType{ cv( node ), (BasicType::Kind)(unsigned)node->kind };
     677                (void)node;
    755678                return nullptr;
    756679        }
    757680
    758681        const ast::Type * visit( const ast::PointerType * node ) override final {
    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                 };
     682                (void)node;
    766683                return nullptr;
    767684        }
    768685
    769686        const ast::Type * visit( const ast::ArrayType * node ) override final {
    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                 };
     687                (void)node;
    777688                return nullptr;
    778689        }
    779690
    780691        const ast::Type * visit( const ast::ReferenceType * node ) override final {
    781                 this->node = new ReferenceType{
    782                         cv( node ),
    783                         get<Type>().accept1( node->base )
    784                 };
     692                (void)node;
    785693                return nullptr;
    786694        }
    787695
    788696        const ast::Type * visit( const ast::QualifiedType * node ) override final {
    789                 this->node = new QualifiedType{
    790                         cv( node ),
    791                         get<Type>().accept1( node->parent ),
    792                         get<Type>().accept1( node->child )
    793                 };
     697                (void)node;
    794698                return nullptr;
    795699        }
    796700
    797701        const ast::Type * visit( const ast::FunctionType * node ) override final {
    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;
     702                (void)node;
    803703                return nullptr;
    804704        }
     
    908808        }
    909809private:
    910         /// conversion output
    911810        ast::Node * node;
    912         /// cache of nodes that might be referenced by readonly<> for de-duplication
    913         std::unordered_map< BaseSyntaxNode *, ast::Node * > cache;
    914811
    915812        // Local Utilities:
     
    917814        template<typename NewT, typename OldT>
    918815        NewT * getAccept1( OldT old ) {
    919                 if ( ! old ) return nullptr;
    920816                old->accept(*this);
    921817                return strict_dynamic_cast< NewT * >( node );
     
    958854#       define GET_LABELS_V(labels) \
    959855                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         }
    970856
    971857        // Now all the visit functions:
     
    13741260        }
    13751261
    1376         void convertInferUnion(ast::Expr::InferUnion               &newInferred,
     1262        void convertInferUnion(ast::Expr::InferUnion               &newInferred, 
    13771263                                                   const std::map<UniqueId,ParamEntry> &oldInferParams,
    13781264                                                   const std::vector<UniqueId>         &oldResnSlots) {
     
    15811467        }
    15821468
    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;
     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
    17021515        }
    17031516
  • src/AST/Decl.cpp

    ra1b154d r5b35c21  
    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

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

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

    ra1b154d r5b35c21  
    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

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

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

    ra1b154d r5b35c21  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ast::Pass.impl.hpp --
     7// Pass.impl.hpp --
    88//
    99// Author           : Thierry Delisle
     
    121121        template< typename pass_t >
    122122        template< typename node_t >
    123         auto ast::Pass< pass_t >::call_accept( const node_t * node )
     123        auto 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 * ast::Pass< pass_t >::call_accept( const ast::Expr * expr ) {
     141        const ast::Expr * 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 * ast::Pass< pass_t >::call_accept( const ast::Stmt * stmt ) {
     154        const ast::Stmt * 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> > ast::Pass< pass_t >::call_accept( const container_t< ptr<Stmt> > & statements ) {
     206        container_t< ptr<Stmt> > 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> > ast::Pass< pass_t >::call_accept( const container_t< ast::ptr<node_t> > & container ) {
     272        container_t< ast::ptr<node_t> > 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 ast::Pass< pass_t >::maybe_accept(
     303        void 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         VISIT( maybe_accept( node, &TypedefDecl::assertions ); )
     573        maybe_accept( node, &TypedefDecl::assertions );
    574574
    575575        VISIT_END( Decl, node );
     
    596596
    597597        VISIT(
    598                 maybe_accept( node, &StaticAssertDecl::cond );
    599                 maybe_accept( node, &StaticAssertDecl::msg  );
     598                maybe_accept( node, &StaticAssertDecl::condition );
     599                maybe_accept( node, &StaticAssertDecl::msg       );
    600600        )
    601601
     
    626626// ExprStmt
    627627template< typename pass_t >
    628 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ExprStmt * node ) {
     628const ast::Stmt * ast::Pass< pass_t >::visit( const ExprStmt * node ) {
    629629        VISIT_START( node );
    630630
     
    666666const ast::Stmt * ast::Pass< pass_t >::visit( const ast::IfStmt * node ) {
    667667        VISIT_START( node );
    668 
    669668        VISIT({
    670669                // if statements introduce a level of scope (for the initialization)
     
    675674                maybe_accept( node, &IfStmt::elsePart );
    676675        })
    677 
    678676        VISIT_END( Stmt, node );
    679677}
     
    682680// WhileStmt
    683681template< typename pass_t >
    684 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::WhileStmt * node ) {
     682const ast::Stmt * ast::Pass< pass_t >::visit( const WhileStmt * node ) {
    685683        VISIT_START( node );
    686684
     
    835833                // }
    836834
    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         })
    869 
    870835        #define maybe_accept(field) \
    871836                if(node->field) { \
     
    945910}
    946911
    947 //--------------------------------------------------------------------------
    948 // ApplicationExpr
    949 template< typename pass_t >
    950 const 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
    967 template< typename pass_t >
    968 const 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
    985 template< typename pass_t >
    986 const 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
    999 template< typename pass_t >
    1000 const 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
    1015 template< typename pass_t >
    1016 const 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
    1031 template< typename pass_t >
    1032 const 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
    1047 template< typename pass_t >
    1048 const 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
    1063 template< typename pass_t >
    1064 const 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
    1077 template< typename pass_t >
    1078 const 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
    1094 template< typename pass_t >
    1095 const 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
    1110 template< typename pass_t >
    1111 const 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
    1124 template< typename pass_t >
    1125 const 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
    1138 template< typename pass_t >
    1139 const 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
    1158 template< typename pass_t >
    1159 const 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
    1178 template< typename pass_t >
    1179 const 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
    1194 template< typename pass_t >
    1195 const 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
    1210 template< typename pass_t >
    1211 const 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
    1226 template< typename pass_t >
    1227 const 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
    1243 template< typename pass_t >
    1244 const 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
    1261 template< typename pass_t >
    1262 const 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
    1278 template< typename pass_t >
    1279 const 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
    1294 template< typename pass_t >
    1295 const 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
    1312 template< typename pass_t >
    1313 const 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
    1331 template< typename pass_t >
    1332 const 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
    1347 template< typename pass_t >
    1348 const 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
    1363 template< typename pass_t >
    1364 const 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
    1380 template< typename pass_t >
    1381 const 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
    1396 template< typename pass_t >
    1397 const 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
    1412 template< typename pass_t >
    1413 const 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
    1428 template< typename pass_t >
    1429 const 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
    1444 template< typename pass_t >
    1445 const 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
    1472 template< typename pass_t >
    1473 const 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
    1488 template< typename pass_t >
    1489 const 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
    1505 template< typename pass_t >
    1506 const 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
    1522 template< typename pass_t >
    1523 const 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
    1539 template< typename pass_t >
    1540 const 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
    1555 template< typename pass_t >
    1556 const 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
    1595 template< typename pass_t >
    1596 const 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
    1604 template< typename pass_t >
    1605 const 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
    1613 template< typename pass_t >
    1614 const 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
    1627 template< typename pass_t >
    1628 const 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
    1641 template< typename pass_t >
    1642 const 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
    1654 template< typename pass_t >
    1655 const 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
    1668 template< typename pass_t >
    1669 const 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
    1683 template< typename pass_t >
    1684 const 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
    1700 template< typename pass_t >
    1701 const 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
    1717 template< typename pass_t >
    1718 const 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
    1731 template< typename pass_t >
    1732 const 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
    1745 template< typename pass_t >
    1746 const 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
    1759 template< typename pass_t >
    1760 const 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
    1773 template< typename pass_t >
    1774 const 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
    1786 template< typename pass_t >
    1787 const 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
    1795 template< typename pass_t >
    1796 const 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
    1804 template< typename pass_t >
    1805 const 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
    1813 template< typename pass_t >
    1814 const 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
    1823 template< typename pass_t >
    1824 const 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 }
     912
     913
     914
     915
    1831916
    1832917//--------------------------------------------------------------------------
     
    1885970}
    1886971
    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 // }
     972//--------------------------------------------------------------------------
     973// TypeSubstitution
     974template< typename pass_t >
     975const 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}
    19291014
    19301015#undef VISIT_START
  • src/AST/Stmt.hpp

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

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

    ra1b154d r5b35c21  
    1 ######################### -*- Mode: Makefile-Gmake -*- ########################
     1######################### -*- Mode: Makefile-Gmake -*-
     2########################
    23##
    34## Cforall Version 1.0.0 Copyright (C) 2019 University of Waterloo
     
    1617
    1718SRC_AST = \
    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
     19     AST/Convert.cpp \
     20     AST/Node.cpp \
     21     AST/TypeSubstitution.cpp
    2922
    3023
     
    3225SRC += $(SRC_AST)
    3326SRCDEMANGLE += $(SRC_AST)
     27
  • src/Common/Eval.cc

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

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

    ra1b154d r5b35c21  
    1616
    1717######################## -*- Mode: Makefile-Automake -*- ######################
    18 ###############################################################################
    19 
    20 ######################### -*- Mode: Makefile-Gmake -*- ########################
    2118###############################################################################
    2219
     
    165162libdemangle_a_LIBADD =
    166163am__dirstamp = $(am__leading_dot)dirstamp
    167 am__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)
    173 am__objects_2 = CodeGen/CodeGenerator.$(OBJEXT) \
     164am__objects_1 = CodeGen/CodeGenerator.$(OBJEXT) \
    174165        CodeGen/FixMain.$(OBJEXT) CodeGen/GenType.$(OBJEXT) \
    175166        CodeGen/OperatorTable.$(OBJEXT)
    176 am__objects_3 = Common/Assert.$(OBJEXT) Common/Eval.$(OBJEXT) \
     167am__objects_2 = Common/Assert.$(OBJEXT) Common/Eval.$(OBJEXT) \
    177168        Common/PassVisitor.$(OBJEXT) Common/SemanticError.$(OBJEXT) \
    178169        Common/Stats/Counter.$(OBJEXT) Common/Stats/Heap.$(OBJEXT) \
    179170        Common/Stats/Stats.$(OBJEXT) Common/Stats/Time.$(OBJEXT) \
    180171        Common/UniqueName.$(OBJEXT)
    181 am__objects_4 = ControlStruct/ForExprMutator.$(OBJEXT) \
     172am__objects_3 = ControlStruct/ForExprMutator.$(OBJEXT) \
    182173        ControlStruct/LabelFixer.$(OBJEXT) \
    183174        ControlStruct/LabelGenerator.$(OBJEXT) \
    184175        ControlStruct/MLEMutator.$(OBJEXT) \
    185176        ControlStruct/Mutate.$(OBJEXT)
    186 am__objects_5 = ResolvExpr/AdjustExprType.$(OBJEXT) \
     177am__objects_4 = ResolvExpr/AdjustExprType.$(OBJEXT) \
    187178        ResolvExpr/Alternative.$(OBJEXT) \
    188179        ResolvExpr/AlternativeFinder.$(OBJEXT) \
     
    202193        ResolvExpr/TypeEnvironment.$(OBJEXT) \
    203194        ResolvExpr/Unify.$(OBJEXT)
    204 am__objects_6 = SymTab/Autogen.$(OBJEXT) SymTab/FixFunction.$(OBJEXT) \
     195am__objects_5 = SymTab/Autogen.$(OBJEXT) SymTab/FixFunction.$(OBJEXT) \
    205196        SymTab/Indexer.$(OBJEXT) SymTab/Mangler.$(OBJEXT) \
    206197        SymTab/ManglerCommon.$(OBJEXT) SymTab/Validate.$(OBJEXT)
    207 am__objects_7 = SynTree/Type.$(OBJEXT) SynTree/VoidType.$(OBJEXT) \
     198am__objects_6 = SynTree/Type.$(OBJEXT) SynTree/VoidType.$(OBJEXT) \
    208199        SynTree/BasicType.$(OBJEXT) SynTree/PointerType.$(OBJEXT) \
    209200        SynTree/ArrayType.$(OBJEXT) SynTree/ReferenceType.$(OBJEXT) \
     
    225216        SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \
    226217        SynTree/DeclReplacer.$(OBJEXT)
    227 am__objects_8 = CompilationState.$(OBJEXT) $(am__objects_1) \
    228         $(am__objects_2) Concurrency/Keywords.$(OBJEXT) \
    229         $(am__objects_3) $(am__objects_4) GenPoly/GenPoly.$(OBJEXT) \
     218am__objects_7 = CompilationState.$(OBJEXT) $(am__objects_1) \
     219        Concurrency/Keywords.$(OBJEXT) $(am__objects_2) \
     220        $(am__objects_3) GenPoly/GenPoly.$(OBJEXT) \
    230221        GenPoly/Lvalue.$(OBJEXT) InitTweak/GenInit.$(OBJEXT) \
    231222        InitTweak/InitTweak.$(OBJEXT) Parser/LinkageSpec.$(OBJEXT) \
    232         $(am__objects_5) $(am__objects_6) SymTab/Demangle.$(OBJEXT) \
    233         $(am__objects_7) Tuples/TupleAssignment.$(OBJEXT) \
     223        $(am__objects_4) $(am__objects_5) SymTab/Demangle.$(OBJEXT) \
     224        $(am__objects_6) Tuples/TupleAssignment.$(OBJEXT) \
    234225        Tuples/TupleExpansion.$(OBJEXT) Tuples/Explode.$(OBJEXT) \
    235226        Validate/HandleAttributes.$(OBJEXT)
    236 am_libdemangle_a_OBJECTS = $(am__objects_8)
     227am_libdemangle_a_OBJECTS = $(am__objects_7)
    237228libdemangle_a_OBJECTS = $(am_libdemangle_a_OBJECTS)
    238229am__installdirs = "$(DESTDIR)$(cfa_cpplibdir)"
    239230PROGRAMS = $(cfa_cpplib_PROGRAMS)
    240 am__objects_9 = main.$(OBJEXT) MakeLibCfa.$(OBJEXT) \
    241         CompilationState.$(OBJEXT) $(am__objects_1) $(am__objects_2) \
     231am__objects_8 = main.$(OBJEXT) MakeLibCfa.$(OBJEXT) \
     232        CompilationState.$(OBJEXT) $(am__objects_1) \
    242233        CodeGen/Generate.$(OBJEXT) CodeGen/FixNames.$(OBJEXT) \
    243234        CodeTools/DeclStats.$(OBJEXT) \
    244235        CodeTools/ResolvProtoDump.$(OBJEXT) \
    245236        CodeTools/TrackLoc.$(OBJEXT) Concurrency/Keywords.$(OBJEXT) \
    246         Concurrency/Waitfor.$(OBJEXT) $(am__objects_3) \
    247         Common/DebugMalloc.$(OBJEXT) $(am__objects_4) \
     237        Concurrency/Waitfor.$(OBJEXT) $(am__objects_2) \
     238        Common/DebugMalloc.$(OBJEXT) $(am__objects_3) \
    248239        ControlStruct/ExceptTranslate.$(OBJEXT) GenPoly/Box.$(OBJEXT) \
    249240        GenPoly/GenPoly.$(OBJEXT) GenPoly/ScrubTyVars.$(OBJEXT) \
     
    259250        Parser/InitializerNode.$(OBJEXT) Parser/TypeData.$(OBJEXT) \
    260251        Parser/LinkageSpec.$(OBJEXT) Parser/parserutility.$(OBJEXT) \
    261         $(am__objects_5) ResolvExpr/AlternativePrinter.$(OBJEXT) \
    262         $(am__objects_6) $(am__objects_7) \
     252        $(am__objects_4) ResolvExpr/AlternativePrinter.$(OBJEXT) \
     253        $(am__objects_5) $(am__objects_6) \
    263254        Tuples/TupleAssignment.$(OBJEXT) \
    264255        Tuples/TupleExpansion.$(OBJEXT) Tuples/Explode.$(OBJEXT) \
    265256        Validate/HandleAttributes.$(OBJEXT) \
    266257        Virtual/ExpandCasts.$(OBJEXT)
    267 am____driver_cfa_cpp_OBJECTS = $(am__objects_9)
     258am____driver_cfa_cpp_OBJECTS = $(am__objects_8)
    268259___driver_cfa_cpp_OBJECTS = $(am____driver_cfa_cpp_OBJECTS)
    269260am__DEPENDENCIES_1 =
     
    375366ETAGS = etags
    376367CTAGS = ctags
    377 am__DIST_COMMON = $(srcdir)/AST/module.mk $(srcdir)/CodeGen/module.mk \
     368am__DIST_COMMON = $(srcdir)/CodeGen/module.mk \
    378369        $(srcdir)/CodeTools/module.mk $(srcdir)/Common/module.mk \
    379370        $(srcdir)/Concurrency/module.mk \
     
    535526AUTOMAKE_OPTIONS = foreign subdir-objects
    536527ACLOCAL_AMFLAGS = -I automake
    537 SRC = 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
    557 SRCDEMANGLE = CompilationState.cc $(SRC_AST) $(SRC_CODEGEN) \
     528SRC = 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
     548SRCDEMANGLE = CompilationState.cc $(SRC_CODEGEN) \
    558549        Concurrency/Keywords.cc $(SRC_COMMON) $(SRC_CONTROLSTRUCT) \
    559550        GenPoly/GenPoly.cc GenPoly/Lvalue.cc InitTweak/GenInit.cc \
     
    568559@WITH_LIBTCMALLOC_TRUE@LIBTCMALLOC = -ltcmalloc
    569560@WITH_LIBTCMALLOC_TRUE@TCMALLOCFLAG = -DTCMALLOC
    570 SRC_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 
    583561SRC_CODEGEN = \
    584562        CodeGen/CodeGenerator.cc \
     
    689667
    690668.SUFFIXES:
    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)
     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)
    693671        @for dep in $?; do \
    694672          case '$(am__configure_deps)' in \
     
    710688            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
    711689        esac;
    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):
     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):
    713691
    714692$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
     
    723701clean-noinstLIBRARIES:
    724702        -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
    725 AST/$(am__dirstamp):
    726         @$(MKDIR_P) AST
    727         @: > AST/$(am__dirstamp)
    728 AST/$(DEPDIR)/$(am__dirstamp):
    729         @$(MKDIR_P) AST/$(DEPDIR)
    730         @: > AST/$(DEPDIR)/$(am__dirstamp)
    731 AST/Attribute.$(OBJEXT): AST/$(am__dirstamp) \
    732         AST/$(DEPDIR)/$(am__dirstamp)
    733 AST/Convert.$(OBJEXT): AST/$(am__dirstamp) \
    734         AST/$(DEPDIR)/$(am__dirstamp)
    735 AST/Decl.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp)
    736 AST/DeclReplacer.$(OBJEXT): AST/$(am__dirstamp) \
    737         AST/$(DEPDIR)/$(am__dirstamp)
    738 AST/Expr.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp)
    739 AST/Init.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp)
    740 AST/LinkageSpec.$(OBJEXT): AST/$(am__dirstamp) \
    741         AST/$(DEPDIR)/$(am__dirstamp)
    742 AST/Node.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp)
    743 AST/Stmt.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp)
    744 AST/Type.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp)
    745 AST/TypeSubstitution.$(OBJEXT): AST/$(am__dirstamp) \
    746         AST/$(DEPDIR)/$(am__dirstamp)
    747703CodeGen/$(am__dirstamp):
    748704        @$(MKDIR_P) CodeGen
     
    11411097mostlyclean-compile:
    11421098        -rm -f *.$(OBJEXT)
    1143         -rm -f AST/*.$(OBJEXT)
    11441099        -rm -f CodeGen/*.$(OBJEXT)
    11451100        -rm -f CodeTools/*.$(OBJEXT)
     
    11641119@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MakeLibCfa.Po@am__quote@
    11651120@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@
    11771121@AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/CodeGenerator.Po@am__quote@
    11781122@AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/FixMain.Po@am__quote@
     
    13171261@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
    13181262
    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 
    13431263.ll.cc:
    13441264        $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)
     
    14731393        -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
    14741394        -rm -f ../driver/$(am__dirstamp)
    1475         -rm -f AST/$(DEPDIR)/$(am__dirstamp)
    1476         -rm -f AST/$(am__dirstamp)
    14771395        -rm -f CodeGen/$(DEPDIR)/$(am__dirstamp)
    14781396        -rm -f CodeGen/$(am__dirstamp)
     
    15201438
    15211439distclean: distclean-am
    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)
     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)
    15231441        -rm -f Makefile
    15241442distclean-am: clean-am distclean-compile distclean-generic \
     
    15661484
    15671485maintainer-clean: maintainer-clean-am
    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)
     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)
    15691487        -rm -f Makefile
    15701488maintainer-clean-am: distclean-am maintainer-clean-generic
  • src/Tuples/TupleExpansion.cc

    ra1b154d r5b35c21  
    353353        }
    354354
    355         const ast::TypeInstType * isTtype( const ast::Type * type ) {
    356                 #warning unimplemented
    357                 return nullptr;
    358         }
    359 
    360355        namespace {
    361356                /// 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

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

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