Changes in / [4b4f95f:433905a]
- Files:
-
- 2 added
- 10 deleted
- 12 edited
-
benchmark/Cargo.toml.in (modified) (1 diff)
-
benchmark/Makefile.am (modified) (1 diff)
-
benchmark/c.c (added)
-
benchmark/readyQ/churn.cfa (modified) (7 diffs)
-
benchmark/readyQ/churn.rs (deleted)
-
src/AST/Convert.cpp (modified) (1 diff)
-
src/Common/utility.h (modified) (2 diffs)
-
src/SymTab/Validate.cc (modified) (3 diffs)
-
src/SymTab/Validate.h (modified) (1 diff)
-
src/Validate/EliminateTypedef.cpp (deleted)
-
src/Validate/EliminateTypedef.hpp (deleted)
-
src/Validate/FixQualifiedTypes.cpp (deleted)
-
src/Validate/FixQualifiedTypes.hpp (deleted)
-
src/Validate/ForallPointerDecay.cpp (modified) (2 diffs)
-
src/Validate/ForallPointerDecay.hpp (modified) (2 diffs)
-
src/Validate/GenericParameter.cpp (modified) (3 diffs)
-
src/Validate/HoistStruct.cpp (deleted)
-
src/Validate/HoistStruct.hpp (deleted)
-
src/Validate/NoIdSymbolTable.hpp (deleted)
-
src/Validate/module.mk (modified) (2 diffs)
-
src/main.cc (modified) (5 diffs)
-
tests/.expect/nested-types-ERR2.nast.txt (deleted)
-
tests/.expect/nested-types-ERR2.oast.txt (deleted)
-
tests/.expect/nested-types-ERR2.txt (added)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/Cargo.toml.in
r4b4f95f r433905a 4 4 authors = ["Cforall"] 5 5 edition = "2018" 6 7 [[bin]]8 name = "rdq-churn-tokio"9 path = "@abs_srcdir@/readyQ/churn.rs"10 6 11 7 [[bin]] -
benchmark/Makefile.am
r4b4f95f r433905a 614 614 RDQBENCHES = \ 615 615 rdq-churn-cfa \ 616 rdq-churn-tokio \617 rdq-churn-go \618 rdq-churn-fibre \619 616 rdq-cycle-cfa \ 620 617 rdq-cycle-tokio \ -
benchmark/readyQ/churn.cfa
r4b4f95f r433905a 1 1 #include "rq_bench.hfa" 2 2 3 #include <locks.hfa>4 5 3 unsigned spot_cnt = 2; 6 semaphore * spots;4 bench_sem * volatile * spots; 7 5 8 6 thread BThrd { 9 7 unsigned long long count; 10 8 unsigned long long blocks; 11 b ool skip;9 bench_sem sem; 12 10 }; 13 11 … … 16 14 this.count = 0; 17 15 this.blocks = 0; 18 this.skip = false;19 16 } 20 17 … … 22 19 23 20 void main( BThrd & this ) with( this ) { 24 park();21 wait( sem ); 25 22 for() { 26 uint32_t r = prng(this); 27 semaphore & sem = spots[r % spot_cnt]; 28 if(!skip) V( sem ); 29 blocks += P( sem ); 30 skip = false; 31 23 uint32_t r = prng(); 24 bench_sem * next = __atomic_exchange_n(&spots[r % spot_cnt], &sem, __ATOMIC_SEQ_CST); 25 if(next) post( *next ); 26 blocks += wait( sem ); 32 27 count ++; 33 28 if( clock_mode && stop) break; … … 54 49 spots = aalloc(spot_cnt); 55 50 for(i; spot_cnt) { 56 (spots[i]){ 0 };51 spots[i] = 0p; 57 52 } 58 53 … … 60 55 BThrd * threads[nthreads]; 61 56 for(i; nthreads ) { 62 BThrd & t = *(threads[i] = malloc()); 63 (t){}; 64 t.skip = i < spot_cnt; 57 threads[i] = malloc(); 58 (*threads[i]){}; 65 59 } 66 60 printf("Starting\n"); … … 70 64 71 65 for(i; nthreads) { 72 unpark( *threads[i]);66 post( threads[i]->sem ); 73 67 } 74 68 wait(start, is_tty); … … 78 72 printf("\nDone\n"); 79 73 80 for(i; spot_cnt) {81 for(10000) V( spots[i] );82 }83 84 74 for(i; nthreads) { 75 post( threads[i]->sem ); 85 76 BThrd & thrd = join( *threads[i] ); 86 77 global_counter += thrd.count; -
src/AST/Convert.cpp
r4b4f95f r433905a 2729 2729 ty->forall.emplace_back(new ast::TypeInstType(param)); 2730 2730 for (auto asst : param->assertions) { 2731 ty->assertions.emplace_back( 2732 new ast::VariableExpr(param->location, asst)); 2731 ty->assertions.emplace_back(new ast::VariableExpr({}, asst)); 2733 2732 } 2734 2733 } -
src/Common/utility.h
r4b4f95f r433905a 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 Apr 25 14:26:00 202213 // Update Count : 5 111 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 11 13:00:36 2020 13 // Update Count : 50 14 14 // 15 15 … … 230 230 } 231 231 232 template<typename Container, typename Pred>233 void erase_if( Container & cont, Pred && pred ) {234 auto keep_end = std::remove_if( cont.begin(), cont.end(), pred );235 cont.erase( keep_end, cont.end() );236 }237 238 232 template< typename... Args > 239 233 auto zip(Args&&... args) -> decltype(zipWith(std::forward<Args>(args)..., std::make_pair)) { -
src/SymTab/Validate.cc
r4b4f95f r433905a 10 10 // Created On : Sun May 17 21:50:04 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Apr 29 9:45:00 202213 // Update Count : 36 512 // Last Modified On : Fri Nov 12 11:00:00 2021 13 // Update Count : 364 14 14 // 15 15 … … 143 143 struct LinkReferenceToTypes_old final : public WithIndexer, public WithGuards, public WithVisitorRef<LinkReferenceToTypes_old>, public WithShortCircuiting { 144 144 LinkReferenceToTypes_old( const Indexer * indexer ); 145 146 145 void postvisit( TypeInstType * typeInst ); 147 146 … … 371 370 } 372 371 373 void linkReferenceToTypes( std::list< Declaration * > & translationUnit ) {372 void validate_B( std::list< Declaration * > & translationUnit ) { 374 373 PassVisitor<LinkReferenceToTypes_old> lrt( nullptr ); 375 acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions376 }377 378 void validate_B( std::list< Declaration * > & translationUnit ) {379 374 PassVisitor<FixQualifiedTypes> fixQual; 380 375 { 381 376 Stats::Heap::newPass("validate-B"); 382 377 Stats::Time::BlockGuard guard("validate-B"); 383 //linkReferenceToTypes( translationUnit );378 acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions 384 379 mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes_old, because aggregate members are accessed 385 380 HoistStruct::hoistStruct( translationUnit ); -
src/SymTab/Validate.h
r4b4f95f r433905a 42 42 void validate_E( std::list< Declaration * > &translationUnit ); 43 43 void validate_F( std::list< Declaration * > &translationUnit ); 44 void linkReferenceToTypes( std::list< Declaration * > &translationUnit );45 44 46 45 const ast::Type * validateType( -
src/Validate/ForallPointerDecay.cpp
r4b4f95f r433905a 10 10 // Created On : Tue Dec 7 16:15:00 2021 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Sat Apr 23 13:10:00 202213 // Update Count : 112 // Last Modified On : Fri Feb 11 10:59:00 2022 13 // Update Count : 0 14 14 // 15 15 … … 237 237 } 238 238 239 std::vector<ast::ptr<ast::DeclWithType>> expandAssertions(240 std::vector<ast::ptr<ast::DeclWithType>> const & old ) {241 return TraitExpander::expandAssertions( old );242 }243 244 239 } // namespace Validate 245 240 -
src/Validate/ForallPointerDecay.hpp
r4b4f95f r433905a 10 10 // Created On : Tue Dec 7 16:15:00 2021 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Sat Apr 23 13:13:00 202213 // Update Count : 112 // Last Modified On : Tue Dec 8 11:50:00 2021 13 // Update Count : 0 14 14 // 15 15 16 16 #pragma once 17 17 18 #include <vector>19 #include "AST/Node.hpp"20 21 18 namespace ast { 22 class DeclWithType;23 19 class TranslationUnit; 24 20 } … … 31 27 void decayForallPointers( ast::TranslationUnit & transUnit ); 32 28 33 /// Expand all traits in an assertion list.34 std::vector<ast::ptr<ast::DeclWithType>> expandAssertions(35 std::vector<ast::ptr<ast::DeclWithType>> const & );36 37 29 } 38 30 -
src/Validate/GenericParameter.cpp
r4b4f95f r433905a 10 10 // Created On : Fri Mar 21 10:02:00 2022 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Apr 22 16:43:00 202213 // Update Count : 112 // Last Modified On : Wed Apr 13 10:09:00 2022 13 // Update Count : 0 14 14 // 15 15 … … 22 22 #include "AST/TranslationUnit.hpp" 23 23 #include "AST/Type.hpp" 24 #include "Validate/NoIdSymbolTable.hpp"25 24 26 25 namespace Validate { … … 139 138 // -------------------------------------------------------------------------- 140 139 141 struct TranslateDimensionCore : 142 public WithNoIdSymbolTable, public ast::WithGuards { 140 // A SymbolTable that only has the operations used in the Translate Dimension 141 // pass. More importantly, it doesn't have some methods that should no be 142 // called by the Pass template (lookupId and addId). 143 class NoIdSymbolTable { 144 ast::SymbolTable base; 145 public: 146 # define FORWARD_X( func, types_and_names, just_names ) \ 147 inline auto func types_and_names -> decltype( base.func just_names ) { \ 148 return base.func just_names ; \ 149 } 150 # define FORWARD_0( func ) FORWARD_X( func, (), () ) 151 # define FORWARD_1( func, type ) FORWARD_X( func, (type arg), (arg) ) 152 # define FORWARD_2( func, t0, t1 ) FORWARD_X( func, (t0 a0, t1 a1), (a0, a1) ) 153 154 FORWARD_0( enterScope ) 155 FORWARD_0( leaveScope ) 156 FORWARD_1( lookupType, const std::string & ) 157 FORWARD_1( addType , const ast::NamedTypeDecl * ) 158 FORWARD_1( addStruct , const ast::StructDecl * ) 159 FORWARD_1( addEnum , const ast::EnumDecl * ) 160 FORWARD_1( addUnion , const ast::UnionDecl * ) 161 FORWARD_1( addTrait , const ast::TraitDecl * ) 162 FORWARD_2( addWith , const std::vector< ast::ptr<ast::Expr> > &, const ast::Decl * ) 163 }; 164 165 struct TranslateDimensionCore : public ast::WithGuards { 166 NoIdSymbolTable symtab; 143 167 144 168 // SUIT: Struct- or Union- InstType -
src/Validate/module.mk
r4b4f95f r433905a 20 20 Validate/CompoundLiteral.cpp \ 21 21 Validate/CompoundLiteral.hpp \ 22 Validate/EliminateTypedef.cpp \23 Validate/EliminateTypedef.hpp \24 Validate/FixQualifiedTypes.cpp \25 Validate/FixQualifiedTypes.hpp \26 22 Validate/ForallPointerDecay.cpp \ 27 23 Validate/ForallPointerDecay.hpp \ … … 30 26 Validate/HandleAttributes.cc \ 31 27 Validate/HandleAttributes.h \ 32 Validate/HoistStruct.cpp \33 Validate/HoistStruct.hpp \34 28 Validate/InitializerLength.cpp \ 35 29 Validate/InitializerLength.hpp \ 36 30 Validate/LabelAddressFixer.cpp \ 37 31 Validate/LabelAddressFixer.hpp \ 38 Validate/NoIdSymbolTable.hpp \39 32 Validate/ReturnCheck.cpp \ 40 33 Validate/ReturnCheck.hpp \ -
src/main.cc
r4b4f95f r433905a 10 10 // Created On : Fri May 15 23:12:02 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Apr 29 9:52:00 202213 // Update Count : 67 312 // Last Modified On : Wed Apr 13 11:11:00 2022 13 // Update Count : 672 14 14 // 15 15 … … 75 75 #include "Tuples/Tuples.h" // for expandMemberTuples, expan... 76 76 #include "Validate/Autogen.hpp" // for autogenerateRoutines 77 #include "Validate/GenericParameter.hpp" // for fillGenericParameters, tr... 78 #include "Validate/FindSpecialDecls.h" // for findGlobalDecls 79 #include "Validate/ForallPointerDecay.hpp" // for decayForallPointers 77 80 #include "Validate/CompoundLiteral.hpp" // for handleCompoundLiterals 78 #include "Validate/EliminateTypedef.hpp" // for eliminateTypedef79 #include "Validate/FindSpecialDecls.h" // for findGlobalDecls80 #include "Validate/FixQualifiedTypes.hpp" // for fixQualifiedTypes81 #include "Validate/ForallPointerDecay.hpp" // for decayForallPointers82 #include "Validate/GenericParameter.hpp" // for fillGenericParameters, tr...83 #include "Validate/HoistStruct.hpp" // for hoistStruct84 81 #include "Validate/InitializerLength.hpp" // for setLengthFromInitializer 85 82 #include "Validate/LabelAddressFixer.hpp" // for fixLabelAddresses … … 331 328 // add the assignment statement after the initialization of a type parameter 332 329 PASS( "Validate-A", SymTab::validate_A( translationUnit ) ); 333 334 // Must happen before auto-gen, because it uses the sized flag. 335 PASS( "Link Reference To Types", SymTab::linkReferenceToTypes( translationUnit ) ); 330 PASS( "Validate-B", SymTab::validate_B( translationUnit ) ); 336 331 337 332 CodeTools::fillLocations( translationUnit ); … … 347 342 348 343 forceFillCodeLocations( transUnit ); 349 350 // Must happen after Link References To Types,351 // because aggregate members are accessed.352 PASS( "Fix Qualified Types", Validate::fixQualifiedTypes( transUnit ) );353 354 PASS( "Hoist Struct", Validate::hoistStruct( transUnit ) );355 PASS( "Eliminate Typedef", Validate::eliminateTypedef( transUnit ) );356 344 357 345 // Check as early as possible. Can't happen before … … 450 438 translationUnit = convert( move( transUnit ) ); 451 439 } else { 452 PASS( "Validate-B", SymTab::validate_B( translationUnit ) );453 440 PASS( "Validate-C", SymTab::validate_C( translationUnit ) ); 454 441 PASS( "Validate-D", SymTab::validate_D( translationUnit ) );
Note:
See TracChangeset
for help on using the changeset viewer.