Changeset 0db48ca
- Timestamp:
- Feb 12, 2022, 1:56:44 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 0ebbca4
- Parents:
- 4708eaa (diff), eb211bf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
r4708eaa r0db48ca 161 161 Tools.BuildStage('Test: full', Settings.RunAllTests) { 162 162 dir (BuildDir) { 163 jopt = "" 164 if( Settings.Architecture.node == 'x86' ) { 165 jopt = "-j2" 166 } 163 167 //Run the tests from the tests directory 164 sh """make --no-print-directory -C tests timeouts="--timeout=600 --global-timeout=14400" all-tests debug=yes archiveerrors=${BuildDir}/tests/crashes/full-debug"""165 sh """make --no-print-directory -C tests timeouts="--timeout=600 --global-timeout=14400" all-tests debug=no archiveerrors=${BuildDir}/tests/crashes/full-nodebug"""168 sh """make ${jopt} --no-print-directory -C tests timeouts="--timeout=600 --global-timeout=14400" all-tests debug=yes archiveerrors=${BuildDir}/tests/crashes/full-debug""" 169 sh """make ${jopt} --no-print-directory -C tests timeouts="--timeout=600 --global-timeout=14400" all-tests debug=no archiveerrors=${BuildDir}/tests/crashes/full-nodebug""" 166 170 } 167 171 } -
benchmark/io/http/Makefile.am
r4708eaa r0db48ca 50 50 .dummy_hackxx.cpp: 51 51 @echo "int bar() { return 0; }" > ${@} 52 53 # add dependency of cfa files 54 nodist_httpforall_OBJECTS = $(addsuffix .o, $(basename $(filter %.cfa,$(nodist_httpforall_SOURCES)))) 55 $(nodist_httpforall_OBJECTS) : @CFACC@ @CFACPP@ 56 57 # .deps inclusion is not done automatically by automake for new languages 58 nodist_httpforall_DEPENDS = $(join \ 59 $(addsuffix $(DEPDIR)/ , $(dir $(nodist_httpforall_OBJECTS) ) ), \ 60 $(notdir ${nodist_httpforall_OBJECTS:.o=.Po}) \ 61 ) 62 63 -include $(nodist_httpforall_DEPENDS) 64 65 list_libdeps: 66 echo "objects: " $(nodist_httpforall_OBJECTS) 67 echo "depends: " $(nodist_httpforall_DEPENDS) -
libcfa/src/concurrency/kernel.hfa
r4708eaa r0db48ca 173 173 174 174 static inline void ?{}(__timestamp_t & this) { this.tv = 0; this.ma = 0; } 175 static inline void ^?{}(__timestamp_t & this) {}175 static inline void ^?{}(__timestamp_t &) {} 176 176 177 177 struct __attribute__((aligned(128))) __ready_queue_caches_t; -
libcfa/src/stdlib.hfa
r4708eaa r0db48ca 209 209 210 210 forall( TT... | { T * alloc_internal$( void *, T *, size_t, size_t, S_fill(T), TT ); } ) { 211 T * alloc_internal$( void * , T * Realloc, size_t Align, size_t Dim, S_fill(T) Fill, T_resize Resize, TT rest) {211 T * alloc_internal$( void * , T * , size_t Align, size_t Dim, S_fill(T) Fill, T_resize Resize, TT rest) { 212 212 return alloc_internal$( Resize, (T*)0p, Align, Dim, Fill, rest); 213 213 } 214 214 215 T * alloc_internal$( void * Resize, T * , size_t Align, size_t Dim, S_fill(T) Fill, S_realloc(T) Realloc, TT rest) {215 T * alloc_internal$( void * , T * , size_t Align, size_t Dim, S_fill(T) Fill, S_realloc(T) Realloc, TT rest) { 216 216 return alloc_internal$( (void*)0p, Realloc, Align, Dim, Fill, rest); 217 217 } … … 389 389 // Declaration : 390 390 // PRNG sprng = { 1009 } - set starting seed versus random seed 391 // 391 // 392 392 // Interface : 393 393 // set_seed( sprng, 1009 ) - set starting seed for ALL kernel threads versus random seed -
src/AST/Convert.hpp
r4708eaa r0db48ca 20 20 class Declaration; 21 21 namespace ast { 22 structTranslationUnit;22 class TranslationUnit; 23 23 }; 24 24 -
src/AST/Fwd.hpp
r4708eaa r0db48ca 140 140 typedef unsigned int UniqueId; 141 141 142 structTranslationUnit;142 class TranslationUnit; 143 143 // TODO: Get from the TranslationUnit: 144 144 extern ptr<Type> sizeType; -
src/AST/Pass.hpp
r4708eaa r0db48ca 239 239 private: 240 240 241 // Regular nodes 241 __pass::result1<ast::Stmt> call_accept( const ast::Stmt * ); 242 __pass::result1<ast::Expr> call_accept( const ast::Expr * ); 243 244 /// This has a `type` member that is the return type for the 245 /// generic call_accept if the generic call_accept is defined. 242 246 template< typename node_t > 243 struct result1 { 244 bool differs; 245 const node_t * value; 246 247 template< typename object_t, typename super_t, typename field_t > 248 void apply(object_t *, field_t super_t::* field); 249 }; 250 251 result1<ast::Stmt> call_accept( const ast::Stmt * ); 252 result1<ast::Expr> call_accept( const ast::Expr * ); 247 using generic_call_accept_result = 248 std::enable_if< 249 !std::is_base_of<ast::Expr, node_t>::value && 250 !std::is_base_of<ast::Stmt, node_t>::value 251 , __pass::result1< 252 typename std::remove_pointer< typename std::result_of< 253 decltype(&node_t::accept)(node_t*, type&) >::type >::type 254 > 255 >; 253 256 254 257 template< typename node_t > 255 258 auto call_accept( const node_t * node ) 256 -> typename std::enable_if< 257 !std::is_base_of<ast::Expr, node_t>::value && 258 !std::is_base_of<ast::Stmt, node_t>::value 259 , result1< 260 typename std::remove_pointer< decltype( node->accept(*this) ) >::type 261 > 262 >::type; 259 -> typename generic_call_accept_result<node_t>::type; 263 260 264 261 // requests WithStmtsToAdd directly add to this statement, as if it is a compound. 265 result1<ast::Stmt> call_accept_as_compound(const ast::Stmt *); 266 267 // Container of statements 262 __pass::result1<ast::Stmt> call_accept_as_compound(const ast::Stmt *); 263 268 264 template< template <class...> class container_t > 269 struct resultNstmt { 270 struct delta { 271 ptr<Stmt> nval; 272 ssize_t old_idx; 273 bool is_old; 274 275 delta(const Stmt * s, ssize_t i, bool old) : nval{s}, old_idx{i}, is_old{old} {} 276 }; 277 278 bool differs; 279 container_t< delta > values; 280 281 resultNstmt() : differs(false), values{} {} 282 resultNstmt(bool diff, container_t< delta > && vals) : differs(diff), values(vals) {} 283 284 template< typename object_t, typename super_t, typename field_t > 285 void apply(object_t *, field_t super_t::* field); 286 287 template< template <class...> class incontainer_t > 288 void take_all( incontainer_t<ast::ptr<ast::Stmt>> * stmts ) { 289 if(!stmts || stmts->empty()) return; 290 291 std::transform(stmts->begin(), stmts->end(), std::back_inserter( values ), [](ast::ptr<ast::Stmt>& decl) -> delta { 292 return delta( decl.release(), -1, false ); 293 }); 294 stmts->clear(); 295 differs = true; 296 } 297 298 template< template <class...> class incontainer_t > 299 void take_all( incontainer_t<ast::ptr<ast::Decl>> * decls ) { 300 if(!decls || decls->empty()) return; 301 302 std::transform(decls->begin(), decls->end(), std::back_inserter( values ), [](ast::ptr<ast::Decl>& decl) -> auto { 303 auto loc = decl->location; 304 auto stmt = new DeclStmt( loc, decl.release() ); 305 return delta( stmt, -1, false ); 306 }); 307 decls->clear(); 308 differs = true; 309 } 310 }; 311 312 template< template <class...> class container_t > 313 resultNstmt<container_t> call_accept( const container_t< ptr<Stmt> > & ); 314 315 // Container of something 265 __pass::resultNstmt<container_t> call_accept( const container_t< ptr<Stmt> > & ); 266 316 267 template< template <class...> class container_t, typename node_t > 317 struct resultN { 318 bool differs; 319 container_t<ptr<node_t>> values; 320 321 template< typename object_t, typename super_t, typename field_t > 322 void apply(object_t *, field_t super_t::* field); 323 }; 324 325 template< template <class...> class container_t, typename node_t > 326 resultN< container_t, node_t > call_accept( const container_t< ptr<node_t> > & container ); 268 __pass::resultN< container_t, node_t > call_accept( const container_t< ptr<node_t> > & container ); 327 269 328 270 public: -
src/AST/Pass.impl.hpp
r4708eaa r0db48ca 111 111 } 112 112 113 114 113 //------------------------------ 115 114 /// Check if value was mutated, different for pointers and containers … … 125 124 } 126 125 127 128 template< typename core_t >129 126 template< typename node_t > 130 127 template< typename object_t, typename super_t, typename field_t > 131 void ast::Pass< core_t >::result1< node_t >::apply(object_t * object, field_t super_t::* field) {128 void __pass::result1< node_t >::apply( object_t * object, field_t super_t::* field ) { 132 129 object->*field = value; 133 130 } … … 136 133 template< typename node_t > 137 134 auto ast::Pass< core_t >::call_accept( const node_t * node ) 138 -> typename std::enable_if< 139 !std::is_base_of<ast::Expr, node_t>::value && 140 !std::is_base_of<ast::Stmt, node_t>::value 141 , ast::Pass< core_t >::result1< 142 typename std::remove_pointer< decltype( node->accept(*this) ) >::type 143 > 144 >::type 135 -> typename ast::Pass< core_t >::template generic_call_accept_result<node_t>::type 145 136 { 146 137 __pedantic_pass_assert( __visit_children() ); … … 151 142 152 143 auto nval = node->accept( *this ); 153 ast::Pass< core_t >::result1<144 __pass::result1< 154 145 typename std::remove_pointer< decltype( node->accept(*this) ) >::type 155 146 > res; … … 160 151 161 152 template< typename core_t > 162 typename ast::Pass< core_t >::template result1<ast::Expr> ast::Pass< core_t >::call_accept( const ast::Expr * expr ) {153 __pass::template result1<ast::Expr> ast::Pass< core_t >::call_accept( const ast::Expr * expr ) { 163 154 __pedantic_pass_assert( __visit_children() ); 164 155 __pedantic_pass_assert( expr ); … … 174 165 175 166 template< typename core_t > 176 typename ast::Pass< core_t >::template result1<ast::Stmt> ast::Pass< core_t >::call_accept( const ast::Stmt * stmt ) {167 __pass::template result1<ast::Stmt> ast::Pass< core_t >::call_accept( const ast::Stmt * stmt ) { 177 168 __pedantic_pass_assert( __visit_children() ); 178 169 __pedantic_pass_assert( stmt ); … … 183 174 184 175 template< typename core_t > 185 typename ast::Pass< core_t >::template result1<ast::Stmt> ast::Pass< core_t >::call_accept_as_compound( const ast::Stmt * stmt ) {176 __pass::template result1<ast::Stmt> ast::Pass< core_t >::call_accept_as_compound( const ast::Stmt * stmt ) { 186 177 __pedantic_pass_assert( __visit_children() ); 187 178 __pedantic_pass_assert( stmt ); … … 233 224 } 234 225 235 template< typename core_t >236 226 template< template <class...> class container_t > 237 227 template< typename object_t, typename super_t, typename field_t > 238 void ast::Pass< core_t >::resultNstmt<container_t>::apply(object_t * object, field_t super_t::* field) {228 void __pass::resultNstmt<container_t>::apply(object_t * object, field_t super_t::* field) { 239 229 auto & container = object->*field; 240 230 __pedantic_pass_assert( container.size() <= values.size() ); … … 243 233 244 234 container_t<ptr<Stmt>> nvals; 245 for (delta & d : values) {246 if ( d.is_old ) {235 for (delta & d : values) { 236 if ( d.is_old ) { 247 237 __pedantic_pass_assert( cit.idx <= d.old_idx ); 248 238 std::advance( cit, d.old_idx - cit.idx ); 249 239 nvals.push_back( std::move( (*cit).val) ); 250 240 } else { 251 nvals.push_back( std::move(d.n val) );241 nvals.push_back( std::move(d.new_val) ); 252 242 } 253 243 } 254 244 255 object->*field = std::move(nvals); 245 container = std::move(nvals); 246 } 247 248 template< template <class...> class container_t > 249 template< template <class...> class incontainer_t > 250 void __pass::resultNstmt< container_t >::take_all( incontainer_t<ptr<Stmt>> * stmts ) { 251 if (!stmts || stmts->empty()) return; 252 253 std::transform(stmts->begin(), stmts->end(), std::back_inserter( values ), 254 [](ast::ptr<ast::Stmt>& stmt) -> delta { 255 return delta( stmt.release(), -1, false ); 256 }); 257 stmts->clear(); 258 differs = true; 259 } 260 261 template< template<class...> class container_t > 262 template< template<class...> class incontainer_t > 263 void __pass::resultNstmt< container_t >::take_all( incontainer_t<ptr<Decl>> * decls ) { 264 if (!decls || decls->empty()) return; 265 266 std::transform(decls->begin(), decls->end(), std::back_inserter( values ), 267 [](ast::ptr<ast::Decl>& decl) -> delta { 268 auto loc = decl->location; 269 auto stmt = new DeclStmt( loc, decl.release() ); 270 return delta( stmt, -1, false ); 271 }); 272 decls->clear(); 273 differs = true; 256 274 } 257 275 258 276 template< typename core_t > 259 277 template< template <class...> class container_t > 260 typename ast::Pass< core_t >::template resultNstmt<container_t> ast::Pass< core_t >::call_accept( const container_t< ptr<Stmt> > & statements ) {278 __pass::template resultNstmt<container_t> ast::Pass< core_t >::call_accept( const container_t< ptr<Stmt> > & statements ) { 261 279 __pedantic_pass_assert( __visit_children() ); 262 280 if( statements.empty() ) return {}; … … 285 303 pass_visitor_stats.avg->push(pass_visitor_stats.depth); 286 304 287 resultNstmt<container_t> new_kids;305 __pass::resultNstmt<container_t> new_kids; 288 306 for( auto value : enumerate( statements ) ) { 289 307 try { … … 327 345 } 328 346 329 template< typename core_t >330 347 template< template <class...> class container_t, typename node_t > 331 348 template< typename object_t, typename super_t, typename field_t > 332 void ast::Pass< core_t >::resultN<container_t, node_t>::apply(object_t * object, field_t super_t::* field) {349 void __pass::resultN<container_t, node_t>::apply(object_t * object, field_t super_t::* field) { 333 350 auto & container = object->*field; 334 351 __pedantic_pass_assert( container.size() == values.size() ); … … 346 363 template< typename core_t > 347 364 template< template <class...> class container_t, typename node_t > 348 typename ast::Pass< core_t >::template resultN<container_t, node_t> ast::Pass< core_t >::call_accept( const container_t< ast::ptr<node_t> > & container ) {365 __pass::template resultN<container_t, node_t> ast::Pass< core_t >::call_accept( const container_t< ast::ptr<node_t> > & container ) { 349 366 __pedantic_pass_assert( __visit_children() ); 350 367 if( container.empty() ) return {}; … … 378 395 if ( ! errors.isEmpty() ) { throw errors; } 379 396 380 return ast:: Pass< core_t >::resultN<container_t, node_t>{ mutated,new_kids };397 return ast::__pass::resultN<container_t, node_t>{ mutated, new_kids }; 381 398 } 382 399 -
src/AST/Pass.proto.hpp
r4708eaa r0db48ca 23 23 class Pass; 24 24 25 structTranslationUnit;25 class TranslationUnit; 26 26 27 27 struct PureVisitor; … … 123 123 static constexpr bool value = std::is_void< ret_t >::value || 124 124 std::is_base_of<const node_t, typename std::remove_pointer<ret_t>::type >::value; 125 }; 126 127 /// The result is a single node. 128 template< typename node_t > 129 struct result1 { 130 bool differs; 131 const node_t * value; 132 133 template< typename object_t, typename super_t, typename field_t > 134 void apply( object_t *, field_t super_t::* field ); 135 }; 136 137 /// The result is a container of statements. 138 template< template<class...> class container_t > 139 struct resultNstmt { 140 /// The delta/change on a single node. 141 struct delta { 142 ptr<Stmt> new_val; 143 ssize_t old_idx; 144 bool is_old; 145 146 delta(const Stmt * s, ssize_t i, bool old) : 147 new_val(s), old_idx(i), is_old(old) {} 148 }; 149 150 bool differs; 151 container_t< delta > values; 152 153 template< typename object_t, typename super_t, typename field_t > 154 void apply( object_t *, field_t super_t::* field ); 155 156 template< template<class...> class incontainer_t > 157 void take_all( incontainer_t<ptr<Stmt>> * stmts ); 158 159 template< template<class...> class incontainer_t > 160 void take_all( incontainer_t<ptr<Decl>> * decls ); 161 }; 162 163 /// The result is a container of nodes. 164 template< template<class...> class container_t, typename node_t > 165 struct resultN { 166 bool differs; 167 container_t<ptr<node_t>> values; 168 169 template< typename object_t, typename super_t, typename field_t > 170 void apply( object_t *, field_t super_t::* field ); 125 171 }; 126 172 -
src/AST/TranslationUnit.hpp
r4708eaa r0db48ca 23 23 namespace ast { 24 24 25 struct TranslationUnit { 25 class TranslationUnit { 26 public: 26 27 std::list< ptr< Decl > > decls; 27 28 -
src/CodeGen/FixNames.h
r4708eaa r0db48ca 20 20 class Declaration; 21 21 namespace ast { 22 structTranslationUnit;22 class TranslationUnit; 23 23 } 24 24 -
src/Common/CodeLocation.h
r4708eaa r0db48ca 25 25 /// Create a new unset CodeLocation. 26 26 CodeLocation() = default; 27 28 27 29 28 /// Create a new CodeLocation with the given values. -
src/Common/CodeLocationTools.hpp
r4708eaa r0db48ca 17 17 18 18 namespace ast { 19 structTranslationUnit;19 class TranslationUnit; 20 20 } 21 21 -
src/Common/ResolvProtoDump.hpp
r4708eaa r0db48ca 17 17 18 18 namespace ast { 19 structTranslationUnit;19 class TranslationUnit; 20 20 } 21 21 -
src/Concurrency/Waitfor.cc
r4708eaa r0db48ca 372 372 ), 373 373 new ListInit( 374 map_range < std::list<Initializer*> > ( clause.target.arguments, [this](Expression * expr ){ 375 Expression * init = new CastExpr( 376 new UntypedExpr( 377 new NameExpr( "get_monitor" ), 378 { expr } 379 ), 380 new PointerType( 381 noQualifiers, 382 new StructInstType( 383 noQualifiers, 384 decl_monitor 385 ) 386 ), 387 false 388 ); 389 390 ResolvExpr::findSingleExpression( init, indexer ); 391 return new SingleInit( init ); 374 map_range < std::list<Initializer*> > ( clause.target.arguments, [](Expression * expr ){ 375 return new SingleInit( expr ); 392 376 }) 393 377 ) -
src/ControlStruct/MultiLevelExit.cpp
r4708eaa r0db48ca 176 176 auto mutStmt = mutate( stmt ); 177 177 // A child statement may set the break label. 178 mutStmt->kids = move( fixBlock( stmt->kids, false ));178 mutStmt->kids = fixBlock( stmt->kids, false ); 179 179 180 180 if ( isLabeled ) { -
src/InitTweak/FixInit.h
r4708eaa r0db48ca 21 21 class Declaration; 22 22 namespace ast { 23 structTranslationUnit;23 class TranslationUnit; 24 24 } 25 25 -
src/MakeLibCfa.h
r4708eaa r0db48ca 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // MakeLibCfa.h -- 7 // MakeLibCfa.h -- 8 8 // 9 9 // Author : Richard C. Bilson … … 20 20 class Declaration; 21 21 namespace ast { 22 structTranslationUnit;22 class TranslationUnit; 23 23 } 24 24 -
src/ResolvExpr/Resolver.cc
r4708eaa r0db48ca 1112 1112 } 1113 1113 1114 1114 1115 1115 } // anonymous namespace 1116 1116 /// Establish post-resolver invariants for expressions … … 1158 1158 1159 1159 namespace { 1160 1160 1161 1161 1162 1162 /// resolve `untyped` to the expression whose candidate satisfies `pred` with the … … 1905 1905 1906 1906 clause2.target.args.reserve( clause.target.args.size() ); 1907 const ast::StructDecl * decl_monitor = symtab.lookupStruct( "monitor$" ); 1907 1908 for ( auto arg : argsCandidates.front() ) { 1908 clause2.target.args.emplace_back( std::move( arg->expr ) ); 1909 const auto & loc = stmt->location; 1910 1911 ast::Expr * init = new ast::CastExpr( loc, 1912 new ast::UntypedExpr( loc, 1913 new ast::NameExpr( loc, "get_monitor" ), 1914 { arg->expr } 1915 ), 1916 new ast::PointerType( 1917 new ast::StructInstType( 1918 decl_monitor 1919 ) 1920 ) 1921 ); 1922 1923 clause2.target.args.emplace_back( findSingleExpression( init, symtab ) ); 1909 1924 } 1910 1925 … … 2077 2092 if (auto functionDecl = decl.as<ast::FunctionDecl>()) { 2078 2093 // xxx - can intrinsic gen ever fail? 2079 if (functionDecl->linkage == ast::Linkage::AutoGen) { 2094 if (functionDecl->linkage == ast::Linkage::AutoGen) { 2080 2095 auto mutDecl = mutate(functionDecl); 2081 2096 mutDecl->isDeleted = true; -
src/ResolvExpr/Resolver.h
r4708eaa r0db48ca 35 35 class StmtExpr; 36 36 class SymbolTable; 37 structTranslationUnit;37 class TranslationUnit; 38 38 class Type; 39 39 class TypeEnvironment; … … 72 72 ast::ptr< ast::Init > resolveCtorInit( 73 73 const ast::ConstructorInit * ctorInit, const ast::SymbolTable & symtab ); 74 /// Resolves a statement expression 74 /// Resolves a statement expression 75 75 const ast::Expr * resolveStmtExpr( 76 76 const ast::StmtExpr * stmtExpr, const ast::SymbolTable & symtab );
Note: See TracChangeset
for help on using the changeset viewer.