Changes in / [6e49f18:a6c5d7c]


Ignore:
Location:
src
Files:
3 added
5 deleted
29 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r6e49f18 ra6c5d7c  
    540540                extension( nameExpr );
    541541                OperatorInfo opInfo;
    542                 if ( operatorLookup( nameExpr->name, opInfo ) ) {
    543                         if ( opInfo.type == OT_CONSTANT ) {
    544                                 output << opInfo.symbol;
    545                         } else {
    546                                 output << opInfo.outputName;
    547                         }
     542                if ( operatorLookup( nameExpr->get_name(), opInfo ) ) {
     543                        assert( opInfo.type == OT_CONSTANT );
     544                        output << opInfo.symbol;
    548545                } else {
    549546                        output << nameExpr->get_name();
     
    946943                output << ";";
    947944        }
    948         void CodeGenerator::postvisit( CatchStmt * stmt ) {
    949                 assertf( ! genC, "Catch statements should not reach code generation." );
    950 
    951                 output << ((stmt->get_kind() == CatchStmt::Terminate) ?
    952                 "catch" : "catchResume");
    953                 output << "( ";
    954                 stmt->decl->accept( *visitor );
    955                 output << " ) ";
    956 
    957                 if( stmt->cond ) {
    958                         output << "if/when(?) (";
    959                         stmt->cond->accept( *visitor );
    960                         output << ") ";
    961                 }
    962                 stmt->body->accept( *visitor );
    963         }
    964 
    965         void CodeGenerator::postvisit( WaitForStmt * stmt ) {
    966                 assertf( ! genC, "Waitfor statements should not reach code generation." );
    967 
    968                 bool first = true;
    969                 for( auto & clause : stmt->clauses ) {
    970                         if(first) { output << "or "; first = false; }
    971                         if( clause.condition ) {
    972                                 output << "when(";
    973                                 stmt->timeout.condition->accept( *visitor );
    974                                 output << ") ";
    975                         }
    976                         output << "waitfor(";
    977                         clause.target.function->accept( *visitor );
    978                         for( Expression * expr : clause.target.arguments ) {
    979                                 output << ",";
    980                                 expr->accept( *visitor );
    981                         }
    982                         output << ") ";
    983                         clause.statement->accept( *visitor );
    984                 }
    985 
    986                 if( stmt->timeout.statement ) {
    987                         output << "or ";
    988                         if( stmt->timeout.condition ) {
    989                                 output << "when(";
    990                                 stmt->timeout.condition->accept( *visitor );
    991                                 output << ") ";
    992                         }
    993                         output << "timeout(";
    994                         stmt->timeout.time->accept( *visitor );
    995                         output << ") ";
    996                         stmt->timeout.statement->accept( *visitor );
    997                 }
    998 
    999                 if( stmt->orelse.statement ) {
    1000                         output << "or ";
    1001                         if( stmt->orelse.condition ) {
    1002                                 output << "when(";
    1003                                 stmt->orelse.condition->accept( *visitor );
    1004                                 output << ")";
    1005                         }
    1006                         output << "else ";
    1007                         stmt->orelse.statement->accept( *visitor );
    1008                 }
    1009         }
    1010 
    1011945
    1012946        void CodeGenerator::postvisit( WhileStmt * whileStmt ) {
  • src/CodeGen/CodeGenerator.h

    r6e49f18 ra6c5d7c  
    100100                void postvisit( ReturnStmt * );
    101101                void postvisit( ThrowStmt * );
    102                 void postvisit( CatchStmt * );
    103                 void postvisit( WaitForStmt * );
    104102                void postvisit( WhileStmt * );
    105103                void postvisit( ForStmt * );
  • src/Common/PassVisitor.h

    r6e49f18 ra6c5d7c  
    1010#include "SymTab/Indexer.h"
    1111
    12 #include "SynTree/Attribute.h"
    1312#include "SynTree/Initializer.h"
    1413#include "SynTree/Statement.h"
     
    5453        pass_type pass;
    5554
    56         virtual void visit( ObjectDecl * objectDecl ) override final;
    57         virtual void visit( FunctionDecl * functionDecl ) override final;
    58         virtual void visit( StructDecl * aggregateDecl ) override final;
    59         virtual void visit( UnionDecl * aggregateDecl ) override final;
    60         virtual void visit( EnumDecl * aggregateDecl ) override final;
    61         virtual void visit( TraitDecl * aggregateDecl ) override final;
    62         virtual void visit( TypeDecl * typeDecl ) override final;
    63         virtual void visit( TypedefDecl * typeDecl ) override final;
    64         virtual void visit( AsmDecl * asmDecl ) override final;
    65 
    66         virtual void visit( CompoundStmt * compoundStmt ) override final;
    67         virtual void visit( ExprStmt * exprStmt ) override final;
    68         virtual void visit( AsmStmt * asmStmt ) override final;
    69         virtual void visit( IfStmt * ifStmt ) override final;
    70         virtual void visit( WhileStmt * whileStmt ) override final;
    71         virtual void visit( ForStmt * forStmt ) override final;
    72         virtual void visit( SwitchStmt * switchStmt ) override final;
    73         virtual void visit( CaseStmt * caseStmt ) override final;
    74         virtual void visit( BranchStmt * branchStmt ) override final;
    75         virtual void visit( ReturnStmt * returnStmt ) override final;
    76         virtual void visit( ThrowStmt * throwStmt ) override final;
    77         virtual void visit( TryStmt * tryStmt ) override final;
    78         virtual void visit( CatchStmt * catchStmt ) override final;
    79         virtual void visit( FinallyStmt * finallyStmt ) override final;
    80         virtual void visit( WaitForStmt * waitforStmt ) override final;
    81         virtual void visit( NullStmt * nullStmt ) override final;
    82         virtual void visit( DeclStmt * declStmt ) override final;
    83         virtual void visit( ImplicitCtorDtorStmt * impCtorDtorStmt ) override final;
    84 
    85         virtual void visit( ApplicationExpr * applicationExpr ) override final;
    86         virtual void visit( UntypedExpr * untypedExpr ) override final;
    87         virtual void visit( NameExpr * nameExpr ) override final;
    88         virtual void visit( CastExpr * castExpr ) override final;
    89         virtual void visit( VirtualCastExpr * castExpr ) override final;
    90         virtual void visit( AddressExpr * addressExpr ) override final;
    91         virtual void visit( LabelAddressExpr * labAddressExpr ) override final;
    92         virtual void visit( UntypedMemberExpr * memberExpr ) override final;
    93         virtual void visit( MemberExpr * memberExpr ) override final;
    94         virtual void visit( VariableExpr * variableExpr ) override final;
    95         virtual void visit( ConstantExpr * constantExpr ) override final;
    96         virtual void visit( SizeofExpr * sizeofExpr ) override final;
    97         virtual void visit( AlignofExpr * alignofExpr ) override final;
    98         virtual void visit( UntypedOffsetofExpr * offsetofExpr ) override final;
    99         virtual void visit( OffsetofExpr * offsetofExpr ) override final;
    100         virtual void visit( OffsetPackExpr * offsetPackExpr ) override final;
    101         virtual void visit( AttrExpr * attrExpr ) override final;
    102         virtual void visit( LogicalExpr * logicalExpr ) override final;
    103         virtual void visit( ConditionalExpr * conditionalExpr ) override final;
    104         virtual void visit( CommaExpr * commaExpr ) override final;
    105         virtual void visit( TypeExpr * typeExpr ) override final;
    106         virtual void visit( AsmExpr * asmExpr ) override final;
    107         virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ) override final;
    108         virtual void visit( ConstructorExpr *  ctorExpr ) override final;
    109         virtual void visit( CompoundLiteralExpr * compLitExpr ) override final;
    110         virtual void visit( RangeExpr * rangeExpr ) override final;
    111         virtual void visit( UntypedTupleExpr * tupleExpr ) override final;
    112         virtual void visit( TupleExpr * tupleExpr ) override final;
    113         virtual void visit( TupleIndexExpr * tupleExpr ) override final;
    114         virtual void visit( TupleAssignExpr * assignExpr ) override final;
    115         virtual void visit( StmtExpr *  stmtExpr ) override final;
    116         virtual void visit( UniqueExpr *  uniqueExpr ) override final;
    117 
    118         virtual void visit( VoidType * basicType ) override final;
    119         virtual void visit( BasicType * basicType ) override final;
    120         virtual void visit( PointerType * pointerType ) override final;
    121         virtual void visit( ArrayType * arrayType ) override final;
    122         virtual void visit( ReferenceType * referenceType ) override final;
    123         virtual void visit( FunctionType * functionType ) override final;
    124         virtual void visit( StructInstType * aggregateUseType ) override final;
    125         virtual void visit( UnionInstType * aggregateUseType ) override final;
    126         virtual void visit( EnumInstType * aggregateUseType ) override final;
    127         virtual void visit( TraitInstType * aggregateUseType ) override final;
    128         virtual void visit( TypeInstType * aggregateUseType ) override final;
    129         virtual void visit( TupleType * tupleType ) override final;
    130         virtual void visit( TypeofType * typeofType ) override final;
    131         virtual void visit( AttrType * attrType ) override final;
    132         virtual void visit( VarArgsType * varArgsType ) override final;
    133         virtual void visit( ZeroType * zeroType ) override final;
    134         virtual void visit( OneType * oneType ) override final;
    135 
    136         virtual void visit( Designation * designation ) override final;
    137         virtual void visit( SingleInit * singleInit ) override final;
    138         virtual void visit( ListInit * listInit ) override final;
    139         virtual void visit( ConstructorInit * ctorInit ) override final;
    140 
    141         virtual void visit( Subrange * subrange ) override final;
    142 
    143         virtual void visit( Constant * constant ) override final;
    144 
    145         virtual void visit( Attribute * attribute ) override final;
    146 
    147         virtual DeclarationWithType * mutate( ObjectDecl * objectDecl ) override final;
    148         virtual DeclarationWithType * mutate( FunctionDecl * functionDecl ) override final;
    149         virtual Declaration * mutate( StructDecl * aggregateDecl ) override final;
    150         virtual Declaration * mutate( UnionDecl * aggregateDecl ) override final;
    151         virtual Declaration * mutate( EnumDecl * aggregateDecl ) override final;
    152         virtual Declaration * mutate( TraitDecl * aggregateDecl ) override final;
    153         virtual Declaration * mutate( TypeDecl * typeDecl ) override final;
    154         virtual Declaration * mutate( TypedefDecl * typeDecl ) override final;
    155         virtual AsmDecl * mutate( AsmDecl * asmDecl ) override final;
    156 
    157         virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) override final;
    158         virtual Statement * mutate( ExprStmt * exprStmt ) override final;
    159         virtual Statement * mutate( AsmStmt * asmStmt ) override final;
    160         virtual Statement * mutate( IfStmt * ifStmt ) override final;
    161         virtual Statement * mutate( WhileStmt * whileStmt ) override final;
    162         virtual Statement * mutate( ForStmt * forStmt ) override final;
    163         virtual Statement * mutate( SwitchStmt * switchStmt ) override final;
    164         virtual Statement * mutate( CaseStmt * caseStmt ) override final;
    165         virtual Statement * mutate( BranchStmt * branchStmt ) override final;
    166         virtual Statement * mutate( ReturnStmt * returnStmt ) override final;
    167         virtual Statement * mutate( ThrowStmt * throwStmt ) override final;
    168         virtual Statement * mutate( TryStmt * tryStmt ) override final;
    169         virtual Statement * mutate( CatchStmt * catchStmt ) override final;
    170         virtual Statement * mutate( FinallyStmt * finallyStmt ) override final;
    171         virtual Statement * mutate( WaitForStmt * waitforStmt ) override final;
    172         virtual NullStmt * mutate( NullStmt * nullStmt ) override final;
    173         virtual Statement * mutate( DeclStmt * declStmt ) override final;
    174         virtual Statement * mutate( ImplicitCtorDtorStmt * impCtorDtorStmt ) override final;
    175 
    176         virtual Expression * mutate( ApplicationExpr * applicationExpr ) override final;
    177         virtual Expression * mutate( UntypedExpr * untypedExpr ) override final;
    178         virtual Expression * mutate( NameExpr * nameExpr ) override final;
    179         virtual Expression * mutate( AddressExpr * castExpr ) override final;
    180         virtual Expression * mutate( LabelAddressExpr * labAddressExpr ) override final;
    181         virtual Expression * mutate( CastExpr * castExpr ) override final;
    182         virtual Expression * mutate( VirtualCastExpr * castExpr ) override final;
    183         virtual Expression * mutate( UntypedMemberExpr * memberExpr ) override final;
    184         virtual Expression * mutate( MemberExpr * memberExpr ) override final;
    185         virtual Expression * mutate( VariableExpr * variableExpr ) override final;
    186         virtual Expression * mutate( ConstantExpr * constantExpr ) override final;
    187         virtual Expression * mutate( SizeofExpr * sizeofExpr ) override final;
    188         virtual Expression * mutate( AlignofExpr * alignofExpr ) override final;
    189         virtual Expression * mutate( UntypedOffsetofExpr * offsetofExpr ) override final;
    190         virtual Expression * mutate( OffsetofExpr * offsetofExpr ) override final;
    191         virtual Expression * mutate( OffsetPackExpr * offsetPackExpr ) override final;
    192         virtual Expression * mutate( AttrExpr * attrExpr ) override final;
    193         virtual Expression * mutate( LogicalExpr * logicalExpr ) override final;
    194         virtual Expression * mutate( ConditionalExpr * conditionalExpr ) override final;
    195         virtual Expression * mutate( CommaExpr * commaExpr ) override final;
    196         virtual Expression * mutate( TypeExpr * typeExpr ) override final;
    197         virtual Expression * mutate( AsmExpr * asmExpr ) override final;
    198         virtual Expression * mutate( ImplicitCopyCtorExpr * impCpCtorExpr ) override final;
    199         virtual Expression * mutate( ConstructorExpr * ctorExpr ) override final;
    200         virtual Expression * mutate( CompoundLiteralExpr * compLitExpr ) override final;
    201         virtual Expression * mutate( RangeExpr * rangeExpr ) override final;
    202         virtual Expression * mutate( UntypedTupleExpr * tupleExpr ) override final;
    203         virtual Expression * mutate( TupleExpr * tupleExpr ) override final;
    204         virtual Expression * mutate( TupleIndexExpr * tupleExpr ) override final;
    205         virtual Expression * mutate( TupleAssignExpr * assignExpr ) override final;
    206         virtual Expression * mutate( StmtExpr *  stmtExpr ) override final;
    207         virtual Expression * mutate( UniqueExpr *  uniqueExpr ) override final;
    208 
    209         virtual Type * mutate( VoidType * basicType ) override final;
    210         virtual Type * mutate( BasicType * basicType ) override final;
    211         virtual Type * mutate( PointerType * pointerType ) override final;
    212         virtual Type * mutate( ArrayType * arrayType ) override final;
    213         virtual Type * mutate( ReferenceType * referenceType ) override final;
    214         virtual Type * mutate( FunctionType * functionType ) override final;
    215         virtual Type * mutate( StructInstType * aggregateUseType ) override final;
    216         virtual Type * mutate( UnionInstType * aggregateUseType ) override final;
    217         virtual Type * mutate( EnumInstType * aggregateUseType ) override final;
    218         virtual Type * mutate( TraitInstType * aggregateUseType ) override final;
    219         virtual Type * mutate( TypeInstType * aggregateUseType ) override final;
    220         virtual Type * mutate( TupleType * tupleType ) override final;
    221         virtual Type * mutate( TypeofType * typeofType ) override final;
    222         virtual Type * mutate( AttrType * attrType ) override final;
    223         virtual Type * mutate( VarArgsType * varArgsType ) override final;
    224         virtual Type * mutate( ZeroType * zeroType ) override final;
    225         virtual Type * mutate( OneType * oneType ) override final;
    226 
    227         virtual Designation * mutate( Designation * designation ) override final;
    228         virtual Initializer * mutate( SingleInit * singleInit ) override final;
    229         virtual Initializer * mutate( ListInit * listInit ) override final;
    230         virtual Initializer * mutate( ConstructorInit * ctorInit ) override final;
    231 
    232         virtual Subrange * mutate( Subrange * subrange ) override final;
    233 
    234         virtual Constant * mutate( Constant * constant ) override final;
    235 
    236         virtual Attribute * mutate( Attribute * attribute ) override final;
     55        virtual void visit( ObjectDecl *objectDecl ) override final;
     56        virtual void visit( FunctionDecl *functionDecl ) override final;
     57        virtual void visit( StructDecl *aggregateDecl ) override final;
     58        virtual void visit( UnionDecl *aggregateDecl ) override final;
     59        virtual void visit( EnumDecl *aggregateDecl ) override final;
     60        virtual void visit( TraitDecl *aggregateDecl ) override final;
     61        virtual void visit( TypeDecl *typeDecl ) override final;
     62        virtual void visit( TypedefDecl *typeDecl ) override final;
     63        virtual void visit( AsmDecl *asmDecl ) override final;
     64
     65        virtual void visit( CompoundStmt *compoundStmt ) override final;
     66        virtual void visit( ExprStmt *exprStmt ) override final;
     67        virtual void visit( AsmStmt *asmStmt ) override final;
     68        virtual void visit( IfStmt *ifStmt ) override final;
     69        virtual void visit( WhileStmt *whileStmt ) override final;
     70        virtual void visit( ForStmt *forStmt ) override final;
     71        virtual void visit( SwitchStmt *switchStmt ) override final;
     72        virtual void visit( CaseStmt *caseStmt ) override final;
     73        virtual void visit( BranchStmt *branchStmt ) override final;
     74        virtual void visit( ReturnStmt *returnStmt ) override final;
     75        virtual void visit( ThrowStmt *throwStmt ) override final;
     76        virtual void visit( TryStmt *tryStmt ) override final;
     77        virtual void visit( CatchStmt *catchStmt ) override final;
     78        virtual void visit( FinallyStmt *finallyStmt ) override final;
     79        virtual void visit( WaitForStmt *waitforStmt ) override final;
     80        virtual void visit( NullStmt *nullStmt ) override final;
     81        virtual void visit( DeclStmt *declStmt ) override final;
     82        virtual void visit( ImplicitCtorDtorStmt *impCtorDtorStmt ) override final;
     83
     84        virtual void visit( ApplicationExpr *applicationExpr ) override final;
     85        virtual void visit( UntypedExpr *untypedExpr ) override final;
     86        virtual void visit( NameExpr *nameExpr ) override final;
     87        virtual void visit( CastExpr *castExpr ) override final;
     88        virtual void visit( VirtualCastExpr *castExpr ) override final;
     89        virtual void visit( AddressExpr *addressExpr ) override final;
     90        virtual void visit( LabelAddressExpr *labAddressExpr ) override final;
     91        virtual void visit( UntypedMemberExpr *memberExpr ) override final;
     92        virtual void visit( MemberExpr *memberExpr ) override final;
     93        virtual void visit( VariableExpr *variableExpr ) override final;
     94        virtual void visit( ConstantExpr *constantExpr ) override final;
     95        virtual void visit( SizeofExpr *sizeofExpr ) override final;
     96        virtual void visit( AlignofExpr *alignofExpr ) override final;
     97        virtual void visit( UntypedOffsetofExpr *offsetofExpr ) override final;
     98        virtual void visit( OffsetofExpr *offsetofExpr ) override final;
     99        virtual void visit( OffsetPackExpr *offsetPackExpr ) override final;
     100        virtual void visit( AttrExpr *attrExpr ) override final;
     101        virtual void visit( LogicalExpr *logicalExpr ) override final;
     102        virtual void visit( ConditionalExpr *conditionalExpr ) override final;
     103        virtual void visit( CommaExpr *commaExpr ) override final;
     104        virtual void visit( TypeExpr *typeExpr ) override final;
     105        virtual void visit( AsmExpr *asmExpr ) override final;
     106        virtual void visit( ImplicitCopyCtorExpr *impCpCtorExpr ) override final;
     107        virtual void visit( ConstructorExpr * ctorExpr ) override final;
     108        virtual void visit( CompoundLiteralExpr *compLitExpr ) override final;
     109        virtual void visit( RangeExpr *rangeExpr ) override final;
     110        virtual void visit( UntypedTupleExpr *tupleExpr ) override final;
     111        virtual void visit( TupleExpr *tupleExpr ) override final;
     112        virtual void visit( TupleIndexExpr *tupleExpr ) override final;
     113        virtual void visit( TupleAssignExpr *assignExpr ) override final;
     114        virtual void visit( StmtExpr * stmtExpr ) override final;
     115        virtual void visit( UniqueExpr * uniqueExpr ) override final;
     116
     117        virtual void visit( VoidType *basicType ) override final;
     118        virtual void visit( BasicType *basicType ) override final;
     119        virtual void visit( PointerType *pointerType ) override final;
     120        virtual void visit( ArrayType *arrayType ) override final;
     121        virtual void visit( ReferenceType *referenceType ) override final;
     122        virtual void visit( FunctionType *functionType ) override final;
     123        virtual void visit( StructInstType *aggregateUseType ) override final;
     124        virtual void visit( UnionInstType *aggregateUseType ) override final;
     125        virtual void visit( EnumInstType *aggregateUseType ) override final;
     126        virtual void visit( TraitInstType *aggregateUseType ) override final;
     127        virtual void visit( TypeInstType *aggregateUseType ) override final;
     128        virtual void visit( TupleType *tupleType ) override final;
     129        virtual void visit( TypeofType *typeofType ) override final;
     130        virtual void visit( AttrType *attrType ) override final;
     131        virtual void visit( VarArgsType *varArgsType ) override final;
     132        virtual void visit( ZeroType *zeroType ) override final;
     133        virtual void visit( OneType *oneType ) override final;
     134
     135        virtual void visit( Designation *designation ) override final;
     136        virtual void visit( SingleInit *singleInit ) override final;
     137        virtual void visit( ListInit *listInit ) override final;
     138        virtual void visit( ConstructorInit *ctorInit ) override final;
     139
     140        virtual void visit( Subrange *subrange ) override final;
     141
     142        virtual void visit( Constant *constant ) override final;
     143
     144        virtual DeclarationWithType* mutate( ObjectDecl *objectDecl ) override final;
     145        virtual DeclarationWithType* mutate( FunctionDecl *functionDecl ) override final;
     146        virtual Declaration* mutate( StructDecl *aggregateDecl ) override final;
     147        virtual Declaration* mutate( UnionDecl *aggregateDecl ) override final;
     148        virtual Declaration* mutate( EnumDecl *aggregateDecl ) override final;
     149        virtual Declaration* mutate( TraitDecl *aggregateDecl ) override final;
     150        virtual Declaration* mutate( TypeDecl *typeDecl ) override final;
     151        virtual Declaration* mutate( TypedefDecl *typeDecl ) override final;
     152        virtual AsmDecl* mutate( AsmDecl *asmDecl ) override final;
     153
     154        virtual CompoundStmt* mutate( CompoundStmt *compoundStmt ) override final;
     155        virtual Statement* mutate( ExprStmt *exprStmt ) override final;
     156        virtual Statement* mutate( AsmStmt *asmStmt ) override final;
     157        virtual Statement* mutate( IfStmt *ifStmt ) override final;
     158        virtual Statement* mutate( WhileStmt *whileStmt ) override final;
     159        virtual Statement* mutate( ForStmt *forStmt ) override final;
     160        virtual Statement* mutate( SwitchStmt *switchStmt ) override final;
     161        virtual Statement* mutate( CaseStmt *caseStmt ) override final;
     162        virtual Statement* mutate( BranchStmt *branchStmt ) override final;
     163        virtual Statement* mutate( ReturnStmt *returnStmt ) override final;
     164        virtual Statement* mutate( ThrowStmt *throwStmt ) override final;
     165        virtual Statement* mutate( TryStmt *tryStmt ) override final;
     166        virtual Statement* mutate( CatchStmt *catchStmt ) override final;
     167        virtual Statement* mutate( FinallyStmt *finallyStmt ) override final;
     168        virtual Statement* mutate( WaitForStmt *waitforStmt ) override final;
     169        virtual NullStmt* mutate( NullStmt *nullStmt ) override final;
     170        virtual Statement* mutate( DeclStmt *declStmt ) override final;
     171        virtual Statement* mutate( ImplicitCtorDtorStmt *impCtorDtorStmt ) override final;
     172
     173        virtual Expression* mutate( ApplicationExpr *applicationExpr ) override final;
     174        virtual Expression* mutate( UntypedExpr *untypedExpr ) override final;
     175        virtual Expression* mutate( NameExpr *nameExpr ) override final;
     176        virtual Expression* mutate( AddressExpr *castExpr ) override final;
     177        virtual Expression* mutate( LabelAddressExpr *labAddressExpr ) override final;
     178        virtual Expression* mutate( CastExpr *castExpr ) override final;
     179        virtual Expression* mutate( VirtualCastExpr *castExpr ) override final;
     180        virtual Expression* mutate( UntypedMemberExpr *memberExpr ) override final;
     181        virtual Expression* mutate( MemberExpr *memberExpr ) override final;
     182        virtual Expression* mutate( VariableExpr *variableExpr ) override final;
     183        virtual Expression* mutate( ConstantExpr *constantExpr ) override final;
     184        virtual Expression* mutate( SizeofExpr *sizeofExpr ) override final;
     185        virtual Expression* mutate( AlignofExpr *alignofExpr ) override final;
     186        virtual Expression* mutate( UntypedOffsetofExpr *offsetofExpr ) override final;
     187        virtual Expression* mutate( OffsetofExpr *offsetofExpr ) override final;
     188        virtual Expression* mutate( OffsetPackExpr *offsetPackExpr ) override final;
     189        virtual Expression* mutate( AttrExpr *attrExpr ) override final;
     190        virtual Expression* mutate( LogicalExpr *logicalExpr ) override final;
     191        virtual Expression* mutate( ConditionalExpr *conditionalExpr ) override final;
     192        virtual Expression* mutate( CommaExpr *commaExpr ) override final;
     193        virtual Expression* mutate( TypeExpr *typeExpr ) override final;
     194        virtual Expression* mutate( AsmExpr *asmExpr ) override final;
     195        virtual Expression* mutate( ImplicitCopyCtorExpr *impCpCtorExpr ) override final;
     196        virtual Expression* mutate( ConstructorExpr *ctorExpr ) override final;
     197        virtual Expression* mutate( CompoundLiteralExpr *compLitExpr ) override final;
     198        virtual Expression* mutate( RangeExpr *rangeExpr ) override final;
     199        virtual Expression* mutate( UntypedTupleExpr *tupleExpr ) override final;
     200        virtual Expression* mutate( TupleExpr *tupleExpr ) override final;
     201        virtual Expression* mutate( TupleIndexExpr *tupleExpr ) override final;
     202        virtual Expression* mutate( TupleAssignExpr *assignExpr ) override final;
     203        virtual Expression* mutate( StmtExpr * stmtExpr ) override final;
     204        virtual Expression* mutate( UniqueExpr * uniqueExpr ) override final;
     205
     206        virtual Type* mutate( VoidType *basicType ) override final;
     207        virtual Type* mutate( BasicType *basicType ) override final;
     208        virtual Type* mutate( PointerType *pointerType ) override final;
     209        virtual Type* mutate( ArrayType *arrayType ) override final;
     210        virtual Type* mutate( ReferenceType *referenceType ) override final;
     211        virtual Type* mutate( FunctionType *functionType ) override final;
     212        virtual Type* mutate( StructInstType *aggregateUseType ) override final;
     213        virtual Type* mutate( UnionInstType *aggregateUseType ) override final;
     214        virtual Type* mutate( EnumInstType *aggregateUseType ) override final;
     215        virtual Type* mutate( TraitInstType *aggregateUseType ) override final;
     216        virtual Type* mutate( TypeInstType *aggregateUseType ) override final;
     217        virtual Type* mutate( TupleType *tupleType ) override final;
     218        virtual Type* mutate( TypeofType *typeofType ) override final;
     219        virtual Type* mutate( AttrType *attrType ) override final;
     220        virtual Type* mutate( VarArgsType *varArgsType ) override final;
     221        virtual Type* mutate( ZeroType *zeroType ) override final;
     222        virtual Type* mutate( OneType *oneType ) override final;
     223
     224        virtual Designation* mutate( Designation *designation ) override final;
     225        virtual Initializer* mutate( SingleInit *singleInit ) override final;
     226        virtual Initializer* mutate( ListInit *listInit ) override final;
     227        virtual Initializer* mutate( ConstructorInit *ctorInit ) override final;
     228
     229        virtual Subrange *mutate( Subrange *subrange ) override final;
     230
     231        virtual Constant *mutate( Constant *constant ) override final;
    237232
    238233private:
  • src/Common/PassVisitor.impl.h

    r6e49f18 ra6c5d7c  
    321321        maybeAccept        ( node->init         , *this );
    322322        maybeAccept        ( node->bitfieldWidth, *this );
    323         maybeAccept        ( node->attributes   , *this );
    324323
    325324        if ( node->name != "" ) {
     
    337336        maybeMutateRef     ( node->init         , *this );
    338337        maybeMutateRef     ( node->bitfieldWidth, *this );
    339         maybeMutateRef     ( node->attributes   , *this );
    340338
    341339        if ( node->name != "" ) {
     
    360358                maybeAccept( node->type, *this );
    361359                maybeAccept( node->statements, *this );
    362                 maybeAccept( node->attributes, *this );
    363360        }
    364361
     
    378375                maybeMutateRef( node->type, *this );
    379376                maybeMutateRef( node->statements, *this );
    380                 maybeMutateRef( node->attributes, *this );
    381377        }
    382378
     
    19881984}
    19891985
    1990 template< typename pass_type >
    1991 void PassVisitor< pass_type >::visit( Attribute * node ) {
    1992         VISIT_BODY( node );
    1993 }
    1994 
    19951986//---------------------------------------------------------------------------------------------------------------
    19961987template< typename pass_type >
     
    20782069        MUTATE_BODY( Constant, node );
    20792070}
    2080 
    2081 template< typename pass_type >
    2082 Attribute * PassVisitor< pass_type >::mutate( Attribute * node  )  {
    2083         MUTATE_BODY( Attribute, node );
    2084 }
  • src/InitTweak/FixInit.cc

    r6e49f18 ra6c5d7c  
    214214                        void emit( CodeLocation, const Params &... params );
    215215
    216                         FunctionDecl * function = nullptr;
     216                        FunctionDecl * function = 0;
    217217                        std::set< DeclarationWithType * > unhandled;
    218218                        std::map< DeclarationWithType *, CodeLocation > usedUninit;
    219                         ObjectDecl * thisParam = nullptr;
     219                        ObjectDecl * thisParam = 0;
    220220                        bool isCtor = false; // true if current function is a constructor
    221                         StructDecl * structDecl = nullptr;
     221                        StructDecl * structDecl = 0;
    222222                };
    223223
     
    624624                }
    625625
    626                 DeclarationWithType * FixInit::postmutate( ObjectDecl *objDecl ) {
     626                DeclarationWithType *FixInit::postmutate( ObjectDecl *objDecl ) {
    627627                        // since this removes the init field from objDecl, it must occur after children are mutated (i.e. postmutate)
    628628                        if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) {
     
    722722                                        } else {
    723723                                                ImplicitCtorDtorStmt * implicit = strict_dynamic_cast< ImplicitCtorDtorStmt * > ( ctor );
    724                                                 ExprStmt * ctorStmt = dynamic_cast< ExprStmt * >( implicit->callStmt );
     724                                                ExprStmt * ctorStmt = dynamic_cast< ExprStmt * >( implicit->get_callStmt() );
    725725                                                ApplicationExpr * ctorCall = nullptr;
    726                                                 if ( ctorStmt && (ctorCall = isIntrinsicCallExpr( ctorStmt->expr )) && ctorCall->get_args().size() == 2 ) {
     726                                                if ( ctorStmt && (ctorCall = isIntrinsicCallExpr( ctorStmt->get_expr() )) && ctorCall->get_args().size() == 2 ) {
    727727                                                        // clean up intrinsic copy constructor calls by making them into SingleInits
    728                                                         objDecl->init = new SingleInit( ctorCall->args.back() );
    729                                                         ctorCall->args.pop_back();
     728                                                        objDecl->set_init( new SingleInit( ctorCall->get_args().back() ) );
     729                                                        ctorCall->get_args().pop_back();
    730730                                                } else {
    731731                                                        stmtsToAddAfter.push_back( ctor );
    732                                                         objDecl->init = nullptr;
    733                                                         ctorInit->ctor = nullptr;
     732                                                        objDecl->set_init( nullptr );
     733                                                        ctorInit->set_ctor( nullptr );
    734734                                                }
    735735                                        } // if
    736                                 } else if ( Initializer * init = ctorInit->init ) {
    737                                         objDecl->init = init;
    738                                         ctorInit->init = nullptr;
     736                                } else if ( Initializer * init = ctorInit->get_init() ) {
     737                                        objDecl->set_init( init );
     738                                        ctorInit->set_init( nullptr );
    739739                                } else {
    740740                                        // no constructor and no initializer, which is okay
    741                                         objDecl->init = nullptr;
     741                                        objDecl->set_init( nullptr );
    742742                                } // if
    743743                                delete ctorInit;
     
    912912                }
    913913
    914                 void addIds( SymTab::Indexer & indexer, const std::list< DeclarationWithType * > & decls ) {
    915                         for ( auto d : decls ) {
    916                                 indexer.addId( d );
    917                         }
    918                 }
    919 
    920                 void addTypes( SymTab::Indexer & indexer, const std::list< TypeDecl * > & tds ) {
    921                         for ( auto td : tds ) {
    922                                 indexer.addType( td );
    923                                 addIds( indexer, td->assertions );
    924                         }
    925                 }
    926 
    927914                void GenStructMemberCalls::previsit( FunctionDecl * funcDecl ) {
    928                         GuardValue( function );
     915                        GuardValue( funcDecl );
    929916                        GuardValue( unhandled );
    930917                        GuardValue( usedUninit );
     
    959946                }
    960947
     948                void addIds( SymTab::Indexer & indexer, const std::list< DeclarationWithType * > & decls ) {
     949                        for ( auto d : decls ) {
     950                                indexer.addId( d );
     951                        }
     952                }
     953
     954                void addTypes( SymTab::Indexer & indexer, const std::list< TypeDecl * > & tds ) {
     955                        for ( auto td : tds ) {
     956                                indexer.addType( td );
     957                                addIds( indexer, td->assertions );
     958                        }
     959                }
     960
    961961                void GenStructMemberCalls::postvisit( FunctionDecl * funcDecl ) {
    962962                        // remove the unhandled objects from usedUninit, because a call is inserted
  • src/InitTweak/InitTweak.cc

    r6e49f18 ra6c5d7c  
    270270        }
    271271
    272         Type * getThisType( FunctionType * ftype ) {
    273                 assertf( ftype, "getThisType: nullptr ftype" );
    274                 ObjectDecl * thisParam = getThisParam( ftype );
    275                 ReferenceType * refType = strict_dynamic_cast< ReferenceType * >( thisParam->type );
    276                 return refType->base;
    277         }
    278 
    279         ObjectDecl * getThisParam( FunctionType * ftype ) {
    280                 assertf( ftype, "getThisParam: nullptr ftype" );
    281                 auto & params = ftype->parameters;
    282                 assertf( ! params.empty(), "getThisParam: ftype with 0 parameters: %s", toString( ftype ).c_str() );
    283                 return strict_dynamic_cast< ObjectDecl * >( params.front() );
    284         }
    285 
    286272        bool tryConstruct( DeclarationWithType * dwt ) {
    287273                ObjectDecl * objDecl = dynamic_cast< ObjectDecl * >( dwt );
  • src/InitTweak/InitTweak.h

    r6e49f18 ra6c5d7c  
    2929        FunctionDecl * isCopyConstructor( Declaration * decl );
    3030        FunctionDecl * isCopyFunction( Declaration * decl, const std::string & fname );
    31 
    32         /// returns the base type of the first parameter to a constructor/destructor/assignment function
    33         Type * getThisType( FunctionType * ftype );
    34 
    35         /// returns the first parameter of a constructor/destructor/assignment function
    36         ObjectDecl * getThisParam( FunctionType * ftype );
    3731
    3832        /// transform Initializer into an argument list that can be passed to a call expression
  • src/ResolvExpr/AlternativeFinder.cc

    r6e49f18 ra6c5d7c  
    174174        }
    175175
    176         void AlternativeFinder::find( Expression *expr, bool adjust, bool prune, bool failFast ) {
     176        void AlternativeFinder::find( Expression *expr, bool adjust, bool prune ) {
    177177                expr->accept( *this );
    178                 if ( failFast && alternatives.empty() ) {
     178                if ( alternatives.empty() ) {
    179179                        throw SemanticError( "No reasonable alternatives for expression ", expr );
    180180                }
     
    191191                        AltList::iterator oldBegin = alternatives.begin();
    192192                        pruneAlternatives( alternatives.begin(), alternatives.end(), front_inserter( alternatives ) );
    193                         if ( failFast && alternatives.begin() == oldBegin ) {
     193                        if ( alternatives.begin() == oldBegin ) {
    194194                                std::ostringstream stream;
    195195                                AltList winners;
     
    214214        }
    215215
    216         void AlternativeFinder::findWithAdjustment( Expression *expr ) {
    217                 find( expr, true );
    218         }
    219 
    220         void AlternativeFinder::findWithoutPrune( Expression * expr ) {
    221                 find( expr, true, false );
    222         }
    223 
    224         void AlternativeFinder::maybeFind( Expression * expr ) {
    225                 find( expr, true, true, false );
     216        void AlternativeFinder::findWithAdjustment( Expression *expr, bool prune ) {
     217                find( expr, true, prune );
    226218        }
    227219
     
    722714
    723715                // find function operators
    724                 static NameExpr *opExpr = new NameExpr( "?()" );
    725716                AlternativeFinder funcOpFinder( indexer, env );
    726                 // it's ok if there aren't any defined function ops
    727                 funcOpFinder.maybeFind( opExpr);
     717                NameExpr *opExpr = new NameExpr( "?()" );
     718                try {
     719                        funcOpFinder.findWithAdjustment( opExpr );
     720                } catch( SemanticError &e ) {
     721                        // it's ok if there aren't any defined function ops
     722                }
    728723                PRINT(
    729724                        std::cerr << "known function ops:" << std::endl;
     
    933928                AlternativeFinder finder( indexer, env );
    934929                // don't prune here, since it's guaranteed all alternatives will have the same type
    935                 finder.findWithoutPrune( castExpr->get_arg() );
     930                // (giving the alternatives different types is half of the point of ConstructorExpr nodes)
     931                finder.findWithAdjustment( castExpr->get_arg(), false );
    936932                for ( Alternative & alt : finder.alternatives ) {
    937933                        alternatives.push_back( Alternative(
     
    12301226                // don't prune here, since it's guaranteed all alternatives will have the same type
    12311227                // (giving the alternatives different types is half of the point of ConstructorExpr nodes)
    1232                 finder.findWithoutPrune( ctorExpr->get_callExpr() );
     1228                finder.findWithAdjustment( ctorExpr->get_callExpr(), false );
    12331229                for ( Alternative & alt : finder.alternatives ) {
    12341230                        alternatives.push_back( Alternative( new ConstructorExpr( alt.expr->clone() ), alt.env, alt.cost ) );
  • src/ResolvExpr/AlternativeFinder.h

    r6e49f18 ra6c5d7c  
    3434          public:
    3535                AlternativeFinder( const SymTab::Indexer &indexer, const TypeEnvironment &env );
    36                 void find( Expression *expr, bool adjust = false, bool prune = true, bool failFast = true );
     36                void find( Expression *expr, bool adjust = false, bool prune = true );
    3737                /// Calls find with the adjust flag set; adjustment turns array and function types into equivalent pointer types
    38                 void findWithAdjustment( Expression *expr );
    39                 /// Calls find with the adjust flag set and prune flag unset; pruning ensures there is at most one alternative per result type
    40                 void findWithoutPrune( Expression *expr );
    41                 /// Calls find with the adjust and prune flags set, failFast flags unset; fail fast ensures that there is at least one resulting alternative
    42                 void maybeFind( Expression *expr );
     38                void findWithAdjustment( Expression *expr, bool prune = true );
    4339                AltList &get_alternatives() { return alternatives; }
    4440
  • src/SymTab/Autogen.cc

    r6e49f18 ra6c5d7c  
    119119                ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), paramType->clone() ), nullptr );
    120120                ftype->get_parameters().push_back( dstParam );
     121
    121122                return ftype;
    122123        }
  • src/SymTab/Autogen.h

    r6e49f18 ra6c5d7c  
    4444        extern FunctionDecl * dereferenceOperator;
    4545
    46         // generate the type of an assignment function for paramType
     46        // temporary
    4747        FunctionType * genAssignType( Type * paramType );
    48 
    49         // generate the type of a default constructor or destructor for paramType
    50         FunctionType * genDefaultType( Type * paramType );
    51 
    52         // generate the type of a copy constructor for paramType
    53         FunctionType * genCopyType( Type * paramType );
    5448
    5549        /// inserts into out a generated call expression to function fname with arguments dstParam and srcParam. Intended to be used with generated ?=?, ?{}, and ^?{} calls.
  • src/SynTree/Attribute.h

    r6e49f18 ra6c5d7c  
    2020#include <string>  // for string, operator==
    2121
    22 #include "BaseSyntaxNode.h"
    23 #include "Mutator.h"
    24 #include "Visitor.h"
    25 
    2622class Expression;
    2723
    2824// GCC attribute
    2925// https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/Attribute-Syntax.html#Attribute-Syntax
    30 class Attribute : public BaseSyntaxNode {
     26class Attribute {
    3127  public:
    32         std::string name;
    33         // to keep things nice and tight, use NameExpr for special identifier parameters
    34         std::list< Expression * > parameters;
    35 
    3628        Attribute( std::string name = "", const std::list< Expression * > & parameters = std::list< Expression * >() ) : name( name ), parameters( parameters ) {}
    3729        Attribute( const Attribute &other );
     
    4335        bool empty() const { return name == ""; }
    4436
    45         Attribute * clone() const override { return new Attribute( *this ); }
    46         virtual void accept( Visitor & v ) override { v.visit( this ); }
    47         virtual Attribute * acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    48         virtual void print( std::ostream & os, int indent = 0 ) const override;
     37        Attribute * clone() const { return new Attribute( *this ); }
     38        void print( std:: ostream &os, int indent = 0 ) const;
     39  private:
     40        std::string name;
     41        // to keep things nice and tight, use NameExpr for special identifier parameters
     42        std::list< Expression * > parameters;
    4943};
    5044
  • src/SynTree/BaseSyntaxNode.h

    r6e49f18 ra6c5d7c  
    1818#include "Common/CodeLocation.h"
    1919class Visitor;
    20 class Mutator;
    2120
    2221class BaseSyntaxNode {
     
    2625        virtual ~BaseSyntaxNode() {}
    2726
    28         virtual BaseSyntaxNode * clone() const = 0;
    2927        virtual void accept( Visitor & v ) = 0;
    30         virtual BaseSyntaxNode * acceptMutator( Mutator & m ) = 0;
    31         virtual void print( std::ostream & os, int indent = 0 ) const = 0;
     28        virtual void print( std::ostream & os, int indent = 0 ) const = 0;
    3229};
    3330
  • src/SynTree/Declaration.h

    r6e49f18 ra6c5d7c  
    6161
    6262        void fixUniqueId( void );
    63         virtual Declaration *clone() const override = 0;
     63        virtual Declaration *clone() const = 0;
    6464        virtual void accept( Visitor &v ) override = 0;
    65         virtual Declaration *acceptMutator( Mutator &m ) override = 0;
     65        virtual Declaration *acceptMutator( Mutator &m ) = 0;
    6666        virtual void print( std::ostream &os, int indent = 0 ) const override = 0;
    6767        virtual void printShort( std::ostream &os, int indent = 0 ) const = 0;
     
    164164        CompoundStmt *get_statements() const { return statements; }
    165165        void set_statements( CompoundStmt *newValue ) { statements = newValue; }
    166 
    167         static FunctionDecl * newFunction( const std::string & name, FunctionType * type, CompoundStmt * statements );
    168166
    169167        virtual FunctionDecl *clone() const override { return new FunctionDecl( *this ); }
  • src/SynTree/Expression.h

    r6e49f18 ra6c5d7c  
    5555        Expression * set_extension( bool exten ) { extension = exten; return this; }
    5656
    57         virtual Expression * clone() const override = 0;
    58         virtual void accept( Visitor & v ) override = 0;
    59         virtual Expression * acceptMutator( Mutator & m ) override = 0;
    60         virtual void print( std::ostream & os, int indent = 0 ) const override;
     57        virtual Expression * clone() const = 0;
     58        virtual void accept( Visitor & v ) = 0;
     59        virtual Expression * acceptMutator( Mutator & m ) = 0;
     60        virtual void print( std::ostream & os, int indent = 0 ) const;
    6161};
    6262
  • src/SynTree/FunctionDecl.cc

    r6e49f18 ra6c5d7c  
    2626#include "Statement.h"           // for CompoundStmt
    2727#include "Type.h"                // for Type, FunctionType, Type::FuncSpecif...
    28 #include "VarExprReplacer.h"
    2928
    3029extern bool translation_unit_nomain;
     
    4039FunctionDecl::FunctionDecl( const FunctionDecl &other )
    4140                : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) {
    42 
    43         VarExprReplacer::DeclMap declMap;
    44         for ( auto p : group_iterate( other.type->parameters, type->parameters ) ) {
    45                 declMap[ std::get<0>(p) ] = std::get<1>(p);
    46         }
    47         for ( auto p : group_iterate( other.type->returnVals, type->returnVals ) ) {
    48                 declMap[ std::get<0>(p) ] = std::get<1>(p);
    49         }
    50         if ( ! declMap.empty() ) {
    51                 VarExprReplacer replacer( declMap );
    52                 accept( replacer );
    53         }
    5441}
    5542
     
    5744        delete type;
    5845        delete statements;
    59 }
    60 
    61 FunctionDecl * FunctionDecl::newFunction( const std::string & name, FunctionType * type, CompoundStmt * statements ) {
    62         return new FunctionDecl( name, Type::StorageClasses(), LinkageSpec::C, type, statements );
    6346}
    6447
  • src/SynTree/Initializer.h

    r6e49f18 ra6c5d7c  
    3737        std::list< Expression * > & get_designators() { return designators; }
    3838
    39         virtual Designation * clone() const override { return new Designation( *this ); };
     39        virtual Designation * clone() const { return new Designation( *this ); };
    4040        virtual void accept( Visitor &v ) override { v.visit( this ); }
    41         virtual Designation * acceptMutator( Mutator &m ) override { return m.mutate( this ); }
     41        virtual Designation * acceptMutator( Mutator &m ) { return m.mutate( this ); }
    4242        virtual void print( std::ostream &os, int indent = 0 ) const override;
    4343};
     
    5454        bool get_maybeConstructed() { return maybeConstructed; }
    5555
    56         virtual Initializer *clone() const override = 0;
     56        virtual Initializer *clone() const = 0;
    5757        virtual void accept( Visitor &v ) override = 0;
    58         virtual Initializer *acceptMutator( Mutator &m ) override = 0;
     58        virtual Initializer *acceptMutator( Mutator &m ) = 0;
    5959        virtual void print( std::ostream &os, int indent = 0 ) const override = 0;
    6060  private:
     
    117117        Statement * ctor;
    118118        Statement * dtor;
    119         // C-style initializer made up of SingleInit and ListInit nodes to use as a fallback
    120         // if an appropriate constructor definition is not found by the resolver
    121         Initializer * init;
    122119
    123120        ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init );
     
    138135
    139136  private:
     137        // C-style initializer made up of SingleInit and ListInit nodes to use as a fallback
     138        // if an appropriate constructor definition is not found by the resolver
     139        Initializer * init;
    140140};
    141141
  • src/SynTree/Mutator.cc

    r6e49f18 ra6c5d7c  
    1717#include <list>                // for list
    1818
    19 #include "Attribute.h"         // for Attribute
    2019#include "Declaration.h"       // for ObjectDecl, Declaration, DeclarationWi...
    2120#include "Expression.h"        // for Expression, ConstantExpr, ConditionalExpr
     
    3736        objectDecl->set_init( maybeMutate( objectDecl->get_init(), *this ) );
    3837        objectDecl->set_bitfieldWidth( maybeMutate( objectDecl->get_bitfieldWidth(), *this ) );
    39         mutateAll( objectDecl->attributes, *this );
    4038        return objectDecl;
    4139}
     
    4442        functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) );
    4543        functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
    46         mutateAll( functionDecl->attributes, *this );
    4744        return functionDecl;
    4845}
     
    621618}
    622619
    623 Attribute * Mutator::mutate( Attribute * attribute ) {
    624         mutateAll( attribute->parameters, *this );
    625         return attribute;
    626 }
    627 
    628620// Local Variables: //
    629621// tab-width: 4 //
  • src/SynTree/Mutator.h

    r6e49f18 ra6c5d7c  
    2525        virtual ~Mutator();
    2626  public:
    27         virtual DeclarationWithType * mutate( ObjectDecl * objectDecl );
    28         virtual DeclarationWithType * mutate( FunctionDecl * functionDecl );
    29         virtual Declaration * mutate( StructDecl * aggregateDecl );
    30         virtual Declaration * mutate( UnionDecl * aggregateDecl );
    31         virtual Declaration * mutate( EnumDecl * aggregateDecl );
    32         virtual Declaration * mutate( TraitDecl * aggregateDecl );
    33         virtual Declaration * mutate( TypeDecl * typeDecl );
    34         virtual Declaration * mutate( TypedefDecl * typeDecl );
    35         virtual AsmDecl * mutate( AsmDecl * asmDecl );
     27        virtual DeclarationWithType* mutate( ObjectDecl *objectDecl );
     28        virtual DeclarationWithType* mutate( FunctionDecl *functionDecl );
     29        virtual Declaration* mutate( StructDecl *aggregateDecl );
     30        virtual Declaration* mutate( UnionDecl *aggregateDecl );
     31        virtual Declaration* mutate( EnumDecl *aggregateDecl );
     32        virtual Declaration* mutate( TraitDecl *aggregateDecl );
     33        virtual Declaration* mutate( TypeDecl *typeDecl );
     34        virtual Declaration* mutate( TypedefDecl *typeDecl );
     35        virtual AsmDecl* mutate( AsmDecl *asmDecl );
    3636
    37         virtual CompoundStmt * mutate( CompoundStmt * compoundStmt );
    38         virtual Statement * mutate( ExprStmt * exprStmt );
    39         virtual Statement * mutate( AsmStmt * asmStmt );
    40         virtual Statement * mutate( IfStmt * ifStmt );
    41         virtual Statement * mutate( WhileStmt * whileStmt );
    42         virtual Statement * mutate( ForStmt * forStmt );
    43         virtual Statement * mutate( SwitchStmt * switchStmt );
    44         virtual Statement * mutate( CaseStmt * caseStmt );
    45         virtual Statement * mutate( BranchStmt * branchStmt );
    46         virtual Statement * mutate( ReturnStmt * returnStmt );
    47         virtual Statement * mutate( ThrowStmt * throwStmt );
    48         virtual Statement * mutate( TryStmt * tryStmt );
    49         virtual Statement * mutate( CatchStmt * catchStmt );
    50         virtual Statement * mutate( FinallyStmt * catchStmt );
    51         virtual Statement * mutate( WaitForStmt * waitforStmt );
    52         virtual NullStmt * mutate( NullStmt * nullStmt );
    53         virtual Statement * mutate( DeclStmt * declStmt );
    54         virtual Statement * mutate( ImplicitCtorDtorStmt * impCtorDtorStmt );
     37        virtual CompoundStmt* mutate( CompoundStmt *compoundStmt );
     38        virtual Statement* mutate( ExprStmt *exprStmt );
     39        virtual Statement* mutate( AsmStmt *asmStmt );
     40        virtual Statement* mutate( IfStmt *ifStmt );
     41        virtual Statement* mutate( WhileStmt *whileStmt );
     42        virtual Statement* mutate( ForStmt *forStmt );
     43        virtual Statement* mutate( SwitchStmt *switchStmt );
     44        virtual Statement* mutate( CaseStmt *caseStmt );
     45        virtual Statement* mutate( BranchStmt *branchStmt );
     46        virtual Statement* mutate( ReturnStmt *returnStmt );
     47        virtual Statement* mutate( ThrowStmt *throwStmt );
     48        virtual Statement* mutate( TryStmt *tryStmt );
     49        virtual Statement* mutate( CatchStmt *catchStmt );
     50        virtual Statement* mutate( FinallyStmt *catchStmt );
     51        virtual Statement* mutate( WaitForStmt *waitforStmt );
     52        virtual NullStmt* mutate( NullStmt *nullStmt );
     53        virtual Statement* mutate( DeclStmt *declStmt );
     54        virtual Statement* mutate( ImplicitCtorDtorStmt *impCtorDtorStmt );
    5555
    56         virtual Expression* mutate( ApplicationExpr * applicationExpr );
    57         virtual Expression* mutate( UntypedExpr * untypedExpr );
    58         virtual Expression* mutate( NameExpr * nameExpr );
    59         virtual Expression* mutate( AddressExpr * castExpr );
    60         virtual Expression* mutate( LabelAddressExpr * labAddressExpr );
    61         virtual Expression* mutate( CastExpr * castExpr );
    62         virtual Expression* mutate( VirtualCastExpr * castExpr );
    63         virtual Expression* mutate( UntypedMemberExpr * memberExpr );
    64         virtual Expression* mutate( MemberExpr * memberExpr );
    65         virtual Expression* mutate( VariableExpr * variableExpr );
    66         virtual Expression* mutate( ConstantExpr * constantExpr );
    67         virtual Expression* mutate( SizeofExpr * sizeofExpr );
    68         virtual Expression* mutate( AlignofExpr * alignofExpr );
    69         virtual Expression* mutate( UntypedOffsetofExpr * offsetofExpr );
    70         virtual Expression* mutate( OffsetofExpr * offsetofExpr );
    71         virtual Expression* mutate( OffsetPackExpr * offsetPackExpr );
    72         virtual Expression* mutate( AttrExpr * attrExpr );
    73         virtual Expression* mutate( LogicalExpr * logicalExpr );
    74         virtual Expression* mutate( ConditionalExpr * conditionalExpr );
    75         virtual Expression* mutate( CommaExpr * commaExpr );
    76         virtual Expression* mutate( TypeExpr * typeExpr );
    77         virtual Expression* mutate( AsmExpr * asmExpr );
    78         virtual Expression* mutate( ImplicitCopyCtorExpr * impCpCtorExpr );
    79         virtual Expression* mutate( ConstructorExpr * ctorExpr );
    80         virtual Expression* mutate( CompoundLiteralExpr * compLitExpr );
    81         virtual Expression* mutate( RangeExpr * rangeExpr );
    82         virtual Expression* mutate( UntypedTupleExpr * tupleExpr );
    83         virtual Expression* mutate( TupleExpr * tupleExpr );
    84         virtual Expression* mutate( TupleIndexExpr * tupleExpr );
    85         virtual Expression* mutate( TupleAssignExpr * assignExpr );
    86         virtual Expression* mutate( StmtExpr  * stmtExpr );
    87         virtual Expression* mutate( UniqueExpr  * uniqueExpr );
    88         virtual Expression* mutate( UntypedInitExpr  * initExpr );
    89         virtual Expression* mutate( InitExpr  * initExpr );
     56        virtual Expression* mutate( ApplicationExpr *applicationExpr );
     57        virtual Expression* mutate( UntypedExpr *untypedExpr );
     58        virtual Expression* mutate( NameExpr *nameExpr );
     59        virtual Expression* mutate( AddressExpr *castExpr );
     60        virtual Expression* mutate( LabelAddressExpr *labAddressExpr );
     61        virtual Expression* mutate( CastExpr *castExpr );
     62        virtual Expression* mutate( VirtualCastExpr *castExpr );
     63        virtual Expression* mutate( UntypedMemberExpr *memberExpr );
     64        virtual Expression* mutate( MemberExpr *memberExpr );
     65        virtual Expression* mutate( VariableExpr *variableExpr );
     66        virtual Expression* mutate( ConstantExpr *constantExpr );
     67        virtual Expression* mutate( SizeofExpr *sizeofExpr );
     68        virtual Expression* mutate( AlignofExpr *alignofExpr );
     69        virtual Expression* mutate( UntypedOffsetofExpr *offsetofExpr );
     70        virtual Expression* mutate( OffsetofExpr *offsetofExpr );
     71        virtual Expression* mutate( OffsetPackExpr *offsetPackExpr );
     72        virtual Expression* mutate( AttrExpr *attrExpr );
     73        virtual Expression* mutate( LogicalExpr *logicalExpr );
     74        virtual Expression* mutate( ConditionalExpr *conditionalExpr );
     75        virtual Expression* mutate( CommaExpr *commaExpr );
     76        virtual Expression* mutate( TypeExpr *typeExpr );
     77        virtual Expression* mutate( AsmExpr *asmExpr );
     78        virtual Expression* mutate( ImplicitCopyCtorExpr *impCpCtorExpr );
     79        virtual Expression* mutate( ConstructorExpr *ctorExpr );
     80        virtual Expression* mutate( CompoundLiteralExpr *compLitExpr );
     81        virtual Expression* mutate( RangeExpr *rangeExpr );
     82        virtual Expression* mutate( UntypedTupleExpr *tupleExpr );
     83        virtual Expression* mutate( TupleExpr *tupleExpr );
     84        virtual Expression* mutate( TupleIndexExpr *tupleExpr );
     85        virtual Expression* mutate( TupleAssignExpr *assignExpr );
     86        virtual Expression* mutate( StmtExpr * stmtExpr );
     87        virtual Expression* mutate( UniqueExpr * uniqueExpr );
     88        virtual Expression* mutate( UntypedInitExpr * initExpr );
     89        virtual Expression* mutate( InitExpr * initExpr );
    9090
    91         virtual Type * mutate( VoidType * basicType );
    92         virtual Type * mutate( BasicType * basicType );
    93         virtual Type * mutate( PointerType * pointerType );
    94         virtual Type * mutate( ArrayType * arrayType );
    95         virtual Type * mutate( ReferenceType * refType );
    96         virtual Type * mutate( FunctionType * functionType );
    97         virtual Type * mutate( StructInstType * aggregateUseType );
    98         virtual Type * mutate( UnionInstType * aggregateUseType );
    99         virtual Type * mutate( EnumInstType * aggregateUseType );
    100         virtual Type * mutate( TraitInstType * aggregateUseType );
    101         virtual Type * mutate( TypeInstType * aggregateUseType );
    102         virtual Type * mutate( TupleType * tupleType );
    103         virtual Type * mutate( TypeofType * typeofType );
    104         virtual Type * mutate( AttrType * attrType );
    105         virtual Type * mutate( VarArgsType * varArgsType );
    106         virtual Type * mutate( ZeroType * zeroType );
    107         virtual Type * mutate( OneType * oneType );
     91        virtual Type* mutate( VoidType *basicType );
     92        virtual Type* mutate( BasicType *basicType );
     93        virtual Type* mutate( PointerType *pointerType );
     94        virtual Type* mutate( ArrayType *arrayType );
     95        virtual Type* mutate( ReferenceType *refType );
     96        virtual Type* mutate( FunctionType *functionType );
     97        virtual Type* mutate( StructInstType *aggregateUseType );
     98        virtual Type* mutate( UnionInstType *aggregateUseType );
     99        virtual Type* mutate( EnumInstType *aggregateUseType );
     100        virtual Type* mutate( TraitInstType *aggregateUseType );
     101        virtual Type* mutate( TypeInstType *aggregateUseType );
     102        virtual Type* mutate( TupleType *tupleType );
     103        virtual Type* mutate( TypeofType *typeofType );
     104        virtual Type* mutate( AttrType *attrType );
     105        virtual Type* mutate( VarArgsType *varArgsType );
     106        virtual Type* mutate( ZeroType *zeroType );
     107        virtual Type* mutate( OneType *oneType );
    108108
    109         virtual Designation * mutate( Designation * designation );
    110         virtual Initializer * mutate( SingleInit * singleInit );
    111         virtual Initializer * mutate( ListInit * listInit );
    112         virtual Initializer * mutate( ConstructorInit * ctorInit );
     109        virtual Designation* mutate( Designation *designation );
     110        virtual Initializer* mutate( SingleInit *singleInit );
     111        virtual Initializer* mutate( ListInit *listInit );
     112        virtual Initializer* mutate( ConstructorInit *ctorInit );
    113113
    114         virtual Subrange * mutate( Subrange * subrange );
     114        virtual Subrange *mutate( Subrange *subrange );
    115115
    116         virtual Constant * mutate( Constant * constant );
    117 
    118         virtual Attribute * mutate( Attribute * attribute );
     116        virtual Constant *mutate( Constant *constant );
    119117  private:
    120         virtual Declaration * handleAggregateDecl(AggregateDecl * aggregateDecl );
    121         virtual Declaration * handleNamedTypeDecl(NamedTypeDecl * typeDecl );
    122         virtual Type * handleReferenceToType(ReferenceToType * aggregateUseType );
     118        virtual Declaration* handleAggregateDecl(AggregateDecl *aggregateDecl );
     119        virtual Declaration* handleNamedTypeDecl(NamedTypeDecl *typeDecl );
     120        virtual Type* handleReferenceToType(ReferenceToType *aggregateUseType );
    123121};
    124122
  • src/SynTree/Statement.h

    r6e49f18 ra6c5d7c  
    4343        const std::list<Label> & get_labels() const { return labels; }
    4444
    45         virtual Statement *clone() const override = 0;
     45        virtual Statement *clone() const = 0;
    4646        virtual void accept( Visitor &v ) override = 0;
    47         virtual Statement *acceptMutator( Mutator &m ) override = 0;
     47        virtual Statement *acceptMutator( Mutator &m ) = 0;
    4848        virtual void print( std::ostream &os, int indent = 0 ) const override;
    4949};
  • src/SynTree/VarExprReplacer.h

    r6e49f18 ra6c5d7c  
    2929private:
    3030        const DeclMap & declMap;
    31         bool debug;
     31  bool debug;
    3232public:
    3333        VarExprReplacer( const DeclMap & declMap, bool debug = false );
     
    3535        // replace variable with new node from decl map
    3636        virtual void visit( VariableExpr * varExpr );
    37 
    38         static void replace( BaseSyntaxNode * node, const DeclMap & declMap, bool debug = false ) {
    39                 VarExprReplacer replacer( declMap, debug );
    40                 maybeAccept( node, replacer );
    41         }
    4237};
    4338
  • src/SynTree/Visitor.cc

    r6e49f18 ra6c5d7c  
    1717#include <list>           // for list
    1818
    19 #include "Attribute.h"    // for Attribute
    2019#include "Constant.h"     // for Constant
    2120#include "Declaration.h"  // for DeclarationWithType, ObjectDecl, Declaration
     
    3635        maybeAccept( objectDecl->get_init(), *this );
    3736        maybeAccept( objectDecl->get_bitfieldWidth(), *this );
    38         acceptAll( objectDecl->attributes, *this );
    3937}
    4038
     
    4240        maybeAccept( functionDecl->get_functionType(), *this );
    4341        maybeAccept( functionDecl->get_statements(), *this );
    44         acceptAll( functionDecl->attributes, *this );
    4542}
    4643
     
    490487
    491488
    492 void Visitor::visit( Subrange * ) {}
    493 
    494 
    495 void Visitor::visit( Constant * ) {}
    496 
    497 void Visitor::visit( Attribute * attribute ) {
    498         acceptAll( attribute->parameters, *this );
    499 }
    500 
     489void Visitor::visit( __attribute__((unused)) Subrange *subrange ) {}
     490
     491
     492void Visitor::visit( __attribute__((unused)) Constant *constant ) {}
    501493// Local Variables: //
    502494// tab-width: 4 //
  • src/SynTree/Visitor.h

    r6e49f18 ra6c5d7c  
    2727        // of the given syntax node, but performs no other action.
    2828
    29         virtual void visit( ObjectDecl * objectDecl );
    30         virtual void visit( FunctionDecl * functionDecl );
    31         virtual void visit( StructDecl * aggregateDecl );
    32         virtual void visit( UnionDecl * aggregateDecl );
    33         virtual void visit( EnumDecl * aggregateDecl );
    34         virtual void visit( TraitDecl * aggregateDecl );
    35         virtual void visit( TypeDecl * typeDecl );
    36         virtual void visit( TypedefDecl * typeDecl );
    37         virtual void visit( AsmDecl * asmDecl );
     29        virtual void visit( ObjectDecl *objectDecl );
     30        virtual void visit( FunctionDecl *functionDecl );
     31        virtual void visit( StructDecl *aggregateDecl );
     32        virtual void visit( UnionDecl *aggregateDecl );
     33        virtual void visit( EnumDecl *aggregateDecl );
     34        virtual void visit( TraitDecl *aggregateDecl );
     35        virtual void visit( TypeDecl *typeDecl );
     36        virtual void visit( TypedefDecl *typeDecl );
     37        virtual void visit( AsmDecl *asmDecl );
    3838
    39         virtual void visit( CompoundStmt * compoundStmt );
    40         virtual void visit( ExprStmt * exprStmt );
    41         virtual void visit( AsmStmt * asmStmt );
    42         virtual void visit( IfStmt * ifStmt );
    43         virtual void visit( WhileStmt * whileStmt );
    44         virtual void visit( ForStmt * forStmt );
    45         virtual void visit( SwitchStmt * switchStmt );
    46         virtual void visit( CaseStmt * caseStmt );
    47         virtual void visit( BranchStmt * branchStmt );
    48         virtual void visit( ReturnStmt * returnStmt );
    49         virtual void visit( ThrowStmt * throwStmt );
    50         virtual void visit( TryStmt * tryStmt );
    51         virtual void visit( CatchStmt * catchStmt );
    52         virtual void visit( FinallyStmt * finallyStmt );
    53         virtual void visit( WaitForStmt * waitforStmt );
    54         virtual void visit( NullStmt * nullStmt );
    55         virtual void visit( DeclStmt * declStmt );
    56         virtual void visit( ImplicitCtorDtorStmt * impCtorDtorStmt );
     39        virtual void visit( CompoundStmt *compoundStmt );
     40        virtual void visit( ExprStmt *exprStmt );
     41        virtual void visit( AsmStmt *asmStmt );
     42        virtual void visit( IfStmt *ifStmt );
     43        virtual void visit( WhileStmt *whileStmt );
     44        virtual void visit( ForStmt *forStmt );
     45        virtual void visit( SwitchStmt *switchStmt );
     46        virtual void visit( CaseStmt *caseStmt );
     47        virtual void visit( BranchStmt *branchStmt );
     48        virtual void visit( ReturnStmt *returnStmt );
     49        virtual void visit( ThrowStmt *throwStmt );
     50        virtual void visit( TryStmt *tryStmt );
     51        virtual void visit( CatchStmt *catchStmt );
     52        virtual void visit( FinallyStmt *finallyStmt );
     53        virtual void visit( WaitForStmt *waitforStmt );
     54        virtual void visit( NullStmt *nullStmt );
     55        virtual void visit( DeclStmt *declStmt );
     56        virtual void visit( ImplicitCtorDtorStmt *impCtorDtorStmt );
    5757
    58         virtual void visit( ApplicationExpr * applicationExpr );
    59         virtual void visit( UntypedExpr * untypedExpr );
    60         virtual void visit( NameExpr * nameExpr );
    61         virtual void visit( CastExpr * castExpr );
    62         virtual void visit( VirtualCastExpr * castExpr );
    63         virtual void visit( AddressExpr * addressExpr );
    64         virtual void visit( LabelAddressExpr * labAddressExpr );
    65         virtual void visit( UntypedMemberExpr * memberExpr );
    66         virtual void visit( MemberExpr * memberExpr );
    67         virtual void visit( VariableExpr * variableExpr );
    68         virtual void visit( ConstantExpr * constantExpr );
    69         virtual void visit( SizeofExpr * sizeofExpr );
    70         virtual void visit( AlignofExpr * alignofExpr );
    71         virtual void visit( UntypedOffsetofExpr * offsetofExpr );
    72         virtual void visit( OffsetofExpr * offsetofExpr );
    73         virtual void visit( OffsetPackExpr * offsetPackExpr );
    74         virtual void visit( AttrExpr * attrExpr );
    75         virtual void visit( LogicalExpr * logicalExpr );
    76         virtual void visit( ConditionalExpr * conditionalExpr );
    77         virtual void visit( CommaExpr * commaExpr );
    78         virtual void visit( TypeExpr * typeExpr );
    79         virtual void visit( AsmExpr * asmExpr );
    80         virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr );
    81         virtual void visit( ConstructorExpr *  ctorExpr );
    82         virtual void visit( CompoundLiteralExpr * compLitExpr );
    83         virtual void visit( RangeExpr * rangeExpr );
    84         virtual void visit( UntypedTupleExpr * tupleExpr );
    85         virtual void visit( TupleExpr * tupleExpr );
    86         virtual void visit( TupleIndexExpr * tupleExpr );
    87         virtual void visit( TupleAssignExpr * assignExpr );
    88         virtual void visit( StmtExpr *  stmtExpr );
    89         virtual void visit( UniqueExpr *  uniqueExpr );
    90         virtual void visit( UntypedInitExpr *  initExpr );
    91         virtual void visit( InitExpr *  initExpr );
     58        virtual void visit( ApplicationExpr *applicationExpr );
     59        virtual void visit( UntypedExpr *untypedExpr );
     60        virtual void visit( NameExpr *nameExpr );
     61        virtual void visit( CastExpr *castExpr );
     62        virtual void visit( VirtualCastExpr *castExpr );
     63        virtual void visit( AddressExpr *addressExpr );
     64        virtual void visit( LabelAddressExpr *labAddressExpr );
     65        virtual void visit( UntypedMemberExpr *memberExpr );
     66        virtual void visit( MemberExpr *memberExpr );
     67        virtual void visit( VariableExpr *variableExpr );
     68        virtual void visit( ConstantExpr *constantExpr );
     69        virtual void visit( SizeofExpr *sizeofExpr );
     70        virtual void visit( AlignofExpr *alignofExpr );
     71        virtual void visit( UntypedOffsetofExpr *offsetofExpr );
     72        virtual void visit( OffsetofExpr *offsetofExpr );
     73        virtual void visit( OffsetPackExpr *offsetPackExpr );
     74        virtual void visit( AttrExpr *attrExpr );
     75        virtual void visit( LogicalExpr *logicalExpr );
     76        virtual void visit( ConditionalExpr *conditionalExpr );
     77        virtual void visit( CommaExpr *commaExpr );
     78        virtual void visit( TypeExpr *typeExpr );
     79        virtual void visit( AsmExpr *asmExpr );
     80        virtual void visit( ImplicitCopyCtorExpr *impCpCtorExpr );
     81        virtual void visit( ConstructorExpr * ctorExpr );
     82        virtual void visit( CompoundLiteralExpr *compLitExpr );
     83        virtual void visit( RangeExpr *rangeExpr );
     84        virtual void visit( UntypedTupleExpr *tupleExpr );
     85        virtual void visit( TupleExpr *tupleExpr );
     86        virtual void visit( TupleIndexExpr *tupleExpr );
     87        virtual void visit( TupleAssignExpr *assignExpr );
     88        virtual void visit( StmtExpr * stmtExpr );
     89        virtual void visit( UniqueExpr * uniqueExpr );
     90        virtual void visit( UntypedInitExpr * initExpr );
     91        virtual void visit( InitExpr * initExpr );
    9292
    93         virtual void visit( VoidType * basicType );
    94         virtual void visit( BasicType * basicType );
    95         virtual void visit( PointerType * pointerType );
    96         virtual void visit( ArrayType * arrayType );
    97         virtual void visit( ReferenceType * refType );
    98         virtual void visit( FunctionType * functionType );
    99         virtual void visit( StructInstType * aggregateUseType );
    100         virtual void visit( UnionInstType * aggregateUseType );
    101         virtual void visit( EnumInstType * aggregateUseType );
    102         virtual void visit( TraitInstType * aggregateUseType );
    103         virtual void visit( TypeInstType * aggregateUseType );
    104         virtual void visit( TupleType * tupleType );
    105         virtual void visit( TypeofType * typeofType );
    106         virtual void visit( AttrType * attrType );
    107         virtual void visit( VarArgsType * varArgsType );
    108         virtual void visit( ZeroType * zeroType );
    109         virtual void visit( OneType * oneType );
     93        virtual void visit( VoidType *basicType );
     94        virtual void visit( BasicType *basicType );
     95        virtual void visit( PointerType *pointerType );
     96        virtual void visit( ArrayType *arrayType );
     97        virtual void visit( ReferenceType *refType );
     98        virtual void visit( FunctionType *functionType );
     99        virtual void visit( StructInstType *aggregateUseType );
     100        virtual void visit( UnionInstType *aggregateUseType );
     101        virtual void visit( EnumInstType *aggregateUseType );
     102        virtual void visit( TraitInstType *aggregateUseType );
     103        virtual void visit( TypeInstType *aggregateUseType );
     104        virtual void visit( TupleType *tupleType );
     105        virtual void visit( TypeofType *typeofType );
     106        virtual void visit( AttrType *attrType );
     107        virtual void visit( VarArgsType *varArgsType );
     108        virtual void visit( ZeroType *zeroType );
     109        virtual void visit( OneType *oneType );
    110110
    111         virtual void visit( Designation * designation );
    112         virtual void visit( SingleInit * singleInit );
    113         virtual void visit( ListInit * listInit );
    114         virtual void visit( ConstructorInit * ctorInit );
     111        virtual void visit( Designation *designation );
     112        virtual void visit( SingleInit *singleInit );
     113        virtual void visit( ListInit *listInit );
     114        virtual void visit( ConstructorInit *ctorInit );
    115115
    116         virtual void visit( Subrange * subrange );
     116        virtual void visit( Subrange *subrange );
    117117
    118         virtual void visit( Constant * constant );
    119 
    120         virtual void visit( Attribute * attribute );
     118        virtual void visit( Constant *constant );
    121119  private:
    122120        virtual void handleAggregateDecl( AggregateDecl *aggregateDecl );
  • src/libcfa/concurrency/invoke.h

    r6e49f18 ra6c5d7c  
    110110            struct monitor_desc    self_mon;          // monitor body used for mutual exclusion
    111111            struct monitor_desc *  self_mon_p;        // pointer to monitor with sufficient lifetime for current monitors
    112             struct __monitor_group_t monitors;        // monitors currently held by this thread
     112            struct __monitor_group_t monitors;          // monitors currently held by this thread
    113113
    114114            // Link lists fields
  • src/tests/sched-ext-barge.c

    r6e49f18 ra6c5d7c  
    1 //---------------------------------------------------------
    2 // Barging test
    3 // Ensures that no barging can occur between :
    4 //   - the frontend of the waitfor and the waited call
    5 //   - the waited call and the backend of the waitfor
    6 //---------------------------------------------------------
    7 
    81#include <fstream>
    92#include <kernel>
  • src/tests/sched-ext-parse.c

    r6e49f18 ra6c5d7c  
    1 //----------------------------------------------------------------------------------------
    2 //----------------------------------------------------------------------------------------
    3 //
    4 //              DEPRECATED TEST
    5 //              DIFFERS BETWEEN DEBUG AND RELEASE
    6 //
    7 //----------------------------------------------------------------------------------------
    8 //----------------------------------------------------------------------------------------
    9 
    101#include <monitor>
    112
  • src/tests/sched-int-barge.c

    r6e49f18 ra6c5d7c  
    1 //----------------------------------------------------------------------------------------
    2 //----------------------------------------------------------------------------------------
    3 //
    4 //              DEPRECATED TEST
    5 //
    6 //----------------------------------------------------------------------------------------
    7 //----------------------------------------------------------------------------------------
    8 
    91#include <fstream>
    102#include <kernel>
  • src/tests/sched-int-block.c

    r6e49f18 ra6c5d7c  
    1 //---------------------------------------------------------
    2 // Barging test
    3 // Ensures that no barging can occur between :
    4 //   - the frontend of the signal_block and the signaled thread
    5 //   - the signaled  threadand the backend of the signal_block
    6 //---------------------------------------------------------
    7 
    8 
    91#include <fstream>
    102#include <kernel>
  • src/tests/sched-int-wait.c

    r6e49f18 ra6c5d7c  
    1 //---------------------------------------------------------
    2 // Multi wait test
    3 // Ensures that no deadlock from waiting/signalling conditions
    4 //---------------------------------------------------------
    5 
    6 
    71#include <fstream>
    82#include <kernel>
Note: See TracChangeset for help on using the changeset viewer.