Changes in / [6e49f18:a6c5d7c]
- Location:
- src
- Files:
-
- 3 added
- 5 deleted
- 29 edited
-
CodeGen/CodeGenerator.cc (modified) (2 diffs)
-
CodeGen/CodeGenerator.h (modified) (1 diff)
-
Common/PassVisitor.h (modified) (2 diffs)
-
Common/PassVisitor.impl.h (modified) (6 diffs)
-
InitTweak/FixInit.cc (modified) (5 diffs)
-
InitTweak/InitTweak.cc (modified) (1 diff)
-
InitTweak/InitTweak.h (modified) (1 diff)
-
ResolvExpr/AlternativeFinder.cc (modified) (6 diffs)
-
ResolvExpr/AlternativeFinder.h (modified) (1 diff)
-
SymTab/Autogen.cc (modified) (1 diff)
-
SymTab/Autogen.h (modified) (1 diff)
-
SynTree/Attribute.h (modified) (2 diffs)
-
SynTree/BaseSyntaxNode.h (modified) (2 diffs)
-
SynTree/Declaration.h (modified) (2 diffs)
-
SynTree/Expression.h (modified) (1 diff)
-
SynTree/FunctionDecl.cc (modified) (3 diffs)
-
SynTree/Initializer.h (modified) (4 diffs)
-
SynTree/Mutator.cc (modified) (4 diffs)
-
SynTree/Mutator.h (modified) (1 diff)
-
SynTree/Statement.h (modified) (1 diff)
-
SynTree/VarExprReplacer.h (modified) (2 diffs)
-
SynTree/Visitor.cc (modified) (4 diffs)
-
SynTree/Visitor.h (modified) (1 diff)
-
libcfa/concurrency/invoke.h (modified) (1 diff)
-
tests/.expect/32/sched-ext-parse.txt (added)
-
tests/.expect/64/sched-ext-parse.txt (added)
-
tests/.expect/concurrent/sched-ext-else.txt (deleted)
-
tests/.expect/concurrent/sched-ext-recurse.txt (deleted)
-
tests/.expect/concurrent/sched-ext-when.txt (deleted)
-
tests/.expect/sched-ext-else.txt (added)
-
tests/sched-ext-barge.c (modified) (1 diff)
-
tests/sched-ext-parse.c (modified) (1 diff)
-
tests/sched-ext-recurse.c (deleted)
-
tests/sched-ext-when.c (deleted)
-
tests/sched-int-barge.c (modified) (1 diff)
-
tests/sched-int-block.c (modified) (1 diff)
-
tests/sched-int-wait.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r6e49f18 ra6c5d7c 540 540 extension( nameExpr ); 541 541 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; 548 545 } else { 549 546 output << nameExpr->get_name(); … … 946 943 output << ";"; 947 944 } 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 1011 945 1012 946 void CodeGenerator::postvisit( WhileStmt * whileStmt ) { -
src/CodeGen/CodeGenerator.h
r6e49f18 ra6c5d7c 100 100 void postvisit( ReturnStmt * ); 101 101 void postvisit( ThrowStmt * ); 102 void postvisit( CatchStmt * );103 void postvisit( WaitForStmt * );104 102 void postvisit( WhileStmt * ); 105 103 void postvisit( ForStmt * ); -
src/Common/PassVisitor.h
r6e49f18 ra6c5d7c 10 10 #include "SymTab/Indexer.h" 11 11 12 #include "SynTree/Attribute.h"13 12 #include "SynTree/Initializer.h" 14 13 #include "SynTree/Statement.h" … … 54 53 pass_type pass; 55 54 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; 237 232 238 233 private: -
src/Common/PassVisitor.impl.h
r6e49f18 ra6c5d7c 321 321 maybeAccept ( node->init , *this ); 322 322 maybeAccept ( node->bitfieldWidth, *this ); 323 maybeAccept ( node->attributes , *this );324 323 325 324 if ( node->name != "" ) { … … 337 336 maybeMutateRef ( node->init , *this ); 338 337 maybeMutateRef ( node->bitfieldWidth, *this ); 339 maybeMutateRef ( node->attributes , *this );340 338 341 339 if ( node->name != "" ) { … … 360 358 maybeAccept( node->type, *this ); 361 359 maybeAccept( node->statements, *this ); 362 maybeAccept( node->attributes, *this );363 360 } 364 361 … … 378 375 maybeMutateRef( node->type, *this ); 379 376 maybeMutateRef( node->statements, *this ); 380 maybeMutateRef( node->attributes, *this );381 377 } 382 378 … … 1988 1984 } 1989 1985 1990 template< typename pass_type >1991 void PassVisitor< pass_type >::visit( Attribute * node ) {1992 VISIT_BODY( node );1993 }1994 1995 1986 //--------------------------------------------------------------------------------------------------------------- 1996 1987 template< typename pass_type > … … 2078 2069 MUTATE_BODY( Constant, node ); 2079 2070 } 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 214 214 void emit( CodeLocation, const Params &... params ); 215 215 216 FunctionDecl * function = nullptr;216 FunctionDecl * function = 0; 217 217 std::set< DeclarationWithType * > unhandled; 218 218 std::map< DeclarationWithType *, CodeLocation > usedUninit; 219 ObjectDecl * thisParam = nullptr;219 ObjectDecl * thisParam = 0; 220 220 bool isCtor = false; // true if current function is a constructor 221 StructDecl * structDecl = nullptr;221 StructDecl * structDecl = 0; 222 222 }; 223 223 … … 624 624 } 625 625 626 DeclarationWithType * FixInit::postmutate( ObjectDecl *objDecl ) {626 DeclarationWithType *FixInit::postmutate( ObjectDecl *objDecl ) { 627 627 // since this removes the init field from objDecl, it must occur after children are mutated (i.e. postmutate) 628 628 if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) { … … 722 722 } else { 723 723 ImplicitCtorDtorStmt * implicit = strict_dynamic_cast< ImplicitCtorDtorStmt * > ( ctor ); 724 ExprStmt * ctorStmt = dynamic_cast< ExprStmt * >( implicit-> callStmt);724 ExprStmt * ctorStmt = dynamic_cast< ExprStmt * >( implicit->get_callStmt() ); 725 725 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 ) { 727 727 // 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(); 730 730 } else { 731 731 stmtsToAddAfter.push_back( ctor ); 732 objDecl-> init = nullptr;733 ctorInit-> ctor = nullptr;732 objDecl->set_init( nullptr ); 733 ctorInit->set_ctor( nullptr ); 734 734 } 735 735 } // 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 ); 739 739 } else { 740 740 // no constructor and no initializer, which is okay 741 objDecl-> init = nullptr;741 objDecl->set_init( nullptr ); 742 742 } // if 743 743 delete ctorInit; … … 912 912 } 913 913 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 927 914 void GenStructMemberCalls::previsit( FunctionDecl * funcDecl ) { 928 GuardValue( func tion);915 GuardValue( funcDecl ); 929 916 GuardValue( unhandled ); 930 917 GuardValue( usedUninit ); … … 959 946 } 960 947 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 961 961 void GenStructMemberCalls::postvisit( FunctionDecl * funcDecl ) { 962 962 // remove the unhandled objects from usedUninit, because a call is inserted -
src/InitTweak/InitTweak.cc
r6e49f18 ra6c5d7c 270 270 } 271 271 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 286 272 bool tryConstruct( DeclarationWithType * dwt ) { 287 273 ObjectDecl * objDecl = dynamic_cast< ObjectDecl * >( dwt ); -
src/InitTweak/InitTweak.h
r6e49f18 ra6c5d7c 29 29 FunctionDecl * isCopyConstructor( Declaration * decl ); 30 30 FunctionDecl * isCopyFunction( Declaration * decl, const std::string & fname ); 31 32 /// returns the base type of the first parameter to a constructor/destructor/assignment function33 Type * getThisType( FunctionType * ftype );34 35 /// returns the first parameter of a constructor/destructor/assignment function36 ObjectDecl * getThisParam( FunctionType * ftype );37 31 38 32 /// transform Initializer into an argument list that can be passed to a call expression -
src/ResolvExpr/AlternativeFinder.cc
r6e49f18 ra6c5d7c 174 174 } 175 175 176 void AlternativeFinder::find( Expression *expr, bool adjust, bool prune , bool failFast) {176 void AlternativeFinder::find( Expression *expr, bool adjust, bool prune ) { 177 177 expr->accept( *this ); 178 if ( failFast &&alternatives.empty() ) {178 if ( alternatives.empty() ) { 179 179 throw SemanticError( "No reasonable alternatives for expression ", expr ); 180 180 } … … 191 191 AltList::iterator oldBegin = alternatives.begin(); 192 192 pruneAlternatives( alternatives.begin(), alternatives.end(), front_inserter( alternatives ) ); 193 if ( failFast &&alternatives.begin() == oldBegin ) {193 if ( alternatives.begin() == oldBegin ) { 194 194 std::ostringstream stream; 195 195 AltList winners; … … 214 214 } 215 215 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 ); 226 218 } 227 219 … … 722 714 723 715 // find function operators 724 static NameExpr *opExpr = new NameExpr( "?()" );725 716 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 } 728 723 PRINT( 729 724 std::cerr << "known function ops:" << std::endl; … … 933 928 AlternativeFinder finder( indexer, env ); 934 929 // 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 ); 936 932 for ( Alternative & alt : finder.alternatives ) { 937 933 alternatives.push_back( Alternative( … … 1230 1226 // don't prune here, since it's guaranteed all alternatives will have the same type 1231 1227 // (giving the alternatives different types is half of the point of ConstructorExpr nodes) 1232 finder.findWith outPrune( ctorExpr->get_callExpr());1228 finder.findWithAdjustment( ctorExpr->get_callExpr(), false ); 1233 1229 for ( Alternative & alt : finder.alternatives ) { 1234 1230 alternatives.push_back( Alternative( new ConstructorExpr( alt.expr->clone() ), alt.env, alt.cost ) ); -
src/ResolvExpr/AlternativeFinder.h
r6e49f18 ra6c5d7c 34 34 public: 35 35 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 ); 37 37 /// 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 ); 43 39 AltList &get_alternatives() { return alternatives; } 44 40 -
src/SymTab/Autogen.cc
r6e49f18 ra6c5d7c 119 119 ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), paramType->clone() ), nullptr ); 120 120 ftype->get_parameters().push_back( dstParam ); 121 121 122 return ftype; 122 123 } -
src/SymTab/Autogen.h
r6e49f18 ra6c5d7c 44 44 extern FunctionDecl * dereferenceOperator; 45 45 46 // generate the type of an assignment function for paramType46 // temporary 47 47 FunctionType * genAssignType( Type * paramType ); 48 49 // generate the type of a default constructor or destructor for paramType50 FunctionType * genDefaultType( Type * paramType );51 52 // generate the type of a copy constructor for paramType53 FunctionType * genCopyType( Type * paramType );54 48 55 49 /// 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 20 20 #include <string> // for string, operator== 21 21 22 #include "BaseSyntaxNode.h"23 #include "Mutator.h"24 #include "Visitor.h"25 26 22 class Expression; 27 23 28 24 // GCC attribute 29 25 // https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/Attribute-Syntax.html#Attribute-Syntax 30 class Attribute : public BaseSyntaxNode{26 class Attribute { 31 27 public: 32 std::string name;33 // to keep things nice and tight, use NameExpr for special identifier parameters34 std::list< Expression * > parameters;35 36 28 Attribute( std::string name = "", const std::list< Expression * > & parameters = std::list< Expression * >() ) : name( name ), parameters( parameters ) {} 37 29 Attribute( const Attribute &other ); … … 43 35 bool empty() const { return name == ""; } 44 36 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; 49 43 }; 50 44 -
src/SynTree/BaseSyntaxNode.h
r6e49f18 ra6c5d7c 18 18 #include "Common/CodeLocation.h" 19 19 class Visitor; 20 class Mutator;21 20 22 21 class BaseSyntaxNode { … … 26 25 virtual ~BaseSyntaxNode() {} 27 26 28 virtual BaseSyntaxNode * clone() const = 0;29 27 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; 32 29 }; 33 30 -
src/SynTree/Declaration.h
r6e49f18 ra6c5d7c 61 61 62 62 void fixUniqueId( void ); 63 virtual Declaration *clone() const override= 0;63 virtual Declaration *clone() const = 0; 64 64 virtual void accept( Visitor &v ) override = 0; 65 virtual Declaration *acceptMutator( Mutator &m ) override= 0;65 virtual Declaration *acceptMutator( Mutator &m ) = 0; 66 66 virtual void print( std::ostream &os, int indent = 0 ) const override = 0; 67 67 virtual void printShort( std::ostream &os, int indent = 0 ) const = 0; … … 164 164 CompoundStmt *get_statements() const { return statements; } 165 165 void set_statements( CompoundStmt *newValue ) { statements = newValue; } 166 167 static FunctionDecl * newFunction( const std::string & name, FunctionType * type, CompoundStmt * statements );168 166 169 167 virtual FunctionDecl *clone() const override { return new FunctionDecl( *this ); } -
src/SynTree/Expression.h
r6e49f18 ra6c5d7c 55 55 Expression * set_extension( bool exten ) { extension = exten; return this; } 56 56 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; 61 61 }; 62 62 -
src/SynTree/FunctionDecl.cc
r6e49f18 ra6c5d7c 26 26 #include "Statement.h" // for CompoundStmt 27 27 #include "Type.h" // for Type, FunctionType, Type::FuncSpecif... 28 #include "VarExprReplacer.h"29 28 30 29 extern bool translation_unit_nomain; … … 40 39 FunctionDecl::FunctionDecl( const FunctionDecl &other ) 41 40 : 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 }54 41 } 55 42 … … 57 44 delete type; 58 45 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 );63 46 } 64 47 -
src/SynTree/Initializer.h
r6e49f18 ra6c5d7c 37 37 std::list< Expression * > & get_designators() { return designators; } 38 38 39 virtual Designation * clone() const override{ return new Designation( *this ); };39 virtual Designation * clone() const { return new Designation( *this ); }; 40 40 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 ); } 42 42 virtual void print( std::ostream &os, int indent = 0 ) const override; 43 43 }; … … 54 54 bool get_maybeConstructed() { return maybeConstructed; } 55 55 56 virtual Initializer *clone() const override= 0;56 virtual Initializer *clone() const = 0; 57 57 virtual void accept( Visitor &v ) override = 0; 58 virtual Initializer *acceptMutator( Mutator &m ) override= 0;58 virtual Initializer *acceptMutator( Mutator &m ) = 0; 59 59 virtual void print( std::ostream &os, int indent = 0 ) const override = 0; 60 60 private: … … 117 117 Statement * ctor; 118 118 Statement * dtor; 119 // C-style initializer made up of SingleInit and ListInit nodes to use as a fallback120 // if an appropriate constructor definition is not found by the resolver121 Initializer * init;122 119 123 120 ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init ); … … 138 135 139 136 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; 140 140 }; 141 141 -
src/SynTree/Mutator.cc
r6e49f18 ra6c5d7c 17 17 #include <list> // for list 18 18 19 #include "Attribute.h" // for Attribute20 19 #include "Declaration.h" // for ObjectDecl, Declaration, DeclarationWi... 21 20 #include "Expression.h" // for Expression, ConstantExpr, ConditionalExpr … … 37 36 objectDecl->set_init( maybeMutate( objectDecl->get_init(), *this ) ); 38 37 objectDecl->set_bitfieldWidth( maybeMutate( objectDecl->get_bitfieldWidth(), *this ) ); 39 mutateAll( objectDecl->attributes, *this );40 38 return objectDecl; 41 39 } … … 44 42 functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) ); 45 43 functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) ); 46 mutateAll( functionDecl->attributes, *this );47 44 return functionDecl; 48 45 } … … 621 618 } 622 619 623 Attribute * Mutator::mutate( Attribute * attribute ) {624 mutateAll( attribute->parameters, *this );625 return attribute;626 }627 628 620 // Local Variables: // 629 621 // tab-width: 4 // -
src/SynTree/Mutator.h
r6e49f18 ra6c5d7c 25 25 virtual ~Mutator(); 26 26 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 ); 36 36 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 ); 55 55 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 ); 90 90 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 ); 108 108 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 ); 113 113 114 virtual Subrange * mutate( Subrange *subrange );114 virtual Subrange *mutate( Subrange *subrange ); 115 115 116 virtual Constant * mutate( Constant * constant ); 117 118 virtual Attribute * mutate( Attribute * attribute ); 116 virtual Constant *mutate( Constant *constant ); 119 117 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 ); 123 121 }; 124 122 -
src/SynTree/Statement.h
r6e49f18 ra6c5d7c 43 43 const std::list<Label> & get_labels() const { return labels; } 44 44 45 virtual Statement *clone() const override= 0;45 virtual Statement *clone() const = 0; 46 46 virtual void accept( Visitor &v ) override = 0; 47 virtual Statement *acceptMutator( Mutator &m ) override= 0;47 virtual Statement *acceptMutator( Mutator &m ) = 0; 48 48 virtual void print( std::ostream &os, int indent = 0 ) const override; 49 49 }; -
src/SynTree/VarExprReplacer.h
r6e49f18 ra6c5d7c 29 29 private: 30 30 const DeclMap & declMap; 31 bool debug;31 bool debug; 32 32 public: 33 33 VarExprReplacer( const DeclMap & declMap, bool debug = false ); … … 35 35 // replace variable with new node from decl map 36 36 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 }42 37 }; 43 38 -
src/SynTree/Visitor.cc
r6e49f18 ra6c5d7c 17 17 #include <list> // for list 18 18 19 #include "Attribute.h" // for Attribute20 19 #include "Constant.h" // for Constant 21 20 #include "Declaration.h" // for DeclarationWithType, ObjectDecl, Declaration … … 36 35 maybeAccept( objectDecl->get_init(), *this ); 37 36 maybeAccept( objectDecl->get_bitfieldWidth(), *this ); 38 acceptAll( objectDecl->attributes, *this );39 37 } 40 38 … … 42 40 maybeAccept( functionDecl->get_functionType(), *this ); 43 41 maybeAccept( functionDecl->get_statements(), *this ); 44 acceptAll( functionDecl->attributes, *this );45 42 } 46 43 … … 490 487 491 488 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 489 void Visitor::visit( __attribute__((unused)) Subrange *subrange ) {} 490 491 492 void Visitor::visit( __attribute__((unused)) Constant *constant ) {} 501 493 // Local Variables: // 502 494 // tab-width: 4 // -
src/SynTree/Visitor.h
r6e49f18 ra6c5d7c 27 27 // of the given syntax node, but performs no other action. 28 28 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 ); 38 38 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 ); 57 57 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 ); 92 92 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 ); 110 110 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 ); 115 115 116 virtual void visit( Subrange * subrange );116 virtual void visit( Subrange *subrange ); 117 117 118 virtual void visit( Constant * constant ); 119 120 virtual void visit( Attribute * attribute ); 118 virtual void visit( Constant *constant ); 121 119 private: 122 120 virtual void handleAggregateDecl( AggregateDecl *aggregateDecl ); -
src/libcfa/concurrency/invoke.h
r6e49f18 ra6c5d7c 110 110 struct monitor_desc self_mon; // monitor body used for mutual exclusion 111 111 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 thread112 struct __monitor_group_t monitors; // monitors currently held by this thread 113 113 114 114 // Link lists fields -
src/tests/sched-ext-barge.c
r6e49f18 ra6c5d7c 1 //---------------------------------------------------------2 // Barging test3 // Ensures that no barging can occur between :4 // - the frontend of the waitfor and the waited call5 // - the waited call and the backend of the waitfor6 //---------------------------------------------------------7 8 1 #include <fstream> 9 2 #include <kernel> -
src/tests/sched-ext-parse.c
r6e49f18 ra6c5d7c 1 //----------------------------------------------------------------------------------------2 //----------------------------------------------------------------------------------------3 //4 // DEPRECATED TEST5 // DIFFERS BETWEEN DEBUG AND RELEASE6 //7 //----------------------------------------------------------------------------------------8 //----------------------------------------------------------------------------------------9 10 1 #include <monitor> 11 2 -
src/tests/sched-int-barge.c
r6e49f18 ra6c5d7c 1 //----------------------------------------------------------------------------------------2 //----------------------------------------------------------------------------------------3 //4 // DEPRECATED TEST5 //6 //----------------------------------------------------------------------------------------7 //----------------------------------------------------------------------------------------8 9 1 #include <fstream> 10 2 #include <kernel> -
src/tests/sched-int-block.c
r6e49f18 ra6c5d7c 1 //---------------------------------------------------------2 // Barging test3 // Ensures that no barging can occur between :4 // - the frontend of the signal_block and the signaled thread5 // - the signaled threadand the backend of the signal_block6 //---------------------------------------------------------7 8 9 1 #include <fstream> 10 2 #include <kernel> -
src/tests/sched-int-wait.c
r6e49f18 ra6c5d7c 1 //---------------------------------------------------------2 // Multi wait test3 // Ensures that no deadlock from waiting/signalling conditions4 //---------------------------------------------------------5 6 7 1 #include <fstream> 8 2 #include <kernel>
Note:
See TracChangeset
for help on using the changeset viewer.