Changes in / [5c4a473:d65f92c]
- Files:
-
- 21 edited
-
Jenkins/FullBuild (modified) (1 diff)
-
Jenkinsfile (modified) (3 diffs)
-
libcfa/src/Makefile.am (modified) (1 diff)
-
libcfa/src/Makefile.in (modified) (2 diffs)
-
src/ResolvExpr/AlternativeFinder.cc (modified) (7 diffs)
-
src/ResolvExpr/CastCost.cc (modified) (7 diffs)
-
src/ResolvExpr/ConversionCost.cc (modified) (13 diffs)
-
src/ResolvExpr/ConversionCost.h (modified) (4 diffs)
-
src/ResolvExpr/ResolveAssertions.cc (modified) (2 diffs)
-
src/ResolvExpr/typeops.h (modified) (4 diffs)
-
src/SynTree/ApplicationExpr.cc (modified) (2 diffs)
-
src/SynTree/CommaExpr.cc (modified) (2 diffs)
-
src/SynTree/Expression.cc (modified) (9 diffs)
-
src/SynTree/Expression.h (modified) (13 diffs)
-
src/SynTree/TupleExpr.cc (modified) (3 diffs)
-
src/main.cc (modified) (9 diffs)
-
tests/Makefile.am (modified) (2 diffs)
-
tests/Makefile.in (modified) (2 diffs)
-
tests/pybin/settings.py (modified) (3 diffs)
-
tests/pybin/tools.py (modified) (3 diffs)
-
tests/test.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Jenkins/FullBuild
r5c4a473 rd65f92c 132 132 133 133 <img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=0" > 134 <img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=1" >135 134 136 135 <p>- Logs ----------------------------------------------------------------</p> -
Jenkinsfile
r5c4a473 rd65f92c 197 197 if( Settings.Publish && !Settings.RunBenchmark ) { echo 'No results to publish!!!' } 198 198 199 def groupCompile = new PlotGroup('Compilation', ' duration (s) - lower is better', true)200 def groupConcurrency = new PlotGroup('Concurrency', ' duration (n) - lower is better', false)199 def groupCompile = new PlotGroup('Compilation', 'seconds', true) 200 def groupConcurrency = new PlotGroup('Concurrency', 'nanoseconds', false) 201 201 202 202 //Then publish the results 203 do_plot(Settings.RunBenchmark && Settings.Publish, 'compile' , groupCompile , false,'Compilation')204 do_plot(Settings.RunBenchmark && Settings.Publish, 'compile.diff' , groupCompile , true , 'Compilation (relative)')205 do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch' , groupConcurrency, false,'Context Switching')206 do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch.diff', groupConcurrency, true , 'Context Switching (relative)')207 do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex' , groupConcurrency, false,'Mutual Exclusion')208 do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex.diff' , groupConcurrency, true , 'Mutual Exclusion (relative)')209 do_plot(Settings.RunBenchmark && Settings.Publish, 'signal' , groupConcurrency, false,'Internal and External Scheduling')210 do_plot(Settings.RunBenchmark && Settings.Publish, 'signal.diff' , groupConcurrency, true , 'Internal and External Scheduling (relative)')203 do_plot(Settings.RunBenchmark && Settings.Publish, 'compile' , groupCompile , 'Compilation') 204 do_plot(Settings.RunBenchmark && Settings.Publish, 'compile.diff' , groupCompile , 'Compilation Speed-Up') 205 do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch' , groupConcurrency, 'Context Switching') 206 do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch.diff', groupConcurrency, 'Context Switching Speed-Up') 207 do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex' , groupConcurrency, 'Mutual Exclusion') 208 do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex.diff' , groupConcurrency, 'Mutual Exclusion Speed-Up') 209 do_plot(Settings.RunBenchmark && Settings.Publish, 'signal' , groupConcurrency, 'Internal and External Scheduling') 210 do_plot(Settings.RunBenchmark && Settings.Publish, 'signal.diff' , groupConcurrency, 'Internal and External Scheduling Speed-Up') 211 211 } 212 212 } … … 466 466 } 467 467 468 def do_plot(boolean new_data, String file, PlotGroup group, boolean relative,String title) {468 def do_plot(boolean new_data, String file, PlotGroup group, String title) { 469 469 470 470 if(new_data) { … … 489 489 exclZero: false, 490 490 keepRecords: false, 491 logarithmic: !relative &&group.log,491 logarithmic: group.log, 492 492 numBuilds: '120', 493 493 useDescr: true, -
libcfa/src/Makefile.am
r5c4a473 rd65f92c 26 26 VPATH += :../prelude 27 27 28 gdbwaittarget=""29 30 28 # AM_CFLAGS for all cfa source 31 29 # AM_CFAFLAGS for only cfa source 32 30 # use -no-include-stdhdr to prevent rebuild cycles 33 31 # The built sources must not depend on the installed headers 34 AM_CFAFLAGS = -quiet -cfalib @PRELUDEFLAG@ -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb)@CONFIG_CFAFLAGS@32 AM_CFAFLAGS = -quiet -cfalib @PRELUDEFLAG@ -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@ 35 33 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@ 36 34 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@ -
libcfa/src/Makefile.in
r5c4a473 rd65f92c 438 438 am__v_UPP_1 = 439 439 lib_LTLIBRARIES = libcfa.la libcfathread.la 440 gdbwaittarget = ""441 440 442 441 # AM_CFLAGS for all cfa source … … 444 443 # use -no-include-stdhdr to prevent rebuild cycles 445 444 # The built sources must not depend on the installed headers 446 AM_CFAFLAGS = -quiet -cfalib @PRELUDEFLAG@ -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb)@CONFIG_CFAFLAGS@445 AM_CFAFLAGS = -quiet -cfalib @PRELUDEFLAG@ -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@ 447 446 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@ 448 447 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@ -
src/ResolvExpr/AlternativeFinder.cc
r5c4a473 rd65f92c 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sat May 16 23:52:08 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thu Aug 8 16:35:00201913 // Update Count : 3 811 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 25 22:37:46 2019 13 // Update Count : 37 14 14 // 15 15 … … 377 377 } 378 378 379 Cost computeConversionCost( Type * actualType, Type * formalType, bool actualIsLvalue, 380 const SymTab::Indexer &indexer, const TypeEnvironment & env ) { 379 Cost computeConversionCost( Type * actualType, Type * formalType, const SymTab::Indexer &indexer, const TypeEnvironment & env ) { 381 380 PRINT( 382 381 std::cerr << std::endl << "converting "; … … 388 387 std::cerr << std::endl; 389 388 ) 390 Cost convCost = conversionCost( actualType, formalType, actualIsLvalue,indexer, env );389 Cost convCost = conversionCost( actualType, formalType, indexer, env ); 391 390 PRINT( 392 391 std::cerr << std::endl << "cost is " << convCost << std::endl; … … 403 402 404 403 Cost computeExpressionConversionCost( Expression *& actualExpr, Type * formalType, const SymTab::Indexer &indexer, const TypeEnvironment & env ) { 405 Cost convCost = computeConversionCost( 406 actualExpr->result, formalType, actualExpr->get_lvalue(), indexer, env ); 404 Cost convCost = computeConversionCost( actualExpr->result, formalType, indexer, env ); 407 405 408 406 // if there is a non-zero conversion cost, ignoring poly cost, then the expression requires conversion. … … 1188 1186 assert( toType ); 1189 1187 toType = resolveTypeof( toType, indexer ); 1190 assert(!dynamic_cast<TypeofType *>(toType));1191 1188 SymTab::validateType( toType, &indexer ); 1192 1189 adjustExprType( toType, env, indexer ); … … 1215 1212 unify( castExpr->result, alt.expr->result, alt.env, needAssertions, 1216 1213 haveAssertions, openVars, indexer ); 1217 Cost thisCost = castCost( alt.expr->result, castExpr->result, alt.expr->get_lvalue(),1218 indexer,alt.env );1214 Cost thisCost = castCost( alt.expr->result, castExpr->result, indexer, 1215 alt.env ); 1219 1216 PRINT( 1220 1217 std::cerr << "working on cast with result: " << castExpr->result << std::endl; … … 1643 1640 // xxx - do some inspecting on this line... why isn't result bound to initAlt.type? 1644 1641 1645 Cost thisCost = castCost( alt.expr->result, toType, alt.expr->get_lvalue(), 1646 indexer, newEnv ); 1642 Cost thisCost = castCost( alt.expr->result, toType, indexer, newEnv ); 1647 1643 if ( thisCost != Cost::infinity ) { 1648 1644 // count one safe conversion for each value that is thrown away -
src/ResolvExpr/CastCost.cc
r5c4a473 rd65f92c 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 06:57:43 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : T hu Aug 8 16:12:00 201913 // Update Count : 811 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 2 15:34:36 2016 13 // Update Count : 7 14 14 // 15 15 … … 37 37 struct CastCost_old : public ConversionCost { 38 38 public: 39 CastCost_old( const Type * dest, bool srcIsLvalue, 40 const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc ); 39 CastCost_old( const Type * dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc ); 41 40 42 41 using ConversionCost::previsit; … … 46 45 }; 47 46 48 Cost castCost( const Type * src, const Type * dest, bool srcIsLvalue, 49 const SymTab::Indexer &indexer, const TypeEnvironment &env ) { 47 Cost castCost( const Type * src, const Type * dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) { 50 48 if ( const TypeInstType * destAsTypeInst = dynamic_cast< const TypeInstType * >( dest ) ) { 51 49 if ( const EqvClass * eqvClass = env.lookup( destAsTypeInst->name ) ) { 52 50 if ( eqvClass->type ) { 53 return castCost( src, eqvClass->type, srcIsLvalue,indexer, env );51 return castCost( src, eqvClass->type, indexer, env ); 54 52 } else { 55 53 return Cost::infinity; … … 59 57 const TypeDecl * type = strict_dynamic_cast< const TypeDecl * >( namedType ); 60 58 if ( type->base ) { 61 return castCost( src, type->base, srcIsLvalue,indexer, env ) + Cost::safe;59 return castCost( src, type->base, indexer, env ) + Cost::safe; 62 60 } // if 63 61 } // if … … 80 78 } else if ( const ReferenceType * refType = dynamic_cast< const ReferenceType * > ( dest ) ) { 81 79 PRINT( std::cerr << "conversionCost: dest is reference" << std::endl; ) 82 return convertToReferenceCost( src, refType, srcIsLvalue,indexer, env, [](const Type * t1, const Type * t2, const SymTab::Indexer & indexer, const TypeEnvironment & env ) {80 return convertToReferenceCost( src, refType, indexer, env, [](const Type * t1, const Type * t2, const SymTab::Indexer & indexer, const TypeEnvironment & env ) { 83 81 return ptrsCastable( t1, t2, env, indexer ); 84 82 }); 85 83 } else { 86 84 PassVisitor<CastCost_old> converter( 87 dest, srcIsLvalue,indexer, env,88 (Cost (*)( const Type *, const Type *, bool,const SymTab::Indexer &, const TypeEnvironment & ))85 dest, indexer, env, 86 (Cost (*)( const Type *, const Type *, const SymTab::Indexer &, const TypeEnvironment & )) 89 87 castCost ); 90 88 src->accept( converter ); … … 98 96 } 99 97 100 CastCost_old::CastCost_old( const Type * dest, bool srcIsLvalue, 101 const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc ) 102 : ConversionCost( dest, srcIsLvalue, indexer, env, costFunc ) { 98 CastCost_old::CastCost_old( const Type * dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc ) 99 : ConversionCost( dest, indexer, env, costFunc ) { 103 100 } 104 101 … … 109 106 cost = Cost::unsafe; 110 107 } else { 111 cost = conversionCost( basicType, dest, srcIsLvalue,indexer, env );108 cost = conversionCost( basicType, dest, indexer, env ); 112 109 } // if 113 110 } -
src/ResolvExpr/ConversionCost.cc
r5c4a473 rd65f92c 10 10 // Created On : Sun May 17 07:06:19 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Aug 12 10:21:00 201913 // Update Count : 2 712 // Last Modified On : Mon Jun 24 13:33:00 2019 13 // Update Count : 26 14 14 // 15 15 … … 46 46 #endif 47 47 48 Cost conversionCost( const Type * src, const Type * dest, bool srcIsLvalue, 49 const SymTab::Indexer &indexer, const TypeEnvironment &env ) { 48 Cost conversionCost( const Type * src, const Type * dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) { 50 49 if ( const TypeInstType * destAsTypeInst = dynamic_cast< const TypeInstType * >( dest ) ) { 51 50 PRINT( std::cerr << "type inst " << destAsTypeInst->name; ) 52 51 if ( const EqvClass * eqvClass = env.lookup( destAsTypeInst->name ) ) { 53 52 if ( eqvClass->type ) { 54 return conversionCost( src, eqvClass->type, srcIsLvalue,indexer, env );53 return conversionCost( src, eqvClass->type, indexer, env ); 55 54 } else { 56 55 return Cost::infinity; … … 62 61 assert( type ); 63 62 if ( type->base ) { 64 return conversionCost( src, type->base, srcIsLvalue, indexer, env ) 65 + Cost::safe; 63 return conversionCost( src, type->base, indexer, env ) + Cost::safe; 66 64 } // if 67 65 } // if … … 83 81 } else if ( const ReferenceType * refType = dynamic_cast< const ReferenceType * > ( dest ) ) { 84 82 PRINT( std::cerr << "conversionCost: dest is reference" << std::endl; ) 85 return convertToReferenceCost( src, refType, srcIsLvalue,indexer, env, [](const Type * const t1, const Type * t2, const SymTab::Indexer &, const TypeEnvironment & env ){83 return convertToReferenceCost( src, refType, indexer, env, [](const Type * const t1, const Type * t2, const SymTab::Indexer &, const TypeEnvironment & env ){ 86 84 return ptrsAssignable( t1, t2, env ); 87 85 }); 88 86 } else { 89 87 PassVisitor<ConversionCost> converter( 90 dest, srcIsLvalue,indexer, env,91 (Cost (*)(const Type *, const Type *, bool,const SymTab::Indexer&, const TypeEnvironment&))88 dest, indexer, env, 89 (Cost (*)(const Type *, const Type *, const SymTab::Indexer&, const TypeEnvironment&)) 92 90 conversionCost ); 93 91 src->accept( converter ); … … 100 98 } 101 99 102 static Cost convertToReferenceCost( const Type * src, const Type * dest, bool srcIsLvalue, 103 int diff, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) { 100 static Cost convertToReferenceCost( const Type * src, const Type * dest, int diff, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) { 104 101 PRINT( std::cerr << "convert to reference cost... diff " << diff << " " << src << " / " << dest << std::endl; ) 105 102 if ( diff > 0 ) { 106 103 // TODO: document this 107 Cost cost = convertToReferenceCost( 108 strict_dynamic_cast< const ReferenceType * >( src )->base, dest, srcIsLvalue, 109 diff-1, indexer, env, func ); 104 Cost cost = convertToReferenceCost( strict_dynamic_cast< const ReferenceType * >( src )->base, dest, diff-1, indexer, env, func ); 110 105 cost.incReference(); 111 106 return cost; 112 107 } else if ( diff < -1 ) { 113 108 // TODO: document this 114 Cost cost = convertToReferenceCost( 115 src, strict_dynamic_cast< const ReferenceType * >( dest )->base, srcIsLvalue, 116 diff+1, indexer, env, func ); 109 Cost cost = convertToReferenceCost( src, strict_dynamic_cast< const ReferenceType * >( dest )->base, diff+1, indexer, env, func ); 117 110 cost.incReference(); 118 111 return cost; … … 145 138 PRINT( std::cerr << "reference to rvalue conversion" << std::endl; ) 146 139 PassVisitor<ConversionCost> converter( 147 dest, srcIsLvalue,indexer, env,148 (Cost (*)(const Type *, const Type *, bool,const SymTab::Indexer&, const TypeEnvironment&))140 dest, indexer, env, 141 (Cost (*)(const Type *, const Type *, const SymTab::Indexer&, const TypeEnvironment&)) 149 142 conversionCost ); 150 143 src->accept( converter ); … … 157 150 if ( typesCompatibleIgnoreQualifiers( src, destAsRef->base, indexer, env ) ) { 158 151 PRINT( std::cerr << "converting compatible base type" << std::endl; ) 159 assert( src->get_lvalue() == srcIsLvalue ); 160 if ( srcIsLvalue ) { 152 if ( src->get_lvalue() ) { 161 153 PRINT( 162 154 std::cerr << "lvalue to reference conversion" << std::endl; … … 186 178 } 187 179 188 Cost convertToReferenceCost( const Type * src, const ReferenceType * dest, bool srcIsLvalue, 189 const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) { 180 Cost convertToReferenceCost( const Type * src, const ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) { 190 181 int sdepth = src->referenceDepth(), ddepth = dest->referenceDepth(); 191 Cost cost = convertToReferenceCost( src, dest, s rcIsLvalue, sdepth-ddepth, indexer, env, func );182 Cost cost = convertToReferenceCost( src, dest, sdepth-ddepth, indexer, env, func ); 192 183 PRINT( std::cerr << "convertToReferenceCost result: " << cost << std::endl; ) 193 184 return cost; 194 185 } 195 186 196 ConversionCost::ConversionCost( const Type * dest, bool srcIsLvalue,const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc )197 : dest( dest ), srcIsLvalue( srcIsLvalue ),indexer( indexer ), cost( Cost::infinity ), env( env ), costFunc( costFunc ) {187 ConversionCost::ConversionCost( const Type * dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc ) 188 : dest( dest ), indexer( indexer ), cost( Cost::infinity ), env( env ), costFunc( costFunc ) { 198 189 } 199 190 … … 380 371 // recursively compute conversion cost from T1 to T2. 381 372 // cv can be safely dropped because of 'implicit dereference' behavior. 382 cost = costFunc( refType->base, dest, srcIsLvalue,indexer, env );373 cost = costFunc( refType->base, dest, indexer, env ); 383 374 if ( refType->base->tq == dest->tq ) { 384 375 cost.incReference(); // prefer exact qualifiers … … 412 403 static Type::Qualifiers q; 413 404 static BasicType integer( q, BasicType::SignedInt ); 414 cost = costFunc( &integer, dest, srcIsLvalue,indexer, env ); // safe if dest >= int405 cost = costFunc( &integer, dest, indexer, env ); // safe if dest >= int 415 406 if ( cost < Cost::unsafe ) { 416 407 cost.incSafe(); … … 422 413 void ConversionCost::postvisit( const TypeInstType * inst ) { 423 414 if ( const EqvClass * eqvClass = env.lookup( inst->name ) ) { 424 cost = costFunc( eqvClass->type, dest, srcIsLvalue,indexer, env );415 cost = costFunc( eqvClass->type, dest, indexer, env ); 425 416 } else if ( const TypeInstType * destAsInst = dynamic_cast< const TypeInstType * >( dest ) ) { 426 417 if ( inst->name == destAsInst->name ) { … … 432 423 assert( type ); 433 424 if ( type->base ) { 434 cost = costFunc( type->base, dest, srcIsLvalue,indexer, env ) + Cost::safe;425 cost = costFunc( type->base, dest, indexer, env ) + Cost::safe; 435 426 } // if 436 427 } // if … … 443 434 std::list< Type * >::const_iterator destIt = destAsTuple->types.begin(); 444 435 while ( srcIt != tupleType->types.end() && destIt != destAsTuple->types.end() ) { 445 Cost newCost = costFunc( * srcIt++, * destIt++, srcIsLvalue,indexer, env );436 Cost newCost = costFunc( * srcIt++, * destIt++, indexer, env ); 446 437 if ( newCost == Cost::infinity ) { 447 438 return; -
src/ResolvExpr/ConversionCost.h
r5c4a473 rd65f92c 10 10 // Created On : Sun May 17 09:37:28 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thu Aug 8 16:13:00 201913 // Update Count : 612 // Last Modified On : Mon Jun 24 10:00:00 2019 13 // Update Count : 5 14 14 // 15 15 … … 33 33 class TypeEnvironment; 34 34 35 typedef std::function<Cost(const Type *, const Type *, bool, 36 const SymTab::Indexer &, const TypeEnvironment &)> CostFunction; 37 35 typedef std::function<Cost(const Type *, const Type *, const SymTab::Indexer &, const TypeEnvironment &)> CostFunction; 38 36 struct ConversionCost : public WithShortCircuiting { 39 37 public: 40 ConversionCost( const Type * dest, bool srcIsLvalue, 41 const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction ); 38 ConversionCost( const Type * dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction ); 42 39 43 40 Cost get_cost() const { return cost; } … … 62 59 protected: 63 60 const Type * dest; 64 bool srcIsLvalue;65 61 const SymTab::Indexer &indexer; 66 62 Cost cost; … … 70 66 71 67 typedef std::function<int(const Type *, const Type *, const SymTab::Indexer &, const TypeEnvironment &)> PtrsFunction; 72 Cost convertToReferenceCost( const Type * src, const ReferenceType * dest, bool srcIsLvalue, 73 const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ); 68 Cost convertToReferenceCost( const Type * src, const ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ); 74 69 75 70 // Some function pointer types, differ in return type. -
src/ResolvExpr/ResolveAssertions.cc
r5c4a473 rd65f92c 9 9 // Author : Aaron B. Moss 10 10 // Created On : Fri Oct 05 13:46:00 2018 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thu Aug 8 16:47:00201913 // Update Count : 311 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jul 10 16:10:37 2019 13 // Update Count : 2 14 14 // 15 15 … … 156 156 for ( const auto& assn : x.assns ) { 157 157 // compute conversion cost from satisfying decl to assertion 158 assert( !assn.match.adjType->get_lvalue() );159 158 k += computeConversionCost( 160 assn.match.adjType, assn.decl->get_type(), false,indexer, x.env );159 assn.match.adjType, assn.decl->get_type(), indexer, x.env ); 161 160 162 161 // mark vars+specialization cost on function-type assertions -
src/ResolvExpr/typeops.h
r5c4a473 rd65f92c 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 07:28:22 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thu Aug 8 16:36:00201913 // Update Count : 511 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Feb 8 09:30:34 2019 13 // Update Count : 4 14 14 // 15 15 … … 80 80 81 81 // in CastCost.cc 82 Cost castCost( const Type * src, const Type * dest, bool srcIsLvalue, 83 const SymTab::Indexer & indexer, const TypeEnvironment & env ); 82 Cost castCost( const Type * src, const Type * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env ); 84 83 Cost castCost( 85 84 const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, … … 87 86 88 87 // in ConversionCost.cc 89 Cost conversionCost( const Type * src, const Type * dest, bool srcIsLvalue, 90 const SymTab::Indexer & indexer, const TypeEnvironment & env ); 88 Cost conversionCost( const Type * src, const Type * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env ); 91 89 Cost conversionCost( 92 90 const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, … … 94 92 95 93 // in AlternativeFinder.cc 96 Cost computeConversionCost( Type * actualType, Type * formalType, bool actualIsLvalue,94 Cost computeConversionCost( Type * actualType, Type * formalType, 97 95 const SymTab::Indexer & indexer, const TypeEnvironment & env ); 98 96 -
src/SynTree/ApplicationExpr.cc
r5c4a473 rd65f92c 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Mon Aug 12 14:28:00 201913 // Update Count : 511 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Apr 26 12:41:06 2016 13 // Update Count : 4 14 14 // 15 15 … … 76 76 } 77 77 78 bool ApplicationExpr::get_lvalue() const {79 return result->get_lvalue();80 }81 82 78 void ApplicationExpr::print( std::ostream &os, Indenter indent ) const { 83 79 os << "Application of" << std::endl << indent+1; -
src/SynTree/CommaExpr.cc
r5c4a473 rd65f92c 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Mon Arg 12 16:11:00201613 // Update Count : 211 // Last Modified By : Rob Schluntz 12 // Last Modified On : Mon May 02 15:19:44 2016 13 // Update Count : 1 14 14 // 15 15 … … 39 39 } 40 40 41 bool CommaExpr::get_lvalue() const {42 // xxx - as above, shouldn't be an lvalue but that information is used anyways.43 return result->get_lvalue();44 }45 46 41 void CommaExpr::print( std::ostream &os, Indenter indent ) const { 47 42 os << "Comma Expression:" << std::endl; -
src/SynTree/Expression.cc
r5c4a473 rd65f92c 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Aug 13 11:31:00 201913 // Update Count : 6 312 // Last Modified On : Wed Aug 7 17:03:00 2019 13 // Update Count : 62 14 14 // 15 15 … … 64 64 65 65 bool Expression::get_lvalue() const { 66 assert( !result->get_lvalue() ); 67 return false; 66 return result->get_lvalue(); 68 67 } 69 68 … … 139 138 } 140 139 141 bool VariableExpr::get_lvalue() const {142 return result->get_lvalue();143 }144 145 140 VariableExpr * VariableExpr::functionPointer( FunctionDecl * func ) { 146 141 VariableExpr * funcExpr = new VariableExpr( func ); … … 274 269 CastExpr::~CastExpr() { 275 270 delete arg; 276 }277 278 bool CastExpr::get_lvalue() const {279 return result->get_lvalue();280 271 } 281 272 … … 389 380 // don't delete the member declaration, since it points somewhere else in the tree 390 381 delete aggregate; 391 }392 393 bool MemberExpr::get_lvalue() const {394 assert( result->get_lvalue() );395 return true;396 382 } 397 383 … … 446 432 } 447 433 448 bool UntypedExpr::get_lvalue() const {449 return result->get_lvalue();450 }451 434 452 435 void UntypedExpr::print( std::ostream & os, Indenter indent ) const { … … 507 490 delete arg2; 508 491 delete arg3; 509 }510 511 bool ConditionalExpr::get_lvalue() const {512 return result->get_lvalue();513 492 } 514 493 … … 569 548 } 570 549 571 bool ConstructorExpr::get_lvalue() const {572 return result->get_lvalue();573 }574 575 550 void ConstructorExpr::print( std::ostream & os, Indenter indent ) const { 576 551 os << "Constructor Expression: " << std::endl << indent+1; … … 590 565 CompoundLiteralExpr::~CompoundLiteralExpr() { 591 566 delete initializer; 592 }593 594 bool CompoundLiteralExpr::get_lvalue() const {595 assert( result->get_lvalue() );596 return true;597 567 } 598 568 -
src/SynTree/Expression.h
r5c4a473 rd65f92c 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Aug 14 14:24:00 201913 // Update Count : 5 312 // Last Modified On : Wed Aug 7 16:56:00 2019 13 // Update Count : 51 14 14 // 15 15 … … 71 71 const Type * get_result() const { return result; } 72 72 void set_result( Type * newValue ) { result = newValue; } 73 virtualbool get_lvalue() const;73 bool get_lvalue() const; 74 74 75 75 TypeSubstitution * get_env() const { return env; } … … 99 99 virtual ~ApplicationExpr(); 100 100 101 bool get_lvalue() const final;102 103 101 Expression * get_function() const { return function; } 104 102 void set_function( Expression * newValue ) { function = newValue; } … … 123 121 UntypedExpr( const UntypedExpr & other ); 124 122 virtual ~UntypedExpr(); 125 126 bool get_lvalue() const final;127 123 128 124 Expression * get_function() const { return function; } … … 213 209 virtual ~CastExpr(); 214 210 215 bool get_lvalue() const final;216 217 211 Expression * get_arg() const { return arg; } 218 212 void set_arg( Expression * newValue ) { arg = newValue; } … … 298 292 virtual ~MemberExpr(); 299 293 300 bool get_lvalue() const final;301 302 294 DeclarationWithType * get_member() const { return member; } 303 295 void set_member( DeclarationWithType * newValue ) { member = newValue; } … … 322 314 VariableExpr( const VariableExpr & other ); 323 315 virtual ~VariableExpr(); 324 325 bool get_lvalue() const final;326 316 327 317 DeclarationWithType * get_var() const { return var; } … … 511 501 virtual ~ConditionalExpr(); 512 502 513 bool get_lvalue() const final;514 515 503 Expression * get_arg1() const { return arg1; } 516 504 void set_arg1( Expression * newValue ) { arg1 = newValue; } … … 537 525 virtual ~CommaExpr(); 538 526 539 bool get_lvalue() const final;540 541 527 Expression * get_arg1() const { return arg1; } 542 528 void set_arg1( Expression * newValue ) { arg1 = newValue; } … … 625 611 ~ConstructorExpr(); 626 612 627 bool get_lvalue() const final;628 629 613 Expression * get_callExpr() const { return callExpr; } 630 614 void set_callExpr( Expression * newValue ) { callExpr = newValue; } … … 645 629 CompoundLiteralExpr( const CompoundLiteralExpr & other ); 646 630 virtual ~CompoundLiteralExpr(); 647 648 bool get_lvalue() const final;649 631 650 632 Initializer * get_initializer() const { return initializer; } … … 705 687 virtual ~TupleExpr(); 706 688 707 bool get_lvalue() const final;708 709 689 std::list<Expression*>& get_exprs() { return exprs; } 710 690 … … 725 705 TupleIndexExpr( const TupleIndexExpr & other ); 726 706 virtual ~TupleIndexExpr(); 727 728 bool get_lvalue() const final;729 707 730 708 Expression * get_tuple() const { return tuple; } -
src/SynTree/TupleExpr.cc
r5c4a473 rd65f92c 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Wed Aug 14 14:34:00 201913 // Update Count : 511 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 17 09:42:29 2017 13 // Update Count : 3 14 14 // 15 15 … … 57 57 } 58 58 59 bool TupleExpr::get_lvalue() const {60 return result->get_lvalue();61 }62 63 59 void TupleExpr::print( std::ostream &os, Indenter indent ) const { 64 60 os << "Tuple:" << std::endl; … … 80 76 TupleIndexExpr::~TupleIndexExpr() { 81 77 delete tuple; 82 }83 84 bool TupleIndexExpr::get_lvalue() const {85 assert( result->get_lvalue() );86 return true;87 78 } 88 79 -
src/main.cc
r5c4a473 rd65f92c 17 17 #include <execinfo.h> // for backtrace, backtrace_symbols 18 18 #include <getopt.h> // for no_argument, optind, geto... 19 #include <signal.h> // for signal, SIGABRT, SIGSEGV 19 20 #include <cassert> // for assertf 20 21 #include <cstdio> // for fopen, FILE, fclose, stdin 21 22 #include <cstdlib> // for exit, free, abort, EXIT_F... 22 #include <csignal> // for signal, SIGABRT, SIGSEGV23 23 #include <cstring> // for index 24 24 #include <fstream> // for ofstream … … 96 96 DeclarationNode * parseTree = nullptr; // program parse tree 97 97 98 static bool waiting_for_gdb = false; // flag to set cfa-cpp to wait for gdb on start99 100 98 static std::string PreludeDirector = ""; 101 99 … … 169 167 } // sigAbortHandler 170 168 169 171 170 int main( int argc, char * argv[] ) { 172 171 FILE * input; // use FILE rather than istream because yyin is FILE … … 186 185 parse_cmdline( argc, argv, filename ); // process command-line arguments 187 186 CodeGen::FixMain::setReplaceMain( !nomainp ); 188 189 if(waiting_for_gdb) {190 std::cerr << "Waiting for gdb" << std::endl;191 std::cerr << "run :" << std::endl;192 std::cerr << " gdb attach " << getpid() << std::endl;193 raise(SIGSTOP);194 }195 187 196 188 try { … … 206 198 } else { // no input file name 207 199 input = stdin; 208 std::cerr << "Input from stdin" << std::endl;209 200 // if running cfa-cpp directly, might forget to pass -F option. Since this takes from stdin, pass 210 201 // a fake name along … … 447 438 448 439 449 static const char optstring[] = ":hlLmNnpP:S:t gwW:D:F:";440 static const char optstring[] = ":hlLmNnpP:S:twW:D:F:"; 450 441 451 442 enum { PreludeDir = 128 }; … … 462 453 { "statistics", required_argument, nullptr, 'S' }, 463 454 { "tree", no_argument, nullptr, 't' }, 464 { "gdb", no_argument, nullptr, 'g' },465 455 { "", no_argument, nullptr, 0 }, // -w 466 456 { "", no_argument, nullptr, 0 }, // -W … … 481 471 "<directory> prelude directory for debug/nodebug", // no flag 482 472 "<option-list> enable profiling information:\n counters,heap,time,all,none", // -S 483 "building cfa standard lib", // -t 484 "wait for gdb to attach", // -g 473 "build in tree", // -t 485 474 "", // -w 486 475 "", // -W … … 593 582 Stats::parse_params( optarg ); 594 583 break; 595 case 't': // build ing cfa stdlib584 case 't': // build in tree 596 585 treep = true; 597 break;598 case 'g': // wait for gdb599 waiting_for_gdb = true;600 586 break; 601 587 case 'w': // suppress all warnings, hidden -
tests/Makefile.am
r5c4a473 rd65f92c 22 22 debug=yes 23 23 installed=no 24 archiveerrors=25 24 26 25 INSTALL_FLAGS=-in-tree … … 59 58 #---------------------------------------------------------------------------------------------------------------- 60 59 all-local : 61 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors}${concurrent} ${timeouts} ${quick_test}60 @+${TEST_PY} --debug=${debug} --install=${installed} ${concurrent} ${timeouts} ${quick_test} 62 61 63 62 all-tests : 64 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors}${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program63 @+${TEST_PY} --debug=${debug} --install=${installed} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program 65 64 66 65 clean-local : -
tests/Makefile.in
r5c4a473 rd65f92c 378 378 debug = yes 379 379 installed = no 380 archiveerrors =381 380 INSTALL_FLAGS = -in-tree 382 381 DEBUG_FLAGS = -debug -O0 … … 778 777 #---------------------------------------------------------------------------------------------------------------- 779 778 all-local : 780 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors}${concurrent} ${timeouts} ${quick_test}779 @+${TEST_PY} --debug=${debug} --install=${installed} ${concurrent} ${timeouts} ${quick_test} 781 780 782 781 all-tests : 783 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors}${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program782 @+${TEST_PY} --debug=${debug} --install=${installed} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program 784 783 785 784 clean-local : -
tests/pybin/settings.py
r5c4a473 rd65f92c 4 4 from . import tools 5 5 6 global original_path7 8 6 try : 9 original_path = os.getcwd()10 7 testpath = os.path.dirname(os.path.abspath(os.path.join(os.getcwd(), sys.argv[0]))) 11 8 sys.path.append(testpath) … … 121 118 global timeout 122 119 global output_width 123 <<<<<<< HEAD124 120 global distcc 125 =======126 global archive127 >>>>>>> master128 121 129 122 dry_run = options.dry_run … … 135 128 timeout = Timeouts(options.timeout, options.global_timeout) 136 129 output_width = 24 137 <<<<<<< HEAD138 130 distcc = "DISTCC_CFA_PATH=~/.cfadistcc/%s/cfa" % tools.config_hash() 139 =======140 archive = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None141 >>>>>>> master142 131 143 132 if distribute and not os.environ.get('DISTCC_LOG'): -
tests/pybin/tools.py
r5c4a473 rd65f92c 2 2 import argparse 3 3 import contextlib 4 import datetime5 4 import fileinput 6 5 import multiprocessing … … 290 289 return out.strip() 291 290 292 # get pretty string for time of day293 def pretty_now():294 ts = time.time()295 print(ts, file=sys.stderr)296 return datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d_%H:%M:%S')297 298 291 # check if arguments is yes or no 299 292 def yes_no(string): … … 327 320 return sh('gdb', '-n', path, core, '-batch', '-x', cmd, output_file=subprocess.PIPE) 328 321 329 def core_archive(dst, name, exe):330 # Get the files to copy331 core = os.path.join(os.getcwd(), "core" )332 333 # Uncomment if we want timestamps on coredumps334 # dst = os.path.join(dst, "%s_%s" % (name, pretty_now()))335 336 # make a directory for this test337 mkdir(os.path.join(dst, "dir"))338 339 # moves the files340 mv( core, os.path.join(dst, "core" ) )341 mv( exe , os.path.join(dst, name ) )342 343 # return explanatory test344 return "Archiving %s (executable and core) to %s" % (os.path.relpath(exe, settings.BUILDDIR), os.path.relpath(dst, settings.original_path))345 346 322 class Timed: 347 323 def __enter__(self): -
tests/test.py
r5c4a473 rd65f92c 91 91 parser.add_argument('--all', help='Run all test available', action='store_true') 92 92 parser.add_argument('--regenerate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true') 93 parser.add_argument('--archive-errors', help='If called with a valid path, on test crashes the test script will copy the core dump and the executable to the specified path.', type=str, default='')94 93 parser.add_argument('-j', '--jobs', help='Number of tests to run simultaneously', type=int) 95 94 parser.add_argument('--list-comp', help='List all valide arguments', action='store_true') … … 180 179 error = error + info if error else info 181 180 182 if settings.archive:183 error = error + '\n' + core_archive(settings.archive, test.target(), exe_file)184 185 181 186 182 … … 299 295 # users may want to simply list the tests 300 296 if options.list_comp : 301 print("-h --help --debug --dry-run --list --arch --all --regenerate-expected -- archive-errors --install --timeout --global-timeout -j --jobs ", end='')297 print("-h --help --debug --dry-run --list --arch --all --regenerate-expected --install --timeout --global-timeout -j --jobs ", end='') 302 298 print(" ".join(map(lambda t: "%s" % (t.target()), tests))) 303 299
Note:
See TracChangeset
for help on using the changeset viewer.