Changes in / [f2e40a9f:bf4ac09]
- Files:
-
- 4 added
- 4 deleted
- 32 edited
-
Jenkins/FullBuild (modified) (3 diffs)
-
Jenkinsfile (modified) (3 diffs)
-
doc/proposals/concurrency/thePlan.md (modified) (1 diff)
-
doc/proposals/flags.md (modified) (1 diff)
-
src/Concurrency/Keywords.cc (modified) (7 diffs)
-
src/GenPoly/Box.cc (modified) (2 diffs)
-
src/GenPoly/GenPoly.cc (modified) (5 diffs)
-
src/GenPoly/GenPoly.h (modified) (2 diffs)
-
src/GenPoly/InstantiateGeneric.cc (modified) (5 diffs)
-
src/GenPoly/ScrubTyVars.cc (modified) (1 diff)
-
src/GenPoly/ScrubTyVars.h (modified) (5 diffs)
-
src/SymTab/Validate.cc (modified) (2 diffs)
-
src/SynTree/Type.h (modified) (36 diffs)
-
src/benchmark/CorCtxSwitch.c (modified) (2 diffs)
-
src/benchmark/ThrdCtxSwitch.c (modified) (1 diff)
-
src/benchmark/bench.c (modified) (5 diffs)
-
src/benchmark/csv-data.c (modified) (2 diffs)
-
src/examples/multicore.c (modified) (1 diff)
-
src/libcfa/Makefile.am (modified) (1 diff)
-
src/libcfa/Makefile.in (modified) (10 diffs)
-
src/libcfa/concurrency/coroutine (deleted)
-
src/libcfa/concurrency/coroutine.c (deleted)
-
src/libcfa/concurrency/coroutines (added)
-
src/libcfa/concurrency/coroutines.c (added)
-
src/libcfa/concurrency/invoke.c (modified) (3 diffs)
-
src/libcfa/concurrency/invoke.h (modified) (3 diffs)
-
src/libcfa/concurrency/kernel (modified) (3 diffs)
-
src/libcfa/concurrency/kernel.c (modified) (13 diffs)
-
src/libcfa/concurrency/kernel_private.h (modified) (5 diffs)
-
src/libcfa/concurrency/monitor (modified) (3 diffs)
-
src/libcfa/concurrency/monitor.c (modified) (6 diffs)
-
src/libcfa/concurrency/thread (deleted)
-
src/libcfa/concurrency/thread.c (deleted)
-
src/libcfa/concurrency/threads (added)
-
src/libcfa/concurrency/threads.c (added)
-
src/tests/coroutine.c (modified) (3 diffs)
-
src/tests/monitor.c (modified) (3 diffs)
-
src/tests/multi-monitor.c (modified) (2 diffs)
-
src/tests/test.py (modified) (1 diff)
-
src/tests/thread.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Jenkins/FullBuild
rf2e40a9f rbf4ac09 20 20 21 21 parallel ( 22 gcc_6_x64: { trigger_build( 'gcc-6', 'x64' , true) },23 gcc_6_x86: { trigger_build( 'gcc-6', 'x86' , true) },24 gcc_5_x64: { trigger_build( 'gcc-5', 'x64' , false) },25 gcc_5_x86: { trigger_build( 'gcc-5', 'x86' , false) },26 gcc_4_x64: { trigger_build( 'gcc-4.9', 'x64' , false) },27 gcc_4_x86: { trigger_build( 'gcc-4.9', 'x86' , false) },28 clang_x64: { trigger_build( 'clang', 'x64' , false) },29 clang_x86: { trigger_build( 'clang', 'x86' , false) },22 gcc_6_x64: { trigger_build( 'gcc-6', 'x64' ) }, 23 gcc_6_x86: { trigger_build( 'gcc-6', 'x86' ) }, 24 gcc_5_x64: { trigger_build( 'gcc-5', 'x64' ) }, 25 gcc_5_x86: { trigger_build( 'gcc-5', 'x86' ) }, 26 gcc_4_x64: { trigger_build( 'gcc-4.9', 'x64' ) }, 27 gcc_4_x86: { trigger_build( 'gcc-4.9', 'x86' ) }, 28 clang_x64: { trigger_build( 'clang', 'x64' ) }, 29 clang_x86: { trigger_build( 'clang', 'x86' ) }, 30 30 ) 31 31 … … 62 62 //=========================================================================================================== 63 63 64 def trigger_build(String cc, String arch , Boolean publish) {64 def trigger_build(String cc, String arch) { 65 65 def result = build job: 'Cforall/master', \ 66 66 parameters: [ \ … … 82 82 [$class: 'BooleanParameterValue', \ 83 83 name: 'pPublish', \ 84 value: publish], \84 value: true], \ 85 85 [$class: 'BooleanParameterValue', \ 86 86 name: 'pSilent', \ -
Jenkinsfile
rf2e40a9f rbf4ac09 131 131 [$class: 'BooleanParameterDefinition', \ 132 132 description: 'If true, jenkins also builds documentation', \ 133 name: 'pBuildDocumentation', \133 name: 'pBuildDocumentation', \ 134 134 defaultValue: true, \ 135 135 ], \ … … 137 137 description: 'If true, jenkins also publishes results', \ 138 138 name: 'pPublish', \ 139 defaultValue: false, \139 defaultValue: true, \ 140 140 ], \ 141 141 [$class: 'BooleanParameterDefinition', \ 142 142 description: 'If true, jenkins will not send emails', \ 143 name: 'pSilent', \143 name: 'pSilent', \ 144 144 defaultValue: false, \ 145 145 ], \ … … 159 159 echo """Compiler : ${compiler.cc_name} (${compiler.cpp_cc}/${compiler.cfa_cc}) 160 160 Architecture : ${arch_name} 161 Arc Flags : ${architecture}161 Arc Flags : ${architecture} 162 162 Run All Tests : ${ pRunAllTests.toString() } 163 163 Run Benchmark : ${ pRunBenchmark.toString() } -
doc/proposals/concurrency/thePlan.md
rf2e40a9f rbf4ac09 7 7 8 8 _Phase 2_ : Minimum Viable Product 9 done -Monitor type and enter/leave mutex member routines9 Monitor type and enter/leave mutex member routines 10 10 Monitors as a language feature (not calling enter/leave by hand) 11 11 Internal scheduling -
doc/proposals/flags.md
rf2e40a9f rbf4ac09 69 69 In each of the cases above, `FOO` could be replaced by `(BAR | BAZ)` to do the same operation or test on multiple flags at once. 70 70 71 ### Alternative/Additional Features ###72 73 #### User-defined enum discriminant iterator ####74 It may be useful to provide a more general method for changing the enum discriminant assignment function, e.g. the flag enum discriminants could be defined by something like the following:75 76 ```77 enum(@ << 1) TCP_Flags { // each discriminant is left-shifted by 1 from the previous78 FIN = 0x1, // first flag is 179 SYN,80 ACK,81 ...82 }83 ```84 85 #### Member expression for enums ####86 As a more ergonomic way to set and unset enum flags, we could define a member expression for flags enums. Since only unions and structs can have member expressions now, this change would be backwards compatible. Basically, given a `FunFlags f`, `f.FOO` would return a proxy object which could be implicitly converted to `bool` (with semantics `f & FOO`, i.e. "check if `FOO` is set on `f`"), as well as having `bool` assigned to it (with semantics `f |= FOO` on true or `f -= FOO` on false, i.e. "set or unset `FOO` on `f` as appropriate"). With this member function, the operations above can be expressed as follows (possibly more ergonomically):87 88 ```89 FunFlags f = some_val();90 if ( f.FOO ) { sout | "f has FOO set" | endl; }91 f.FOO = true; // set FOO92 f.FOO = false; // unset FOO93 f.FOO = ! f.FOO; // toggle FOO94 ```95 96 71 ### Related Work ### 97 72 C# has the [`[Flags]`][1] enum attribute, but their proposal does not go as far; specifically, the flag discriminants must be manually specified, and they do not automatically implement the bitwise operators on the flags. -
src/Concurrency/Keywords.cc
rf2e40a9f rbf4ac09 88 88 //Handles mutex routines definitions : 89 89 // void foo( A * mutex a, B * mutex b, int i ) { void foo( A * a, B * b, int i ) { 90 // monitor_desc * __monitors[] = { get_monitor(a), get_monitor(b)};90 // monitor_desc * __monitors[] = { a, b }; 91 91 // monitor_guard_t __guard = { __monitors, 2 }; 92 92 // /*Some code*/ => /*Some code*/ … … 98 98 using Visitor::visit; 99 99 virtual void visit( FunctionDecl *functionDecl ) override final; 100 virtual void visit( StructDecl *functionDecl ) override final;101 100 102 101 std::list<DeclarationWithType*> findMutexArgs( FunctionDecl* ); … … 108 107 acceptAll( translationUnit, impl ); 109 108 } 110 111 private:112 StructDecl* monitor_decl = nullptr;113 109 }; 114 110 … … 137 133 if( ! body ) return; 138 134 139 assert(monitor_decl);140 135 addStatments( body, mutexArgs ); 141 }142 143 void MutexKeyword::visit(StructDecl* decl) {144 if( decl->get_name() == "monitor_desc" ) {145 assert( !monitor_decl );146 monitor_decl = decl;147 }148 136 } 149 137 … … 179 167 180 168 void MutexKeyword::addStatments( CompoundStmt * body, const std::list<DeclarationWithType * > & args ) { 181 182 ObjectDecl * monitors = new ObjectDecl(183 "__monitors",184 noStorage,185 LinkageSpec::Cforall,186 nullptr,187 new ArrayType(188 noQualifiers,189 new PointerType(190 noQualifiers,191 new StructInstType(192 noQualifiers,193 monitor_decl194 )195 ),196 new ConstantExpr( Constant::from_ulong( args.size() ) ),197 false,198 false199 ),200 new ListInit(201 map_range < std::list<Initializer*> > ( args, [](DeclarationWithType * var ){202 return new SingleInit( new UntypedExpr(203 new NameExpr( "get_monitor" ),204 { new VariableExpr( var ) }205 ) );206 })207 )208 );209 210 169 //in reverse order : 211 170 // monitor_guard_t __guard = { __monitors, # }; … … 222 181 new ListInit( 223 182 { 224 new SingleInit( new VariableExpr( monitors) ),183 new SingleInit( new NameExpr( "__monitors" ) ), 225 184 new SingleInit( new ConstantExpr( Constant::from_ulong( args.size() ) ) ) 226 185 } … … 230 189 231 190 //monitor_desc * __monitors[] = { a, b }; 232 body->push_front( new DeclStmt( noLabels, monitors) ); 191 body->push_front( 192 new DeclStmt( noLabels, new ObjectDecl( 193 "__monitors", 194 noStorage, 195 LinkageSpec::Cforall, 196 nullptr, 197 new ArrayType( 198 noQualifiers, 199 new PointerType( 200 noQualifiers, 201 new StructInstType( 202 noQualifiers, 203 "monitor_desc" 204 ) 205 ), 206 new ConstantExpr( Constant::from_ulong( args.size() ) ), 207 false, 208 false 209 ), 210 new ListInit( 211 map_range < std::list<Initializer*> > ( args, [](DeclarationWithType * var ){ 212 return new SingleInit( new VariableExpr( var ) ); 213 }) 214 ) 215 )) 216 ); 233 217 } 234 218 }; -
src/GenPoly/Box.cc
rf2e40a9f rbf4ac09 381 381 // calculate struct layout in function body 382 382 383 // initialize size and alignment to 0 and 1 (will have at least one member to re-edit size )383 // initialize size and alignment to 0 and 1 (will have at least one member to re-edit size 384 384 addExpr( layoutDecl->get_statements(), makeOp( "?=?", derefVar( sizeParam ), new ConstantExpr( Constant( sizeAlignType->clone(), "0" ) ) ) ); 385 385 addExpr( layoutDecl->get_statements(), makeOp( "?=?", derefVar( alignParam ), new ConstantExpr( Constant( sizeAlignType->clone(), "1" ) ) ) ); … … 1852 1852 1853 1853 DeclClass *ret = static_cast< DeclClass *>( Mutator::mutate( decl ) ); 1854 // ScrubTyVars::scrub( decl, scopeTyVars ); 1855 ScrubTyVars::scrubAll( decl ); 1854 ScrubTyVars::scrub( decl, scopeTyVars ); 1856 1855 1857 1856 scopeTyVars.endScope(); -
src/GenPoly/GenPoly.cc
rf2e40a9f rbf4ac09 15 15 16 16 #include "GenPoly.h" 17 #include "assert.h"18 17 19 18 #include "SynTree/Expression.h" 20 19 #include "SynTree/Type.h" 21 #include "ResolvExpr/typeops.h"22 20 23 21 #include <iostream> 24 #include <iterator>25 #include <list>26 #include <typeindex>27 #include <typeinfo>28 #include <vector>29 22 using namespace std; 30 23 … … 45 38 for ( std::list< Expression* >::iterator param = params.begin(); param != params.end(); ++param ) { 46 39 TypeExpr *paramType = dynamic_cast< TypeExpr* >( *param ); 47 assert f(paramType,"Aggregate parameters should be type expressions");40 assert(paramType && "Aggregate parameters should be type expressions"); 48 41 if ( isPolyType( paramType->get_type(), tyVars, env ) ) return true; 49 42 } … … 55 48 for ( std::list< Expression* >::iterator param = params.begin(); param != params.end(); ++param ) { 56 49 TypeExpr *paramType = dynamic_cast< TypeExpr* >( *param ); 57 assert f(paramType,"Aggregate parameters should be type expressions");50 assert(paramType && "Aggregate parameters should be type expressions"); 58 51 if ( isDynType( paramType->get_type(), tyVars, env ) ) return true; 59 }60 return false;61 }62 63 /// Checks a parameter list for inclusion of polymorphic parameters; will substitute according to env if present64 bool includesPolyParams( std::list< Expression* >& params, const TypeSubstitution *env ) {65 for ( std::list< Expression* >::iterator param = params.begin(); param != params.end(); ++param ) {66 TypeExpr *paramType = dynamic_cast< TypeExpr* >( *param );67 assertf(paramType, "Aggregate parameters should be type expressions");68 if ( includesPolyType( paramType->get_type(), env ) ) return true;69 }70 return false;71 }72 73 /// Checks a parameter list for inclusion of polymorphic parameters from tyVars; will substitute according to env if present74 bool includesPolyParams( std::list< Expression* >& params, const TyVarMap &tyVars, const TypeSubstitution *env ) {75 for ( std::list< Expression* >::iterator param = params.begin(); param != params.end(); ++param ) {76 TypeExpr *paramType = dynamic_cast< TypeExpr* >( *param );77 assertf(paramType, "Aggregate parameters should be type expressions");78 if ( includesPolyType( paramType->get_type(), tyVars, env ) ) return true;79 52 } 80 53 return false; … … 214 187 215 188 return isPolyType( type, tyVars, env ); 216 }217 218 bool includesPolyType( Type *type, const TypeSubstitution *env ) {219 type = replaceTypeInst( type, env );220 221 if ( dynamic_cast< TypeInstType * >( type ) ) {222 return true;223 } else if ( PointerType *pointerType = dynamic_cast< PointerType* >( type ) ) {224 if ( includesPolyType( pointerType->get_base(), env ) ) return true;225 } else if ( StructInstType *structType = dynamic_cast< StructInstType* >( type ) ) {226 if ( includesPolyParams( structType->get_parameters(), env ) ) return true;227 } else if ( UnionInstType *unionType = dynamic_cast< UnionInstType* >( type ) ) {228 if ( includesPolyParams( unionType->get_parameters(), env ) ) return true;229 }230 return false;231 }232 233 bool includesPolyType( Type *type, const TyVarMap &tyVars, const TypeSubstitution *env ) {234 type = replaceTypeInst( type, env );235 236 if ( TypeInstType *typeInstType = dynamic_cast< TypeInstType * >( type ) ) {237 if ( tyVars.find( typeInstType->get_name() ) != tyVars.end() ) {238 return true;239 }240 } else if ( PointerType *pointerType = dynamic_cast< PointerType* >( type ) ) {241 if ( includesPolyType( pointerType->get_base(), tyVars, env ) ) return true;242 } else if ( StructInstType *structType = dynamic_cast< StructInstType* >( type ) ) {243 if ( includesPolyParams( structType->get_parameters(), tyVars, env ) ) return true;244 } else if ( UnionInstType *unionType = dynamic_cast< UnionInstType* >( type ) ) {245 if ( includesPolyParams( unionType->get_parameters(), tyVars, env ) ) return true;246 }247 return false;248 189 } 249 190 … … 296 237 } 297 238 298 namespace {299 /// Checks if is a pointer to D300 template<typename D, typename B>301 bool is( const B* p ) { return type_index{typeid(D)} == type_index{typeid(*p)}; }302 303 /// Converts to a pointer to D without checking for safety304 template<typename D, typename B>305 inline D* as( B* p ) { return reinterpret_cast<D*>(p); }306 307 /// Flattens a declaration list308 template<typename Output>309 void flattenList( list< DeclarationWithType* > src, Output out ) {310 for ( DeclarationWithType* decl : src ) {311 ResolvExpr::flatten( decl->get_type(), out );312 }313 }314 315 /// Flattens a list of types316 template<typename Output>317 void flattenList( list< Type* > src, Output out ) {318 for ( Type* ty : src ) {319 ResolvExpr::flatten( ty, out );320 }321 }322 323 /// Checks if two lists of parameters are equal up to polymorphic substitution.324 bool paramListsPolyCompatible( const list< Expression* >& aparams, const list< Expression* >& bparams ) {325 if ( aparams.size() != bparams.size() ) return false;326 327 for ( list< Expression* >::const_iterator at = aparams.begin(), bt = bparams.begin();328 at != aparams.end(); ++at, ++bt ) {329 TypeExpr *aparam = dynamic_cast< TypeExpr* >(*at);330 assertf(aparam, "Aggregate parameters should be type expressions");331 TypeExpr *bparam = dynamic_cast< TypeExpr* >(*bt);332 assertf(bparam, "Aggregate parameters should be type expressions");333 334 // xxx - might need to let VoidType be a wildcard here too; could have some voids335 // stuffed in for dtype-statics.336 // if ( is<VoidType>( aparam->get_type() ) || is<VoidType>( bparam->get_type() ) ) continue;337 if ( ! typesPolyCompatible( aparam->get_type(), bparam->get_type() ) ) return false;338 }339 340 return true;341 }342 }343 344 bool typesPolyCompatible( Type *a, Type *b ) {345 type_index aid{ typeid(*a) };346 // polymorphic types always match347 if ( aid == type_index{typeid(TypeInstType)} ) return true;348 349 type_index bid{ typeid(*b) };350 // polymorphic types always match351 if ( bid == type_index{typeid(TypeInstType)} ) return true;352 353 // can't match otherwise if different types354 if ( aid != bid ) return false;355 356 // recurse through type structure (conditions borrowed from Unify.cc)357 if ( aid == type_index{typeid(BasicType)} ) {358 return as<BasicType>(a)->get_kind() == as<BasicType>(b)->get_kind();359 } else if ( aid == type_index{typeid(PointerType)} ) {360 PointerType *ap = as<PointerType>(a), *bp = as<PointerType>(b);361 362 // void pointers should match any other pointer type363 return is<VoidType>( ap->get_base() ) || is<VoidType>( bp->get_base() )364 || typesPolyCompatible( ap->get_base(), bp->get_base() );365 } else if ( aid == type_index{typeid(ArrayType)} ) {366 ArrayType *aa = as<ArrayType>(a), *ba = as<ArrayType>(b);367 368 if ( aa->get_isVarLen() ) {369 if ( ! ba->get_isVarLen() ) return false;370 } else {371 if ( ba->get_isVarLen() ) return false;372 373 ConstantExpr *ad = dynamic_cast<ConstantExpr*>( aa->get_dimension() );374 ConstantExpr *bd = dynamic_cast<ConstantExpr*>( ba->get_dimension() );375 if ( ad && bd376 && ad->get_constant()->get_value() != bd->get_constant()->get_value() )377 return false;378 }379 380 return typesPolyCompatible( aa->get_base(), ba->get_base() );381 } else if ( aid == type_index{typeid(FunctionType)} ) {382 FunctionType *af = as<FunctionType>(a), *bf = as<FunctionType>(b);383 384 vector<Type*> aparams, bparams;385 flattenList( af->get_parameters(), back_inserter( aparams ) );386 flattenList( bf->get_parameters(), back_inserter( bparams ) );387 if ( aparams.size() != bparams.size() ) return false;388 389 vector<Type*> areturns, breturns;390 flattenList( af->get_returnVals(), back_inserter( areturns ) );391 flattenList( bf->get_returnVals(), back_inserter( breturns ) );392 if ( areturns.size() != breturns.size() ) return false;393 394 for ( unsigned i = 0; i < aparams.size(); ++i ) {395 if ( ! typesPolyCompatible( aparams[i], bparams[i] ) ) return false;396 }397 for ( unsigned i = 0; i < areturns.size(); ++i ) {398 if ( ! typesPolyCompatible( areturns[i], breturns[i] ) ) return false;399 }400 return true;401 } else if ( aid == type_index{typeid(StructInstType)} ) {402 StructInstType *aa = as<StructInstType>(a), *ba = as<StructInstType>(b);403 404 if ( aa->get_name() != ba->get_name() ) return false;405 return paramListsPolyCompatible( aa->get_parameters(), ba->get_parameters() );406 } else if ( aid == type_index{typeid(UnionInstType)} ) {407 UnionInstType *aa = as<UnionInstType>(a), *ba = as<UnionInstType>(b);408 409 if ( aa->get_name() != ba->get_name() ) return false;410 return paramListsPolyCompatible( aa->get_parameters(), ba->get_parameters() );411 } else if ( aid == type_index{typeid(EnumInstType)} ) {412 return as<EnumInstType>(a)->get_name() == as<EnumInstType>(b)->get_name();413 } else if ( aid == type_index{typeid(TraitInstType)} ) {414 return as<TraitInstType>(a)->get_name() == as<TraitInstType>(b)->get_name();415 } else if ( aid == type_index{typeid(TupleType)} ) {416 TupleType *at = as<TupleType>(a), *bt = as<TupleType>(b);417 418 vector<Type*> atypes, btypes;419 flattenList( at->get_types(), back_inserter( atypes ) );420 flattenList( bt->get_types(), back_inserter( btypes ) );421 if ( atypes.size() != btypes.size() ) return false;422 423 for ( unsigned i = 0; i < atypes.size(); ++i ) {424 if ( ! typesPolyCompatible( atypes[i], btypes[i] ) ) return false;425 }426 return true;427 } else return true; // VoidType, VarArgsType, ZeroType & OneType just need the same type428 }429 430 239 void addToTyVarMap( TypeDecl * tyVar, TyVarMap &tyVarMap ) { 431 240 tyVarMap[ tyVar->get_name() ] = TypeDecl::Data{ tyVar }; -
src/GenPoly/GenPoly.h
rf2e40a9f rbf4ac09 67 67 Type *hasPolyBase( Type *type, const TyVarMap &tyVars, int *levels = 0, const TypeSubstitution *env = 0 ); 68 68 69 /// true iff this type or some base of this type after dereferencing pointers is either polymorphic or a generic type with at least one70 /// polymorphic parameter; will look up substitution in env if provided.71 bool includesPolyType( Type *type, const TypeSubstitution *env = 0 );72 73 /// true iff this type or some base of this type after dereferencing pointers is either polymorphic in tyVars, or a generic type with74 /// at least one polymorphic parameter in tyVars; will look up substitution in env if provided.75 bool includesPolyType( Type *type, const TyVarMap &tyVars, const TypeSubstitution *env = 0 );76 77 69 /// Returns a pointer to the base FunctionType if ty is the type of a function (or pointer to one), NULL otherwise 78 70 FunctionType *getFunctionType( Type *ty ); … … 81 73 /// N will be stored in levels, if provided 82 74 VariableExpr *getBaseVar( Expression *expr, int *levels = 0 ); 83 84 /// true iff types are structurally identical, where TypeInstType's match any type.85 bool typesPolyCompatible( Type *aty, Type *bty );86 75 87 76 /// Adds the type variable `tyVar` to `tyVarMap` -
src/GenPoly/InstantiateGeneric.cc
rf2e40a9f rbf4ac09 16 16 #include <cassert> 17 17 #include <list> 18 #include <unordered_map>19 18 #include <utility> 20 19 #include <vector> 20 #include <unordered_map> 21 21 22 22 #include "InstantiateGeneric.h" … … 25 25 #include "GenPoly.h" 26 26 #include "ScopedSet.h" 27 #include "ScrubTyVars.h"28 27 #include "PolyMutator.h" 29 28 … … 78 77 if ( params.size() != that.params.size() ) return false; 79 78 79 SymTab::Indexer dummy; 80 80 for ( std::list< Type* >::const_iterator it = params.begin(), jt = that.params.begin(); it != params.end(); ++it, ++jt ) { 81 if ( ! typesPolyCompatible( *it, *jt) ) return false;81 if ( ! ResolvExpr::typesCompatible( *it, *jt, dummy ) ) return false; 82 82 } 83 83 return true; … … 227 227 if ( (*baseParam)->isComplete() ) { 228 228 // substitute parameter for complete (otype or sized dtype) type 229 if ( isPolyType( paramType->get_type() ) ) { 230 // substitute polymorphic parameter type in to generic type 229 int pointerLevels = 0; 230 if ( hasPolyBase( paramType->get_type(), &pointerLevels ) && pointerLevels > 0 ) { 231 // Make a void* with equivalent nesting 232 Type* voidPtr = new VoidType( Type::Qualifiers() ); 233 while ( pointerLevels > 0 ) { 234 // Just about data layout, so qualifiers *shouldn't* matter 235 voidPtr = new PointerType( Type::Qualifiers(), voidPtr ); 236 --pointerLevels; 237 } 238 out.push_back( new TypeExpr( voidPtr ) ); 239 } else { 240 // Just clone parameter type 231 241 out.push_back( paramType->clone() ); 232 gt = genericType::dynamic;233 } else {234 // normalize possibly dtype-static parameter type235 out.push_back( new TypeExpr{236 ScrubTyVars::scrubAll( paramType->get_type()->clone() ) } );237 gt |= genericType::concrete;238 242 } 243 // make the struct concrete or dynamic depending on the parameter 244 gt |= isPolyType( paramType->get_type() ) ? genericType::dynamic : genericType::concrete; 239 245 } else switch ( (*baseParam)->get_kind() ) { 240 246 case TypeDecl::Dtype: … … 366 372 concDecl = new StructDecl( typeNamer.newName( inst->get_name() ) ); 367 373 concDecl->set_body( inst->get_baseStruct()->has_body() ); 368 substituteMembers( inst->get_baseStruct()->get_members(), *inst->get_baseParameters(), typeSubs, concDecl->get_members() );374 substituteMembers( inst->get_baseStruct()->get_members(), *inst->get_baseParameters(), typeSubs, concDecl->get_members() ); 369 375 DeclMutator::addDeclaration( concDecl ); 370 376 insert( inst, typeSubs, concDecl ); -
src/GenPoly/ScrubTyVars.cc
rf2e40a9f rbf4ac09 26 26 namespace GenPoly { 27 27 Type * ScrubTyVars::mutate( TypeInstType *typeInst ) { 28 if ( ! tyVars ) { 29 if ( typeInst->get_isFtype() ) { 30 delete typeInst; 31 return new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ); 32 } else { 33 PointerType *ret = new PointerType( Type::Qualifiers(), new VoidType( typeInst->get_qualifiers() ) ); 34 delete typeInst; 35 return ret; 36 } 37 } 38 39 TyVarMap::const_iterator tyVar = tyVars->find( typeInst->get_name() ); 40 if ( tyVar != tyVars->end() ) { 28 TyVarMap::const_iterator tyVar = tyVars.find( typeInst->get_name() ); 29 if ( tyVar != tyVars.end() ) { 41 30 switch ( tyVar->second.kind ) { 42 31 case TypeDecl::Any: -
src/GenPoly/ScrubTyVars.h
rf2e40a9f rbf4ac09 26 26 namespace GenPoly { 27 27 class ScrubTyVars : public Mutator { 28 /// Whether to scrub all type variables from the provided map, dynamic type variables from the provided map, or all type variables29 enum ScrubMode { FromMap, DynamicFromMap, All };28 public: 29 ScrubTyVars( const TyVarMap &tyVars, bool dynamicOnly = false ): tyVars( tyVars ), dynamicOnly( dynamicOnly ) {} 30 30 31 ScrubTyVars() : tyVars(nullptr), mode( All ) {}32 33 ScrubTyVars( const TyVarMap &tyVars, ScrubMode mode = FromMap ): tyVars( &tyVars ), mode( mode ) {}34 35 public:36 31 /// For all polymorphic types with type variables in `tyVars`, replaces generic types, dtypes, and ftypes with the appropriate void type, 37 32 /// and sizeof/alignof expressions with the proper variable … … 43 38 template< typename SynTreeClass > 44 39 static SynTreeClass *scrubDynamic( SynTreeClass *target, const TyVarMap &tyVars ); 45 46 /// For all polymorphic types, replaces generic types, dtypes, and ftypes with the appropriate void type,47 /// and sizeof/alignof expressions with the proper variable48 template< typename SynTreeClass >49 static SynTreeClass *scrubAll( SynTreeClass *target );50 40 51 41 virtual Type* mutate( TypeInstType *typeInst ); … … 59 49 /// Returns the type if it should be scrubbed, NULL otherwise. 60 50 Type* shouldScrub( Type *ty ) { 61 switch ( mode ) { 62 case FromMap: return isPolyType( ty, *tyVars ); 63 case DynamicFromMap: return isDynType( ty, *tyVars ); 64 case All: return isPolyType( ty ); 65 } 66 assert(false); return nullptr; // unreachable 67 // return dynamicOnly ? isDynType( ty, tyVars ) : isPolyType( ty, tyVars ); 51 return dynamicOnly ? isDynType( ty, tyVars ) : isPolyType( ty, tyVars ); 52 // if ( ! dynamicOnly ) return isPolyType( ty, tyVars ); 53 // 54 // if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( ty ) ) { 55 // return tyVars.find( typeInst->get_name() ) != tyVars.end() ? ty : 0; 56 // } 57 // 58 // return isDynType( ty, tyVars ); 68 59 } 69 60 … … 71 62 Type* mutateAggregateType( Type *ty ); 72 63 73 const TyVarMap *tyVars; ///< Type variables to scrub74 ScrubMode mode; ///< which type variables to scrub? [FromMap]64 const TyVarMap &tyVars; ///< Type variables to scrub 65 bool dynamicOnly; ///< only scrub the types with dynamic layout? [false] 75 66 }; 76 67 … … 83 74 template< typename SynTreeClass > 84 75 SynTreeClass * ScrubTyVars::scrubDynamic( SynTreeClass *target, const TyVarMap &tyVars ) { 85 ScrubTyVars scrubber( tyVars, ScrubTyVars::DynamicFromMap ); 86 return static_cast< SynTreeClass * >( target->acceptMutator( scrubber ) ); 87 } 88 89 template< typename SynTreeClass > 90 SynTreeClass * ScrubTyVars::scrubAll( SynTreeClass *target ) { 91 ScrubTyVars scrubber; 76 ScrubTyVars scrubber( tyVars, true ); 92 77 return static_cast< SynTreeClass * >( target->acceptMutator( scrubber ) ); 93 78 } -
src/SymTab/Validate.cc
rf2e40a9f rbf4ac09 10 10 // Created On : Sun May 17 21:50:04 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 14 23:30:27201713 // Update Count : 3 5012 // Last Modified On : Tue Mar 7 07:51:36 2017 13 // Update Count : 349 14 14 // 15 15 … … 323 323 ObjectDecl * obj = dynamic_cast< ObjectDecl * >( *i ); 324 324 assert( obj ); 325 obj->set_type( new EnumInstType( Type::Qualifiers( Type::Const), enumDecl->get_name() ) );325 obj->set_type( new EnumInstType( Type::Qualifiers( true, false, false, false, false, false ), enumDecl->get_name() ) ); 326 326 } // for 327 327 Parent::visit( enumDecl ); -
src/SynTree/Type.h
rf2e40a9f rbf4ac09 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 15 21:2 8:09201713 // Update Count : 8 512 // Last Modified On : Wed Mar 15 21:23:08 2017 13 // Update Count : 84 14 14 // 15 15 … … 24 24 class Type : public BaseSyntaxNode { 25 25 public: 26 // struct Qualifiers { 27 // Qualifiers(): isConst( false ), isVolatile( false ), isRestrict( false ), isLvalue( false ), isAtomic( false ), isMutex( false ) {} 28 // Qualifiers( bool isConst, bool isVolatile, bool isRestrict, bool isLvalue, bool isAtomic, bool isMutex ): isConst( isConst ), isVolatile( isVolatile ), isRestrict( isRestrict ), isLvalue( isLvalue ), isAtomic( isAtomic ), isMutex( isMutex ) {} 29 30 // Qualifiers &operator&=( const Qualifiers &other ); 31 // Qualifiers &operator+=( const Qualifiers &other ); 32 // Qualifiers &operator-=( const Qualifiers &other ); 33 // Qualifiers operator+( const Type::Qualifiers &other ); 34 // bool operator==( const Qualifiers &other ); 35 // bool operator!=( const Qualifiers &other ); 36 // bool operator<=( const Qualifiers &other ); 37 // bool operator>=( const Qualifiers &other ); 38 // bool operator<( const Qualifiers &other ); 39 // bool operator>( const Qualifiers &other ); 40 // void print( std::ostream &os, int indent = 0 ) const; 41 42 // bool isConst; 43 // bool isVolatile; 44 // bool isRestrict; 45 // bool isLvalue; 46 // bool isAtomic; 47 // bool isMutex; 48 // }; 49 26 50 static const char * QualifierNames[]; 27 51 … … 76 100 return q; 77 101 } 78 void print( std::ostream & os, int indent = 0 ) const {102 void print( std::ostream &os, int indent = 0 ) const { 79 103 if ( (*this).any() ) { // any type qualifiers ? 80 104 for ( unsigned int i = 0; i < NumTypeQualifier; i += 1 ) { … … 87 111 }; // Qualifiers 88 112 89 Type( const Qualifiers & tq, const std::list< Attribute * > & attributes );90 Type( const Type & other );113 Type( const Qualifiers &tq, const std::list< Attribute * > & attributes ); 114 Type( const Type &other ); 91 115 virtual ~Type(); 92 116 93 Qualifiers & get_qualifiers() { return tq; }117 Qualifiers &get_qualifiers() { return tq; } 94 118 bool get_isConst() { return tq.isConst; } 95 119 bool get_isVolatile() { return tq.isVolatile; } … … 117 141 118 142 virtual Type *clone() const = 0; 119 virtual void accept( Visitor & v ) = 0;120 virtual Type *acceptMutator( Mutator & m ) = 0;121 virtual void print( std::ostream & os, int indent = 0 ) const;143 virtual void accept( Visitor &v ) = 0; 144 virtual Type *acceptMutator( Mutator &m ) = 0; 145 virtual void print( std::ostream &os, int indent = 0 ) const; 122 146 private: 123 147 Qualifiers tq; … … 130 154 class VoidType : public Type { 131 155 public: 132 VoidType( const Type::Qualifiers & tq, const std::list< Attribute * > & attributes = std::list< Attribute * >() );156 VoidType( const Type::Qualifiers &tq, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 133 157 134 158 virtual unsigned size() const { return 0; }; … … 136 160 137 161 virtual VoidType *clone() const { return new VoidType( *this ); } 138 virtual void accept( Visitor & v ) { v.visit( this ); }139 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }140 virtual void print( std::ostream & os, int indent = 0 ) const;162 virtual void accept( Visitor &v ) { v.visit( this ); } 163 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 164 virtual void print( std::ostream &os, int indent = 0 ) const; 141 165 }; 142 166 … … 170 194 static const char *typeNames[]; // string names for basic types, MUST MATCH with Kind 171 195 172 BasicType( const Type::Qualifiers & tq, Kind bt, const std::list< Attribute * > & attributes = std::list< Attribute * >() );196 BasicType( const Type::Qualifiers &tq, Kind bt, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 173 197 174 198 Kind get_kind() { return kind; } … … 176 200 177 201 virtual BasicType *clone() const { return new BasicType( *this ); } 178 virtual void accept( Visitor & v ) { v.visit( this ); }179 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }180 virtual void print( std::ostream & os, int indent = 0 ) const;202 virtual void accept( Visitor &v ) { v.visit( this ); } 203 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 204 virtual void print( std::ostream &os, int indent = 0 ) const; 181 205 182 206 bool isInteger() const; … … 187 211 class PointerType : public Type { 188 212 public: 189 PointerType( const Type::Qualifiers & tq, Type *base, const std::list< Attribute * > & attributes = std::list< Attribute * >() );190 PointerType( const Type::Qualifiers & tq, Type *base, Expression *dimension, bool isVarLen, bool isStatic, const std::list< Attribute * > & attributes = std::list< Attribute * >() );213 PointerType( const Type::Qualifiers &tq, Type *base, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 214 PointerType( const Type::Qualifiers &tq, Type *base, Expression *dimension, bool isVarLen, bool isStatic, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 191 215 PointerType( const PointerType& ); 192 216 virtual ~PointerType(); … … 202 226 203 227 virtual PointerType *clone() const { return new PointerType( *this ); } 204 virtual void accept( Visitor & v ) { v.visit( this ); }205 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }206 virtual void print( std::ostream & os, int indent = 0 ) const;228 virtual void accept( Visitor &v ) { v.visit( this ); } 229 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 230 virtual void print( std::ostream &os, int indent = 0 ) const; 207 231 private: 208 232 Type *base; … … 216 240 class ArrayType : public Type { 217 241 public: 218 ArrayType( const Type::Qualifiers & tq, Type *base, Expression *dimension, bool isVarLen, bool isStatic, const std::list< Attribute * > & attributes = std::list< Attribute * >() );242 ArrayType( const Type::Qualifiers &tq, Type *base, Expression *dimension, bool isVarLen, bool isStatic, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 219 243 ArrayType( const ArrayType& ); 220 244 virtual ~ArrayType(); … … 232 256 233 257 virtual ArrayType *clone() const { return new ArrayType( *this ); } 234 virtual void accept( Visitor & v ) { v.visit( this ); }235 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }236 virtual void print( std::ostream & os, int indent = 0 ) const;258 virtual void accept( Visitor &v ) { v.visit( this ); } 259 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 260 virtual void print( std::ostream &os, int indent = 0 ) const; 237 261 private: 238 262 Type *base; … … 244 268 class FunctionType : public Type { 245 269 public: 246 FunctionType( const Type::Qualifiers & tq, bool isVarArgs, const std::list< Attribute * > & attributes = std::list< Attribute * >() );270 FunctionType( const Type::Qualifiers &tq, bool isVarArgs, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 247 271 FunctionType( const FunctionType& ); 248 272 virtual ~FunctionType(); … … 255 279 256 280 virtual FunctionType *clone() const { return new FunctionType( *this ); } 257 virtual void accept( Visitor & v ) { v.visit( this ); }258 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }259 virtual void print( std::ostream & os, int indent = 0 ) const;281 virtual void accept( Visitor &v ) { v.visit( this ); } 282 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 283 virtual void print( std::ostream &os, int indent = 0 ) const; 260 284 private: 261 285 std::list<DeclarationWithType*> returnVals; … … 271 295 class ReferenceToType : public Type { 272 296 public: 273 ReferenceToType( const Type::Qualifiers & tq, const std::string &name, const std::list< Attribute * > & attributes );274 ReferenceToType( const ReferenceToType & other );297 ReferenceToType( const Type::Qualifiers &tq, const std::string &name, const std::list< Attribute * > & attributes ); 298 ReferenceToType( const ReferenceToType &other ); 275 299 virtual ~ReferenceToType(); 276 300 277 const std::string & get_name() const { return name; }301 const std::string &get_name() const { return name; } 278 302 void set_name( std::string newValue ) { name = newValue; } 279 303 std::list< Expression* >& get_parameters() { return parameters; } … … 282 306 283 307 virtual ReferenceToType *clone() const = 0; 284 virtual void accept( Visitor & v ) = 0;285 virtual Type *acceptMutator( Mutator & m ) = 0;286 virtual void print( std::ostream & os, int indent = 0 ) const;308 virtual void accept( Visitor &v ) = 0; 309 virtual Type *acceptMutator( Mutator &m ) = 0; 310 virtual void print( std::ostream &os, int indent = 0 ) const; 287 311 protected: 288 312 virtual std::string typeString() const = 0; … … 296 320 typedef ReferenceToType Parent; 297 321 public: 298 StructInstType( const Type::Qualifiers & tq, const std::string &name, const std::list< Attribute * > & attributes = std::list< Attribute * >() ) : Parent( tq, name, attributes ), baseStruct( 0 ) {}299 StructInstType( const Type::Qualifiers & tq, StructDecl * baseStruct, const std::list< Attribute * > & attributes = std::list< Attribute * >() );300 StructInstType( const StructInstType & other ) : Parent( other ), baseStruct( other.baseStruct ) {}322 StructInstType( const Type::Qualifiers &tq, const std::string &name, const std::list< Attribute * > & attributes = std::list< Attribute * >() ) : Parent( tq, name, attributes ), baseStruct( 0 ) {} 323 StructInstType( const Type::Qualifiers &tq, StructDecl * baseStruct, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 324 StructInstType( const StructInstType &other ) : Parent( other ), baseStruct( other.baseStruct ) {} 301 325 302 326 StructDecl *get_baseStruct() const { return baseStruct; } … … 310 334 /// Looks up the members of this struct named "name" and places them into "foundDecls". 311 335 /// Clones declarations into "foundDecls", caller responsible for freeing 312 void lookup( const std::string & name, std::list< Declaration* > &foundDecls ) const;336 void lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const; 313 337 314 338 virtual StructInstType *clone() const { return new StructInstType( *this ); } 315 virtual void accept( Visitor & v ) { v.visit( this ); }316 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }317 318 virtual void print( std::ostream & os, int indent = 0 ) const;339 virtual void accept( Visitor &v ) { v.visit( this ); } 340 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 341 342 virtual void print( std::ostream &os, int indent = 0 ) const; 319 343 private: 320 344 virtual std::string typeString() const; … … 328 352 typedef ReferenceToType Parent; 329 353 public: 330 UnionInstType( const Type::Qualifiers & tq, const std::string &name, const std::list< Attribute * > & attributes = std::list< Attribute * >() ) : Parent( tq, name, attributes ), baseUnion( 0 ) {}331 UnionInstType( const Type::Qualifiers & tq, UnionDecl * baseUnion, const std::list< Attribute * > & attributes = std::list< Attribute * >() );332 UnionInstType( const UnionInstType & other ) : Parent( other ), baseUnion( other.baseUnion ) {}354 UnionInstType( const Type::Qualifiers &tq, const std::string &name, const std::list< Attribute * > & attributes = std::list< Attribute * >() ) : Parent( tq, name, attributes ), baseUnion( 0 ) {} 355 UnionInstType( const Type::Qualifiers &tq, UnionDecl * baseUnion, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 356 UnionInstType( const UnionInstType &other ) : Parent( other ), baseUnion( other.baseUnion ) {} 333 357 334 358 UnionDecl *get_baseUnion() const { return baseUnion; } … … 342 366 /// looks up the members of this union named "name" and places them into "foundDecls" 343 367 /// Clones declarations into "foundDecls", caller responsible for freeing 344 void lookup( const std::string & name, std::list< Declaration* > &foundDecls ) const;368 void lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const; 345 369 346 370 virtual UnionInstType *clone() const { return new UnionInstType( *this ); } 347 virtual void accept( Visitor & v ) { v.visit( this ); }348 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }349 350 virtual void print( std::ostream & os, int indent = 0 ) const;371 virtual void accept( Visitor &v ) { v.visit( this ); } 372 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 373 374 virtual void print( std::ostream &os, int indent = 0 ) const; 351 375 private: 352 376 virtual std::string typeString() const; … … 360 384 typedef ReferenceToType Parent; 361 385 public: 362 EnumInstType( const Type::Qualifiers & tq, const std::string &name, const std::list< Attribute * > & attributes = std::list< Attribute * >() ) : Parent( tq, name, attributes ) {}363 EnumInstType( const Type::Qualifiers & tq, EnumDecl * baseEnum, const std::list< Attribute * > & attributes = std::list< Attribute * >() );364 EnumInstType( const EnumInstType & other ) : Parent( other ), baseEnum( other.baseEnum ) {}386 EnumInstType( const Type::Qualifiers &tq, const std::string &name, const std::list< Attribute * > & attributes = std::list< Attribute * >() ) : Parent( tq, name, attributes ) {} 387 EnumInstType( const Type::Qualifiers &tq, EnumDecl * baseEnum, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 388 EnumInstType( const EnumInstType &other ) : Parent( other ), baseEnum( other.baseEnum ) {} 365 389 366 390 EnumDecl *get_baseEnum() const { return baseEnum; } … … 370 394 371 395 virtual EnumInstType *clone() const { return new EnumInstType( *this ); } 372 virtual void accept( Visitor & v ) { v.visit( this ); }373 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }396 virtual void accept( Visitor &v ) { v.visit( this ); } 397 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 374 398 private: 375 399 virtual std::string typeString() const; … … 383 407 typedef ReferenceToType Parent; 384 408 public: 385 TraitInstType( const Type::Qualifiers & tq, const std::string &name, const std::list< Attribute * > & attributes = std::list< Attribute * >() ) : Parent( tq, name, attributes ) {}386 TraitInstType( const TraitInstType & other );409 TraitInstType( const Type::Qualifiers &tq, const std::string &name, const std::list< Attribute * > & attributes = std::list< Attribute * >() ) : Parent( tq, name, attributes ) {} 410 TraitInstType( const TraitInstType &other ); 387 411 ~TraitInstType(); 388 412 … … 392 416 393 417 virtual TraitInstType *clone() const { return new TraitInstType( *this ); } 394 virtual void accept( Visitor & v ) { v.visit( this ); }395 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }418 virtual void accept( Visitor &v ) { v.visit( this ); } 419 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 396 420 private: 397 421 virtual std::string typeString() const; … … 405 429 typedef ReferenceToType Parent; 406 430 public: 407 TypeInstType( const Type::Qualifiers & tq, const std::string &name, TypeDecl *baseType, const std::list< Attribute * > & attributes = std::list< Attribute * >() );408 TypeInstType( const Type::Qualifiers & tq, const std::string &name, bool isFtype, const std::list< Attribute * > & attributes = std::list< Attribute * >() );409 TypeInstType( const TypeInstType & other );431 TypeInstType( const Type::Qualifiers &tq, const std::string &name, TypeDecl *baseType, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 432 TypeInstType( const Type::Qualifiers &tq, const std::string &name, bool isFtype, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 433 TypeInstType( const TypeInstType &other ); 410 434 ~TypeInstType(); 411 435 … … 418 442 419 443 virtual TypeInstType *clone() const { return new TypeInstType( *this ); } 420 virtual void accept( Visitor & v ) { v.visit( this ); }421 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }422 virtual void print( std::ostream & os, int indent = 0 ) const;444 virtual void accept( Visitor &v ) { v.visit( this ); } 445 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 446 virtual void print( std::ostream &os, int indent = 0 ) const; 423 447 private: 424 448 virtual std::string typeString() const; … … 431 455 class TupleType : public Type { 432 456 public: 433 TupleType( const Type::Qualifiers & tq, const std::list< Type * > & types = std::list< Type * >(), const std::list< Attribute * > & attributes = std::list< Attribute * >() );457 TupleType( const Type::Qualifiers &tq, const std::list< Type * > & types = std::list< Type * >(), const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 434 458 TupleType( const TupleType& ); 435 459 virtual ~TupleType(); … … 452 476 453 477 virtual TupleType *clone() const { return new TupleType( *this ); } 454 virtual void accept( Visitor & v ) { v.visit( this ); }455 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }456 virtual void print( std::ostream & os, int indent = 0 ) const;478 virtual void accept( Visitor &v ) { v.visit( this ); } 479 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 480 virtual void print( std::ostream &os, int indent = 0 ) const; 457 481 private: 458 482 std::list<Type*> types; … … 461 485 class TypeofType : public Type { 462 486 public: 463 TypeofType( const Type::Qualifiers & tq, Expression *expr, const std::list< Attribute * > & attributes = std::list< Attribute * >() );487 TypeofType( const Type::Qualifiers &tq, Expression *expr, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 464 488 TypeofType( const TypeofType& ); 465 489 virtual ~TypeofType(); … … 471 495 472 496 virtual TypeofType *clone() const { return new TypeofType( *this ); } 473 virtual void accept( Visitor & v ) { v.visit( this ); }474 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }475 virtual void print( std::ostream & os, int indent = 0 ) const;497 virtual void accept( Visitor &v ) { v.visit( this ); } 498 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 499 virtual void print( std::ostream &os, int indent = 0 ) const; 476 500 private: 477 501 Expression *expr; … … 480 504 class AttrType : public Type { 481 505 public: 482 AttrType( const Type::Qualifiers & tq, const std::string &name, Expression *expr, const std::list< Attribute * > & attributes = std::list< Attribute * >() );483 AttrType( const Type::Qualifiers & tq, const std::string &name, Type *type, const std::list< Attribute * > & attributes = std::list< Attribute * >() );506 AttrType( const Type::Qualifiers &tq, const std::string &name, Expression *expr, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 507 AttrType( const Type::Qualifiers &tq, const std::string &name, Type *type, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 484 508 AttrType( const AttrType& ); 485 509 virtual ~AttrType(); 486 510 487 const std::string & get_name() const { return name; }488 void set_name( const std::string & newValue ) { name = newValue; }511 const std::string &get_name() const { return name; } 512 void set_name( const std::string &newValue ) { name = newValue; } 489 513 Expression *get_expr() const { return expr; } 490 514 void set_expr( Expression *newValue ) { expr = newValue; } … … 497 521 498 522 virtual AttrType *clone() const { return new AttrType( *this ); } 499 virtual void accept( Visitor & v ) { v.visit( this ); }500 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }501 virtual void print( std::ostream & os, int indent = 0 ) const;523 virtual void accept( Visitor &v ) { v.visit( this ); } 524 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 525 virtual void print( std::ostream &os, int indent = 0 ) const; 502 526 private: 503 527 std::string name; … … 516 540 517 541 virtual VarArgsType *clone() const { return new VarArgsType( *this ); } 518 virtual void accept( Visitor & v ) { v.visit( this ); }519 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }520 virtual void print( std::ostream & os, int indent = 0 ) const;542 virtual void accept( Visitor &v ) { v.visit( this ); } 543 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 544 virtual void print( std::ostream &os, int indent = 0 ) const; 521 545 }; 522 546 … … 528 552 529 553 virtual ZeroType *clone() const { return new ZeroType( *this ); } 530 virtual void accept( Visitor & v ) { v.visit( this ); }531 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }532 virtual void print( std::ostream & os, int indent = 0 ) const;554 virtual void accept( Visitor &v ) { v.visit( this ); } 555 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 556 virtual void print( std::ostream &os, int indent = 0 ) const; 533 557 }; 534 558 … … 540 564 541 565 virtual OneType *clone() const { return new OneType( *this ); } 542 virtual void accept( Visitor & v ) { v.visit( this ); }543 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }544 virtual void print( std::ostream & os, int indent = 0 ) const;566 virtual void accept( Visitor &v ) { v.visit( this ); } 567 virtual Type *acceptMutator( Mutator &m ) { return m.mutate( this ); } 568 virtual void print( std::ostream &os, int indent = 0 ) const; 545 569 }; 546 570 -
src/benchmark/CorCtxSwitch.c
rf2e40a9f rbf4ac09 1 1 #include <fstream> 2 2 #include <stdlib> 3 #include <thread >3 #include <threads> 4 4 5 5 #include <unistd.h> // sysconf … … 24 24 25 25 struct GreatSuspender { 26 coroutine _descc;26 coroutine c; 27 27 }; 28 28 -
src/benchmark/ThrdCtxSwitch.c
rf2e40a9f rbf4ac09 1 1 #include <fstream> 2 2 #include <stdlib> 3 #include <thread >3 #include <threads> 4 4 5 5 #include <unistd.h> // sysconf -
src/benchmark/bench.c
rf2e40a9f rbf4ac09 2 2 #include <fstream> 3 3 #include <stdlib> 4 #include <thread >4 #include <threads> 5 5 6 6 #include <unistd.h> // sysconf … … 86 86 //======================================= 87 87 88 struct CoroutineDummy { coroutine _descc; };88 struct CoroutineDummy { coroutine c; }; 89 89 DECL_COROUTINE(CoroutineDummy); 90 90 void main(CoroutineDummy * this) {} … … 119 119 struct CoroutineResume { 120 120 int N; 121 coroutine _descc;121 coroutine c; 122 122 }; 123 123 … … 150 150 //======================================= 151 151 152 struct ThreadDummy { thread _desct; };152 struct ThreadDummy { thread t; }; 153 153 DECL_THREAD(ThreadDummy); 154 154 void main(ThreadDummy * this) {} … … 180 180 int N; 181 181 long long result; 182 thread _desct;182 thread t; 183 183 }; 184 184 -
src/benchmark/csv-data.c
rf2e40a9f rbf4ac09 1 1 #include <fstream> 2 2 #include <stdlib> 3 #include <thread >3 #include <threads> 4 4 5 5 extern "C" { … … 26 26 27 27 struct GreatSuspender { 28 coroutine _descc;28 coroutine c; 29 29 }; 30 30 -
src/examples/multicore.c
rf2e40a9f rbf4ac09 1 1 #include <kernel> 2 #include <thread >2 #include <threads> 3 3 4 struct MyThread { thread _desct; };4 struct MyThread { thread t; }; 5 5 6 6 DECL_THREAD(MyThread); -
src/libcfa/Makefile.am
rf2e40a9f rbf4ac09 45 45 # not all platforms support concurrency, add option do disable it 46 46 if BUILD_CONCURRENCY 47 headers += containers/vector concurrency/coroutine concurrency/threadconcurrency/kernel concurrency/monitor47 headers += containers/vector concurrency/coroutines concurrency/threads concurrency/kernel concurrency/monitor 48 48 endif 49 49 -
src/libcfa/Makefile.in
rf2e40a9f rbf4ac09 43 43 44 44 # not all platforms support concurrency, add option do disable it 45 @BUILD_CONCURRENCY_TRUE@am__append_3 = containers/vector concurrency/coroutine concurrency/threadconcurrency/kernel concurrency/monitor45 @BUILD_CONCURRENCY_TRUE@am__append_3 = containers/vector concurrency/coroutines concurrency/threads concurrency/kernel concurrency/monitor 46 46 47 47 # not all platforms support concurrency, add option do disable it … … 99 99 am__libcfa_d_a_SOURCES_DIST = libcfa-prelude.c limits.c stdlib.c \ 100 100 math.c iostream.c fstream.c iterator.c rational.c assert.c \ 101 containers/vector.c concurrency/coroutine .c \102 concurrency/thread .c concurrency/kernel.c \101 containers/vector.c concurrency/coroutines.c \ 102 concurrency/threads.c concurrency/kernel.c \ 103 103 concurrency/monitor.c concurrency/CtxSwitch-@MACHINE_TYPE@.S \ 104 104 concurrency/invoke.c 105 105 am__dirstamp = $(am__leading_dot)dirstamp 106 106 @BUILD_CONCURRENCY_TRUE@am__objects_1 = containers/libcfa_d_a-vector.$(OBJEXT) \ 107 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_d_a-coroutine .$(OBJEXT) \108 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_d_a-thread .$(OBJEXT) \107 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_d_a-coroutines.$(OBJEXT) \ 108 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_d_a-threads.$(OBJEXT) \ 109 109 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_d_a-kernel.$(OBJEXT) \ 110 110 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_d_a-monitor.$(OBJEXT) … … 124 124 am__libcfa_a_SOURCES_DIST = libcfa-prelude.c limits.c stdlib.c math.c \ 125 125 iostream.c fstream.c iterator.c rational.c assert.c \ 126 containers/vector.c concurrency/coroutine .c \127 concurrency/thread .c concurrency/kernel.c \126 containers/vector.c concurrency/coroutines.c \ 127 concurrency/threads.c concurrency/kernel.c \ 128 128 concurrency/monitor.c concurrency/CtxSwitch-@MACHINE_TYPE@.S \ 129 129 concurrency/invoke.c 130 130 @BUILD_CONCURRENCY_TRUE@am__objects_5 = \ 131 131 @BUILD_CONCURRENCY_TRUE@ containers/libcfa_a-vector.$(OBJEXT) \ 132 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_a-coroutine .$(OBJEXT) \133 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_a-thread .$(OBJEXT) \132 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_a-coroutines.$(OBJEXT) \ 133 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_a-threads.$(OBJEXT) \ 134 134 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_a-kernel.$(OBJEXT) \ 135 135 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_a-monitor.$(OBJEXT) … … 175 175 am__nobase_cfa_include_HEADERS_DIST = limits stdlib math iostream \ 176 176 fstream iterator rational assert containers/vector \ 177 concurrency/coroutine concurrency/threadconcurrency/kernel \177 concurrency/coroutines concurrency/threads concurrency/kernel \ 178 178 concurrency/monitor ${shell echo stdhdr/*} \ 179 179 concurrency/invoke.h … … 397 397 @$(MKDIR_P) concurrency/$(DEPDIR) 398 398 @: > concurrency/$(DEPDIR)/$(am__dirstamp) 399 concurrency/libcfa_d_a-coroutine .$(OBJEXT): \399 concurrency/libcfa_d_a-coroutines.$(OBJEXT): \ 400 400 concurrency/$(am__dirstamp) \ 401 401 concurrency/$(DEPDIR)/$(am__dirstamp) 402 concurrency/libcfa_d_a-thread .$(OBJEXT): concurrency/$(am__dirstamp) \402 concurrency/libcfa_d_a-threads.$(OBJEXT): concurrency/$(am__dirstamp) \ 403 403 concurrency/$(DEPDIR)/$(am__dirstamp) 404 404 concurrency/libcfa_d_a-kernel.$(OBJEXT): concurrency/$(am__dirstamp) \ … … 417 417 containers/libcfa_a-vector.$(OBJEXT): containers/$(am__dirstamp) \ 418 418 containers/$(DEPDIR)/$(am__dirstamp) 419 concurrency/libcfa_a-coroutine.$(OBJEXT): concurrency/$(am__dirstamp) \ 419 concurrency/libcfa_a-coroutines.$(OBJEXT): \ 420 concurrency/$(am__dirstamp) \ 420 421 concurrency/$(DEPDIR)/$(am__dirstamp) 421 concurrency/libcfa_a-thread .$(OBJEXT): concurrency/$(am__dirstamp) \422 concurrency/libcfa_a-threads.$(OBJEXT): concurrency/$(am__dirstamp) \ 422 423 concurrency/$(DEPDIR)/$(am__dirstamp) 423 424 concurrency/libcfa_a-kernel.$(OBJEXT): concurrency/$(am__dirstamp) \ … … 435 436 -rm -f *.$(OBJEXT) 436 437 -rm -f concurrency/CtxSwitch-@MACHINE_TYPE@.$(OBJEXT) 437 -rm -f concurrency/libcfa_a-coroutine .$(OBJEXT)438 -rm -f concurrency/libcfa_a-coroutines.$(OBJEXT) 438 439 -rm -f concurrency/libcfa_a-invoke.$(OBJEXT) 439 440 -rm -f concurrency/libcfa_a-kernel.$(OBJEXT) 440 441 -rm -f concurrency/libcfa_a-monitor.$(OBJEXT) 441 -rm -f concurrency/libcfa_a-thread .$(OBJEXT)442 -rm -f concurrency/libcfa_d_a-coroutine .$(OBJEXT)442 -rm -f concurrency/libcfa_a-threads.$(OBJEXT) 443 -rm -f concurrency/libcfa_d_a-coroutines.$(OBJEXT) 443 444 -rm -f concurrency/libcfa_d_a-invoke.$(OBJEXT) 444 445 -rm -f concurrency/libcfa_d_a-kernel.$(OBJEXT) 445 446 -rm -f concurrency/libcfa_d_a-monitor.$(OBJEXT) 446 -rm -f concurrency/libcfa_d_a-thread .$(OBJEXT)447 -rm -f concurrency/libcfa_d_a-threads.$(OBJEXT) 447 448 -rm -f containers/libcfa_a-vector.$(OBJEXT) 448 449 -rm -f containers/libcfa_d_a-vector.$(OBJEXT) … … 470 471 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-stdlib.Po@am__quote@ 471 472 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/CtxSwitch-@MACHINE_TYPE@.Po@am__quote@ 472 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-coroutine .Po@am__quote@473 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-coroutines.Po@am__quote@ 473 474 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-invoke.Po@am__quote@ 474 475 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-kernel.Po@am__quote@ 475 476 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-monitor.Po@am__quote@ 476 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-thread .Po@am__quote@477 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-coroutine .Po@am__quote@477 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-threads.Po@am__quote@ 478 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-coroutines.Po@am__quote@ 478 479 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-invoke.Po@am__quote@ 479 480 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-kernel.Po@am__quote@ 480 481 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-monitor.Po@am__quote@ 481 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-thread .Po@am__quote@482 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_d_a-threads.Po@am__quote@ 482 483 @AMDEP_TRUE@@am__include@ @am__quote@containers/$(DEPDIR)/libcfa_a-vector.Po@am__quote@ 483 484 @AMDEP_TRUE@@am__include@ @am__quote@containers/$(DEPDIR)/libcfa_d_a-vector.Po@am__quote@ … … 648 649 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o containers/libcfa_d_a-vector.obj `if test -f 'containers/vector.c'; then $(CYGPATH_W) 'containers/vector.c'; else $(CYGPATH_W) '$(srcdir)/containers/vector.c'; fi` 649 650 650 concurrency/libcfa_d_a-coroutine .o: concurrency/coroutine.c651 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_d_a-coroutine .o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-coroutine.Tpo -c -o concurrency/libcfa_d_a-coroutine.o `test -f 'concurrency/coroutine.c' || echo '$(srcdir)/'`concurrency/coroutine.c652 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-coroutine .Tpo concurrency/$(DEPDIR)/libcfa_d_a-coroutine.Po653 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/coroutine .c' object='concurrency/libcfa_d_a-coroutine.o' libtool=no @AMDEPBACKSLASH@654 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 655 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_d_a-coroutine .o `test -f 'concurrency/coroutine.c' || echo '$(srcdir)/'`concurrency/coroutine.c656 657 concurrency/libcfa_d_a-coroutine .obj: concurrency/coroutine.c658 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_d_a-coroutine .obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-coroutine.Tpo -c -o concurrency/libcfa_d_a-coroutine.obj `if test -f 'concurrency/coroutine.c'; then $(CYGPATH_W) 'concurrency/coroutine.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutine.c'; fi`659 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-coroutine .Tpo concurrency/$(DEPDIR)/libcfa_d_a-coroutine.Po660 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/coroutine .c' object='concurrency/libcfa_d_a-coroutine.obj' libtool=no @AMDEPBACKSLASH@661 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 662 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_d_a-coroutine .obj `if test -f 'concurrency/coroutine.c'; then $(CYGPATH_W) 'concurrency/coroutine.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutine.c'; fi`663 664 concurrency/libcfa_d_a-thread .o: concurrency/thread.c665 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_d_a-thread .o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-thread.Tpo -c -o concurrency/libcfa_d_a-thread.o `test -f 'concurrency/thread.c' || echo '$(srcdir)/'`concurrency/thread.c666 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-thread .Tpo concurrency/$(DEPDIR)/libcfa_d_a-thread.Po667 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/thread .c' object='concurrency/libcfa_d_a-thread.o' libtool=no @AMDEPBACKSLASH@668 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 669 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_d_a-thread .o `test -f 'concurrency/thread.c' || echo '$(srcdir)/'`concurrency/thread.c670 671 concurrency/libcfa_d_a-thread .obj: concurrency/thread.c672 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_d_a-thread .obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-thread.Tpo -c -o concurrency/libcfa_d_a-thread.obj `if test -f 'concurrency/thread.c'; then $(CYGPATH_W) 'concurrency/thread.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/thread.c'; fi`673 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-thread .Tpo concurrency/$(DEPDIR)/libcfa_d_a-thread.Po674 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/thread .c' object='concurrency/libcfa_d_a-thread.obj' libtool=no @AMDEPBACKSLASH@675 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 676 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_d_a-thread .obj `if test -f 'concurrency/thread.c'; then $(CYGPATH_W) 'concurrency/thread.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/thread.c'; fi`651 concurrency/libcfa_d_a-coroutines.o: concurrency/coroutines.c 652 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_d_a-coroutines.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-coroutines.Tpo -c -o concurrency/libcfa_d_a-coroutines.o `test -f 'concurrency/coroutines.c' || echo '$(srcdir)/'`concurrency/coroutines.c 653 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-coroutines.Tpo concurrency/$(DEPDIR)/libcfa_d_a-coroutines.Po 654 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/coroutines.c' object='concurrency/libcfa_d_a-coroutines.o' libtool=no @AMDEPBACKSLASH@ 655 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 656 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_d_a-coroutines.o `test -f 'concurrency/coroutines.c' || echo '$(srcdir)/'`concurrency/coroutines.c 657 658 concurrency/libcfa_d_a-coroutines.obj: concurrency/coroutines.c 659 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_d_a-coroutines.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-coroutines.Tpo -c -o concurrency/libcfa_d_a-coroutines.obj `if test -f 'concurrency/coroutines.c'; then $(CYGPATH_W) 'concurrency/coroutines.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutines.c'; fi` 660 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-coroutines.Tpo concurrency/$(DEPDIR)/libcfa_d_a-coroutines.Po 661 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/coroutines.c' object='concurrency/libcfa_d_a-coroutines.obj' libtool=no @AMDEPBACKSLASH@ 662 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 663 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_d_a-coroutines.obj `if test -f 'concurrency/coroutines.c'; then $(CYGPATH_W) 'concurrency/coroutines.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutines.c'; fi` 664 665 concurrency/libcfa_d_a-threads.o: concurrency/threads.c 666 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_d_a-threads.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-threads.Tpo -c -o concurrency/libcfa_d_a-threads.o `test -f 'concurrency/threads.c' || echo '$(srcdir)/'`concurrency/threads.c 667 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-threads.Tpo concurrency/$(DEPDIR)/libcfa_d_a-threads.Po 668 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/threads.c' object='concurrency/libcfa_d_a-threads.o' libtool=no @AMDEPBACKSLASH@ 669 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 670 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_d_a-threads.o `test -f 'concurrency/threads.c' || echo '$(srcdir)/'`concurrency/threads.c 671 672 concurrency/libcfa_d_a-threads.obj: concurrency/threads.c 673 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_d_a-threads.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-threads.Tpo -c -o concurrency/libcfa_d_a-threads.obj `if test -f 'concurrency/threads.c'; then $(CYGPATH_W) 'concurrency/threads.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/threads.c'; fi` 674 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_d_a-threads.Tpo concurrency/$(DEPDIR)/libcfa_d_a-threads.Po 675 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/threads.c' object='concurrency/libcfa_d_a-threads.obj' libtool=no @AMDEPBACKSLASH@ 676 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 677 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_d_a-threads.obj `if test -f 'concurrency/threads.c'; then $(CYGPATH_W) 'concurrency/threads.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/threads.c'; fi` 677 678 678 679 concurrency/libcfa_d_a-kernel.o: concurrency/kernel.c … … 844 845 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o containers/libcfa_a-vector.obj `if test -f 'containers/vector.c'; then $(CYGPATH_W) 'containers/vector.c'; else $(CYGPATH_W) '$(srcdir)/containers/vector.c'; fi` 845 846 846 concurrency/libcfa_a-coroutine .o: concurrency/coroutine.c847 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-coroutine .o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-coroutine.Tpo -c -o concurrency/libcfa_a-coroutine.o `test -f 'concurrency/coroutine.c' || echo '$(srcdir)/'`concurrency/coroutine.c848 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-coroutine .Tpo concurrency/$(DEPDIR)/libcfa_a-coroutine.Po849 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/coroutine .c' object='concurrency/libcfa_a-coroutine.o' libtool=no @AMDEPBACKSLASH@850 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 851 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_a-coroutine .o `test -f 'concurrency/coroutine.c' || echo '$(srcdir)/'`concurrency/coroutine.c852 853 concurrency/libcfa_a-coroutine .obj: concurrency/coroutine.c854 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-coroutine .obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-coroutine.Tpo -c -o concurrency/libcfa_a-coroutine.obj `if test -f 'concurrency/coroutine.c'; then $(CYGPATH_W) 'concurrency/coroutine.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutine.c'; fi`855 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-coroutine .Tpo concurrency/$(DEPDIR)/libcfa_a-coroutine.Po856 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/coroutine .c' object='concurrency/libcfa_a-coroutine.obj' libtool=no @AMDEPBACKSLASH@857 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 858 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_a-coroutine .obj `if test -f 'concurrency/coroutine.c'; then $(CYGPATH_W) 'concurrency/coroutine.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutine.c'; fi`859 860 concurrency/libcfa_a-thread .o: concurrency/thread.c861 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-thread .o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-thread.Tpo -c -o concurrency/libcfa_a-thread.o `test -f 'concurrency/thread.c' || echo '$(srcdir)/'`concurrency/thread.c862 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-thread .Tpo concurrency/$(DEPDIR)/libcfa_a-thread.Po863 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/thread .c' object='concurrency/libcfa_a-thread.o' libtool=no @AMDEPBACKSLASH@864 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 865 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_a-thread .o `test -f 'concurrency/thread.c' || echo '$(srcdir)/'`concurrency/thread.c866 867 concurrency/libcfa_a-thread .obj: concurrency/thread.c868 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-thread .obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-thread.Tpo -c -o concurrency/libcfa_a-thread.obj `if test -f 'concurrency/thread.c'; then $(CYGPATH_W) 'concurrency/thread.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/thread.c'; fi`869 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-thread .Tpo concurrency/$(DEPDIR)/libcfa_a-thread.Po870 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/thread .c' object='concurrency/libcfa_a-thread.obj' libtool=no @AMDEPBACKSLASH@871 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 872 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_a-thread .obj `if test -f 'concurrency/thread.c'; then $(CYGPATH_W) 'concurrency/thread.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/thread.c'; fi`847 concurrency/libcfa_a-coroutines.o: concurrency/coroutines.c 848 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-coroutines.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-coroutines.Tpo -c -o concurrency/libcfa_a-coroutines.o `test -f 'concurrency/coroutines.c' || echo '$(srcdir)/'`concurrency/coroutines.c 849 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-coroutines.Tpo concurrency/$(DEPDIR)/libcfa_a-coroutines.Po 850 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/coroutines.c' object='concurrency/libcfa_a-coroutines.o' libtool=no @AMDEPBACKSLASH@ 851 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 852 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_a-coroutines.o `test -f 'concurrency/coroutines.c' || echo '$(srcdir)/'`concurrency/coroutines.c 853 854 concurrency/libcfa_a-coroutines.obj: concurrency/coroutines.c 855 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-coroutines.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-coroutines.Tpo -c -o concurrency/libcfa_a-coroutines.obj `if test -f 'concurrency/coroutines.c'; then $(CYGPATH_W) 'concurrency/coroutines.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutines.c'; fi` 856 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-coroutines.Tpo concurrency/$(DEPDIR)/libcfa_a-coroutines.Po 857 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/coroutines.c' object='concurrency/libcfa_a-coroutines.obj' libtool=no @AMDEPBACKSLASH@ 858 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 859 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_a-coroutines.obj `if test -f 'concurrency/coroutines.c'; then $(CYGPATH_W) 'concurrency/coroutines.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/coroutines.c'; fi` 860 861 concurrency/libcfa_a-threads.o: concurrency/threads.c 862 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-threads.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-threads.Tpo -c -o concurrency/libcfa_a-threads.o `test -f 'concurrency/threads.c' || echo '$(srcdir)/'`concurrency/threads.c 863 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-threads.Tpo concurrency/$(DEPDIR)/libcfa_a-threads.Po 864 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/threads.c' object='concurrency/libcfa_a-threads.o' libtool=no @AMDEPBACKSLASH@ 865 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 866 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_a-threads.o `test -f 'concurrency/threads.c' || echo '$(srcdir)/'`concurrency/threads.c 867 868 concurrency/libcfa_a-threads.obj: concurrency/threads.c 869 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_a-threads.obj -MD -MP -MF concurrency/$(DEPDIR)/libcfa_a-threads.Tpo -c -o concurrency/libcfa_a-threads.obj `if test -f 'concurrency/threads.c'; then $(CYGPATH_W) 'concurrency/threads.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/threads.c'; fi` 870 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) concurrency/$(DEPDIR)/libcfa_a-threads.Tpo concurrency/$(DEPDIR)/libcfa_a-threads.Po 871 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concurrency/threads.c' object='concurrency/libcfa_a-threads.obj' libtool=no @AMDEPBACKSLASH@ 872 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 873 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_a-threads.obj `if test -f 'concurrency/threads.c'; then $(CYGPATH_W) 'concurrency/threads.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/threads.c'; fi` 873 874 874 875 concurrency/libcfa_a-kernel.o: concurrency/kernel.c -
src/libcfa/concurrency/invoke.c
rf2e40a9f rbf4ac09 29 29 30 30 extern void __suspend_internal(void); 31 extern void __thread_signal_termination(struct thread _desc*);31 extern void __thread_signal_termination(struct thread*); 32 32 33 33 void CtxInvokeCoroutine( 34 34 void (*main)(void *), 35 struct coroutine _desc*(*get_coroutine)(void *),35 struct coroutine *(*get_coroutine)(void *), 36 36 void *this 37 37 ) { 38 38 // LIB_DEBUG_PRINTF("Invoke Coroutine : Received %p (main %p, get_c %p)\n", this, main, get_coroutine); 39 39 40 struct coroutine _desc* cor = get_coroutine( this );40 struct coroutine* cor = get_coroutine( this ); 41 41 42 42 if(cor->state == Primed) { … … 57 57 void CtxInvokeThread( 58 58 void (*main)(void *), 59 struct thread _desc*(*get_thread)(void *),59 struct thread *(*get_thread)(void *), 60 60 void *this 61 61 ) { 62 62 __suspend_internal(); 63 63 64 struct thread _desc* thrd = get_thread( this );65 struct coroutine _desc* cor = &thrd->c;64 struct thread* thrd = get_thread( this ); 65 struct coroutine* cor = &thrd->c; 66 66 cor->state = Active; 67 67 … … 79 79 void CtxStart( 80 80 void (*main)(void *), 81 struct coroutine _desc*(*get_coroutine)(void *),81 struct coroutine *(*get_coroutine)(void *), 82 82 void *this, 83 83 void (*invoke)(void *) -
src/libcfa/concurrency/invoke.h
rf2e40a9f rbf4ac09 35 35 36 36 struct simple_thread_list { 37 struct thread _desc* head;38 struct thread _desc** tail;37 struct thread * head; 38 struct thread ** tail; 39 39 }; 40 40 … … 48 48 extern "Cforall" { 49 49 void ?{}( struct simple_thread_list * ); 50 void append( struct simple_thread_list *, struct thread _desc* );51 struct thread _desc* pop_head( struct simple_thread_list * );50 void append( struct simple_thread_list *, struct thread * ); 51 struct thread * pop_head( struct simple_thread_list * ); 52 52 53 53 void ?{}(spinlock * this); … … 71 71 enum coroutine_state { Halted, Start, Inactive, Active, Primed }; 72 72 73 struct coroutine _desc{73 struct coroutine { 74 74 struct coStack_t stack; 75 75 const char *name; // textual name for coroutine/task, initialized by uC++ generated code 76 76 int errno_; // copy of global UNIX variable errno 77 77 enum coroutine_state state; // current execution status for coroutine 78 struct coroutine _desc*starter; // first coroutine to resume this one79 struct coroutine _desc*last; // last coroutine to resume this one78 struct coroutine *starter; // first coroutine to resume this one 79 struct coroutine *last; // last coroutine to resume this one 80 80 }; 81 81 82 struct thread _desc{83 struct coroutine _descc; // coroutine body used to store context82 struct thread { 83 struct coroutine c; // coroutine body used to store context 84 84 struct signal_once terminated; // indicate if execuation state is not halted 85 struct thread _desc* next; // instrusive link field for threads85 struct thread * next; // instrusive link field for threads 86 86 }; 87 87 -
src/libcfa/concurrency/kernel
rf2e40a9f rbf4ac09 6 6 // file "LICENCE" distributed with Cforall. 7 7 // 8 // kernel--8 // threads -- 9 9 // 10 10 // Author : Thierry Delisle … … 49 49 struct FinishAction { 50 50 FinishOpCode action_code; 51 thread _desc* thrd;51 thread * thrd; 52 52 spinlock * lock; 53 53 }; … … 62 62 struct processorCtx_t * runner; 63 63 cluster * cltr; 64 coroutine _desc* current_coroutine;65 thread _desc* current_thread;64 coroutine * current_coroutine; 65 thread * current_thread; 66 66 pthread_t kernel_thread; 67 67 -
src/libcfa/concurrency/kernel.c
rf2e40a9f rbf4ac09 43 43 KERNEL_STORAGE(cluster, systemCluster); 44 44 KERNEL_STORAGE(processor, systemProcessor); 45 KERNEL_STORAGE(thread _desc, mainThread);45 KERNEL_STORAGE(thread, mainThread); 46 46 KERNEL_STORAGE(machine_context_t, mainThread_context); 47 47 48 48 cluster * systemCluster; 49 49 processor * systemProcessor; 50 thread _desc* mainThread;50 thread * mainThread; 51 51 52 52 //----------------------------------------------------------------------------- … … 55 55 thread_local processor * this_processor; 56 56 57 coroutine_desc * this_coroutine(void) { 57 processor * get_this_processor() { 58 return this_processor; 59 } 60 61 coroutine * this_coroutine(void) { 58 62 return this_processor->current_coroutine; 59 63 } 60 64 61 thread _desc* this_thread(void) {65 thread * this_thread(void) { 62 66 return this_processor->current_thread; 63 67 } … … 99 103 } 100 104 101 void ?{}( coroutine _desc* this, current_stack_info_t * info) {105 void ?{}( coroutine * this, current_stack_info_t * info) { 102 106 (&this->stack){ info }; 103 107 this->name = "Main Thread"; … … 106 110 } 107 111 108 void ?{}( thread _desc* this, current_stack_info_t * info) {112 void ?{}( thread * this, current_stack_info_t * info) { 109 113 (&this->c){ info }; 110 114 } … … 175 179 LIB_DEBUG_PRINTF("Kernel : core %p starting\n", this); 176 180 177 thread _desc* readyThread = NULL;181 thread * readyThread = NULL; 178 182 for( unsigned int spin_count = 0; ! this->is_terminated; spin_count++ ) 179 183 { … … 202 206 // runThread runs a thread by context switching 203 207 // from the processor coroutine to the target thread 204 void runThread(processor * this, thread _desc* dst) {205 coroutine _desc* proc_cor = get_coroutine(this->runner);206 coroutine _desc* thrd_cor = get_coroutine(dst);208 void runThread(processor * this, thread * dst) { 209 coroutine * proc_cor = get_coroutine(this->runner); 210 coroutine * thrd_cor = get_coroutine(dst); 207 211 208 212 //Reset the terminating actions here … … 293 297 //----------------------------------------------------------------------------- 294 298 // Scheduler routines 295 void ScheduleThread( thread _desc* thrd ) {299 void ScheduleThread( thread * thrd ) { 296 300 assertf( thrd->next == NULL, "Expected null got %p", thrd->next ); 297 301 … … 301 305 } 302 306 303 thread _desc* nextThread(cluster * this) {307 thread * nextThread(cluster * this) { 304 308 lock( &this->lock ); 305 thread _desc* head = pop_head( &this->ready_queue );309 thread * head = pop_head( &this->ready_queue ); 306 310 unlock( &this->lock ); 307 311 return head; … … 313 317 314 318 void ScheduleInternal( spinlock * lock ) { 315 this_processor->finish.action_code = Release;316 this_processor->finish.lock = lock;319 get_this_processor()->finish.action_code = Release; 320 get_this_processor()->finish.lock = lock; 317 321 suspend(); 318 322 } 319 323 320 void ScheduleInternal( thread _desc* thrd ) {321 this_processor->finish.action_code = Schedule;322 this_processor->finish.thrd = thrd;324 void ScheduleInternal( thread * thrd ) { 325 get_this_processor()->finish.action_code = Schedule; 326 get_this_processor()->finish.thrd = thrd; 323 327 suspend(); 324 328 } 325 329 326 void ScheduleInternal( spinlock * lock, thread _desc* thrd ) {327 this_processor->finish.action_code = Release_Schedule;328 this_processor->finish.lock = lock;329 this_processor->finish.thrd = thrd;330 void ScheduleInternal( spinlock * lock, thread * thrd ) { 331 get_this_processor()->finish.action_code = Release_Schedule; 332 get_this_processor()->finish.lock = lock; 333 get_this_processor()->finish.thrd = thrd; 330 334 suspend(); 331 335 } … … 339 343 // SKULLDUGGERY: the mainThread steals the process main thread 340 344 // which will then be scheduled by the systemProcessor normally 341 mainThread = (thread _desc*)&mainThread_storage;345 mainThread = (thread *)&mainThread_storage; 342 346 current_stack_info_t info; 343 347 mainThread{ &info }; … … 436 440 this->condition = true; 437 441 438 thread _desc* it;442 thread * it; 439 443 while( it = pop_head( &this->blocked) ) { 440 444 ScheduleThread( it ); … … 451 455 } 452 456 453 void append( simple_thread_list * this, thread _desc* t ) {457 void append( simple_thread_list * this, thread * t ) { 454 458 assert(this->tail != NULL); 455 459 *this->tail = t; … … 457 461 } 458 462 459 thread _desc* pop_head( simple_thread_list * this ) {460 thread _desc* head = this->head;463 thread * pop_head( simple_thread_list * this ) { 464 thread * head = this->head; 461 465 if( head ) { 462 466 this->head = head->next; -
src/libcfa/concurrency/kernel_private.h
rf2e40a9f rbf4ac09 6 6 // file "LICENCE" distributed with Cforall. 7 7 // 8 // kernel_private.h--8 // threads -- 9 9 // 10 10 // Author : Thierry Delisle … … 19 19 20 20 #include "kernel" 21 #include "thread "21 #include "threads" 22 22 23 23 //----------------------------------------------------------------------------- 24 24 // Scheduler 25 void ScheduleThread( thread _desc* );26 thread _desc* nextThread(cluster * this);25 void ScheduleThread( thread * ); 26 thread * nextThread(cluster * this); 27 27 28 28 void ScheduleInternal(); 29 29 void ScheduleInternal(spinlock * lock); 30 void ScheduleInternal(thread _desc* thrd);31 void ScheduleInternal(spinlock * lock, thread _desc* thrd);30 void ScheduleInternal(thread * thrd); 31 void ScheduleInternal(spinlock * lock, thread * thrd); 32 32 33 33 //----------------------------------------------------------------------------- … … 35 35 struct processorCtx_t { 36 36 processor * proc; 37 coroutine _descc;37 coroutine c; 38 38 }; 39 39 … … 42 42 void main(processorCtx_t *); 43 43 void start(processor * this); 44 void runThread(processor * this, thread _desc* dst);44 void runThread(processor * this, thread * dst); 45 45 void finishRunning(processor * this); 46 46 void spin(processor * this, unsigned int * spin_count); … … 53 53 } 54 54 55 extern void ThreadCtxSwitch(coroutine _desc * src, coroutine_desc* dst);55 extern void ThreadCtxSwitch(coroutine * src, coroutine * dst); 56 56 57 57 #endif //KERNEL_PRIVATE_H -
src/libcfa/concurrency/monitor
rf2e40a9f rbf4ac09 22 22 #include "stdlib" 23 23 24 struct monitor_desc{24 struct __monitor_t { 25 25 spinlock lock; 26 thread _desc* owner;26 thread * owner; 27 27 simple_thread_list entry_queue; 28 28 unsigned int recursion; 29 29 }; 30 30 31 static inline void ?{}( monitor_desc* this) {31 static inline void ?{}(__monitor_t * this) { 32 32 this->owner = 0; 33 33 this->recursion = 0; … … 35 35 36 36 //Basic entering routine 37 void enter( monitor_desc*);38 void leave( monitor_desc*);37 void enter(__monitor_t *); 38 void leave(__monitor_t *); 39 39 40 40 //Array entering routine 41 void enter( monitor_desc**, int count);42 void leave( monitor_desc**, int count);41 void enter(__monitor_t **, int count); 42 void leave(__monitor_t **, int count); 43 43 44 44 struct monitor_guard_t { 45 monitor_desc** m;45 __monitor_t ** m; 46 46 int count; 47 47 }; 48 48 49 static inline int ?<?( monitor_desc* lhs, monitor_desc* rhs) {49 static inline int ?<?(__monitor_t* lhs, __monitor_t* rhs) { 50 50 return ((intptr_t)lhs) < ((intptr_t)rhs); 51 51 } 52 52 53 static inline void ?{}( monitor_guard_t * this, monitor_desc** m ) {53 static inline void ?{}( monitor_guard_t * this, __monitor_t ** m ) { 54 54 this->m = m; 55 55 this->count = 1; … … 57 57 } 58 58 59 static inline void ?{}( monitor_guard_t * this, monitor_desc** m, int count ) {59 static inline void ?{}( monitor_guard_t * this, __monitor_t ** m, int count ) { 60 60 this->m = m; 61 61 this->count = count; -
src/libcfa/concurrency/monitor.c
rf2e40a9f rbf4ac09 6 6 // file "LICENCE" distributed with Cforall. 7 7 // 8 // monitor_desc.c --8 // __monitor_t.c -- 9 9 // 10 10 // Author : Thierry Delisle … … 19 19 #include "kernel_private.h" 20 20 21 void enter( monitor_desc* this) {21 void enter(__monitor_t * this) { 22 22 lock( &this->lock ); 23 thread _desc* thrd = this_thread();23 thread * thrd = this_thread(); 24 24 25 25 if( !this->owner ) { … … 45 45 } 46 46 47 void leave( monitor_desc* this) {47 void leave(__monitor_t * this) { 48 48 lock( &this->lock ); 49 49 50 thread _desc* thrd = this_thread();50 thread * thrd = this_thread(); 51 51 assert( thrd == this->owner ); 52 52 … … 55 55 56 56 //If we left the last level of recursion it means we are changing who owns the monitor 57 thread _desc* new_owner = 0;57 thread * new_owner = 0; 58 58 if( this->recursion == 0) { 59 59 //Get the next thread in the list … … 72 72 } 73 73 74 void enter( monitor_desc** monitors, int count) {74 void enter(__monitor_t ** monitors, int count) { 75 75 for(int i = 0; i < count; i++) { 76 76 // printf("%d\n", i); … … 79 79 } 80 80 81 void leave( monitor_desc** monitors, int count) {81 void leave(__monitor_t ** monitors, int count) { 82 82 for(int i = count - 1; i >= 0; i--) { 83 83 // printf("%d\n", i); -
src/tests/coroutine.c
rf2e40a9f rbf4ac09 1 1 #include <fstream> 2 #include <coroutine >2 #include <coroutines> 3 3 4 4 struct Fibonacci { 5 5 int fn; // used for communication 6 coroutine _descc;6 coroutine c; 7 7 }; 8 8 … … 11 11 } 12 12 13 coroutine _desc* get_coroutine(Fibonacci* this) {13 coroutine* get_coroutine(Fibonacci* this) { 14 14 return &this->c; 15 15 } … … 47 47 #ifdef MORE_DEBUG 48 48 Fibonacci *pf1 = &f1, *pf2 = &f2; 49 coroutine _desc*cf1 = &f1.c, *cf2 = &f2.c;49 coroutine *cf1 = &f1.c, *cf2 = &f2.c; 50 50 covptr_t *vf1 = vtable(pf1), *vf2 = vtable(pf2); 51 coroutine _desc*cv1 = get_coroutine(vf1), *cv2 = get_coroutine(vf2);51 coroutine *cv1 = get_coroutine(vf1), *cv2 = get_coroutine(vf2); 52 52 Fibonacci *ov1 = (Fibonacci *)get_object(vf1), *ov2 = (Fibonacci *)get_object(vf2); 53 53 -
src/tests/monitor.c
rf2e40a9f rbf4ac09 2 2 #include <kernel> 3 3 #include <monitor> 4 #include <thread >4 #include <threads> 5 5 6 6 struct global_t { 7 7 int value; 8 monitor_descm;8 __monitor_t m; 9 9 }; 10 10 … … 16 16 17 17 void increment( /*mutex*/ global_t * this ) { 18 monitor_desc* mon = &this->m;18 __monitor_t * mon = &this->m; 19 19 monitor_guard_t g1 = { &mon }; 20 20 { … … 27 27 } 28 28 29 struct MyThread { thread _desct; };29 struct MyThread { thread t; }; 30 30 31 31 DECL_THREAD(MyThread); -
src/tests/multi-monitor.c
rf2e40a9f rbf4ac09 2 2 #include <kernel> 3 3 #include <monitor> 4 #include <thread >4 #include <threads> 5 5 6 6 static int global12, global23, global13; 7 7 8 static monitor_descm1, m2, m3;8 static __monitor_t m1, m2, m3; 9 9 10 void increment( /*mutex*/ monitor_desc * p1, /*mutex*/ monitor_desc* p2, int * value ) {11 monitor_desc* mons[] = { p1, p2 };10 void increment( /*mutex*/ __monitor_t * p1, /*mutex*/ __monitor_t * p2, int * value ) { 11 __monitor_t * mons[] = { p1, p2 }; 12 12 monitor_guard_t g = { mons, 2 }; 13 13 *value += 1; … … 15 15 16 16 struct MyThread { 17 thread _desct;17 thread t; 18 18 int target; 19 19 }; -
src/tests/test.py
rf2e40a9f rbf4ac09 250 250 parser = argparse.ArgumentParser(description='Script which runs cforall tests') 251 251 parser.add_argument('--debug', help='Run all tests in debug or release', type=yes_no, default='no') 252 parser.add_argument('--concurrent', help='Run concurrent tests', type=yes_no, default=' yes')252 parser.add_argument('--concurrent', help='Run concurrent tests', type=yes_no, default='no') 253 253 parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true') 254 254 parser.add_argument('--list', help='List all test available', action='store_true') -
src/tests/thread.c
rf2e40a9f rbf4ac09 2 2 #include <kernel> 3 3 #include <stdlib> 4 #include <thread >4 #include <threads> 5 5 6 struct First { thread _desct; signal_once* lock; };7 struct Second { thread _desct; signal_once* lock; };6 struct First { thread t; signal_once* lock; }; 7 struct Second { thread t; signal_once* lock; }; 8 8 9 9 DECL_THREAD(First);
Note:
See TracChangeset
for help on using the changeset viewer.