Changeset 81da3da4
- Timestamp:
- Dec 11, 2023, 4:18:13 AM (22 months ago)
- Branches:
- master
- Children:
- 21ce2c7, 2554f24
- Parents:
- 5ddb8bf (diff), 1c85ffc (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:
-
- 1 added
- 1 deleted
- 49 edited
- 21 moved
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r5ddb8bf r81da3da4 39 39 driver/cfa-cpp 40 40 driver/cc1 41 driver/demangler 41 42 42 43 libcfa/prelude/bootloader.c … … 59 60 src/Parser/parser.h 60 61 src/Parser/parser.hh 61 src/demangler62 62 63 63 tools/prettyprinter/parser.output -
configure.ac
r5ddb8bf r81da3da4 244 244 if test "x$enable_demangler" == xyes; then 245 245 LIBDEMANGLE="libdemangle.a" 246 DEMANGLER=" demangler"246 DEMANGLER="../driver/demangler" 247 247 else 248 248 LIBDEMANGLE="" … … 273 273 libcfa/Makefile:libcfa/Makefile.dist.in 274 274 tests/Makefile 275 275 ]) 276 276 277 277 # Some of our makefile don't need to be distributed -
libcfa/src/bits/random.hfa
r5ddb8bf r81da3da4 10 10 // Created On : Fri Jan 14 07:18:11 2022 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Sep 2 18:04:12 202313 // Update Count : 1 8712 // Last Modified On : Tue Dec 5 08:58:52 2023 13 // Update Count : 190 14 14 // 15 15 … … 22 22 23 23 // Set default PRNG for architecture size. 24 #if defined( __x86_64__ ) || defined( __a rm_64__ ) // 64-bit architecture24 #if defined( __x86_64__ ) || defined( __aarch64__ ) // 64-bit architecture 25 25 // 64-bit generators 26 26 //#define LEHMER64 … … 112 112 113 113 // Default PRNG used by runtime. 114 #if defined( __x86_64__ ) || defined( __a rm_64__ ) // 64-bit architecture114 #if defined( __x86_64__ ) || defined( __aarch64__ ) // 64-bit architecture 115 115 #define PRNG_NAME PRNG_NAME_64 116 116 #define PRNG_STATE_T PRNG_STATE_64_T -
src/AST/Chain.hpp
r5ddb8bf r81da3da4 33 33 template<typename actual_node_t, typename child_t> 34 34 auto operator()( child_t actual_node_t::*child ) { 35 auto n = mutate(base.get());35 node_t * n = base.get_and_mutate(); 36 36 actual_node_t * node = strict_dynamic_cast<actual_node_t *>(n); 37 base = node;38 37 return _chain_mutator< typename std::remove_reference< decltype(node->*child) >::type >{node->*child}; 39 38 } 40 39 41 40 node_t * operator->() { 42 auto n = mutate(base.get()); 43 base = n; 44 return n; 41 return base.get_and_mutate(); 45 42 } 46 43 }; -
src/AST/Decl.cpp
r5ddb8bf r81da3da4 21 21 22 22 #include "Common/Eval.h" // for eval 23 #include "Common/SemanticError.h" 23 24 24 25 #include "Fwd.hpp" // for UniqueId … … 41 42 42 43 FunctionDecl::FunctionDecl( const CodeLocation & loc, const std::string & name, 43 std::vector<ptr<TypeDecl>>&& forall,44 44 std::vector<ptr<DeclWithType>>&& params, std::vector<ptr<DeclWithType>>&& returns, 45 45 CompoundStmt * stmts, Storage::Classes storage, Linkage::Spec linkage, 46 46 std::vector<ptr<Attribute>>&& attrs, Function::Specs fs, ArgumentFlag isVarArgs ) 47 : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), 48 type_params(std::move(forall)), assertions(), 49 params(std::move(params)), returns(std::move(returns)), stmts( stmts ) { 50 FunctionType * ftype = new FunctionType( isVarArgs ); 51 for (auto & param : this->params) { 52 ftype->params.emplace_back(param->get_type()); 53 } 54 for (auto & ret : this->returns) { 55 ftype->returns.emplace_back(ret->get_type()); 56 } 57 for (auto & tp : this->type_params) { 58 ftype->forall.emplace_back(new TypeInstType(tp)); 59 for (auto & ap: tp->assertions) { 60 ftype->assertions.emplace_back(new VariableExpr(loc, ap)); 61 } 62 } 63 this->type = ftype; 47 : FunctionDecl( loc, name, {}, {}, std::move(params), std::move(returns), 48 stmts, storage, linkage, std::move(attrs), fs, isVarArgs ) { 64 49 } 65 50 -
src/AST/Decl.hpp
r5ddb8bf r81da3da4 30 30 #include "Visitor.hpp" 31 31 #include "Common/utility.h" 32 #include "Common/SemanticError.h" // error_str33 32 34 33 // Must be included in *all* AST classes; should be #undef'd at the end of the file … … 135 134 std::vector< ptr<Expr> > withExprs; 136 135 137 // The difference between the two constructors is in how they handle 138 // assertions. The first constructor uses the assertions from the type 139 // parameters, in the style of the old ast, and puts them on the type. 140 // The second takes an explicite list of assertions and builds a list of 141 // references to them on the type. 142 143 FunctionDecl( const CodeLocation & loc, const std::string & name, std::vector<ptr<TypeDecl>>&& forall, 136 /// Monomorphic Function Constructor: 137 FunctionDecl( const CodeLocation & locaction, const std::string & name, 144 138 std::vector<ptr<DeclWithType>>&& params, std::vector<ptr<DeclWithType>>&& returns, 145 139 CompoundStmt * stmts, Storage::Classes storage = {}, Linkage::Spec linkage = Linkage::Cforall, 146 140 std::vector<ptr<Attribute>>&& attrs = {}, Function::Specs fs = {}, ArgumentFlag isVarArgs = FixedArgs ); 147 141 142 /// Polymorphic Function Constructor: 148 143 FunctionDecl( const CodeLocation & location, const std::string & name, 149 144 std::vector<ptr<TypeDecl>>&& forall, std::vector<ptr<DeclWithType>>&& assertions, -
src/AST/Expr.cpp
r5ddb8bf r81da3da4 222 222 } 223 223 224 MemberExpr::MemberExpr( const CodeLocation & loc, const DeclWithType * mem, const Expr * agg,225 MemberExpr::NoOpConstruction overloadSelector )226 : Expr( loc ), member( mem ), aggregate( agg ) {227 assert( member );228 assert( aggregate );229 assert( aggregate->result );230 (void) overloadSelector;231 }232 233 224 bool MemberExpr::get_lvalue() const { 234 225 // This is actually wrong by C, but it works with our current set-up. … … 388 379 stmts.emplace_back( new ExprStmt{ loc, tupleExpr } ); 389 380 stmtExpr = new StmtExpr{ loc, new CompoundStmt{ loc, std::move(stmts) } }; 390 }391 392 TupleAssignExpr::TupleAssignExpr(393 const CodeLocation & loc, const Type * result, const StmtExpr * s )394 : Expr( loc, result ), stmtExpr() {395 stmtExpr = s;396 381 } 397 382 -
src/AST/Expr.hpp
r5ddb8bf r81da3da4 35 35 template<typename node_t> friend node_t * shallowCopy(const node_t * node); 36 36 37 38 class ConverterOldToNew;39 class ConverterNewToOld;40 41 37 namespace ast { 42 38 … … 439 435 MemberExpr * clone() const override { return new MemberExpr{ *this }; } 440 436 MUTATE_FRIEND 441 442 // Custructor overload meant only for AST conversion443 enum NoOpConstruction { NoOpConstructionChosen };444 MemberExpr( const CodeLocation & loc, const DeclWithType * mem, const Expr * agg,445 NoOpConstruction overloadSelector );446 friend class ::ConverterOldToNew;447 friend class ::ConverterNewToOld;448 437 }; 449 438 … … 458 447 ConstantExpr( 459 448 const CodeLocation & loc, const Type * ty, const std::string & r, 460 std::optional<unsigned long long>i )461 : Expr( loc, ty ), rep( r ), ival( i ) , underlyer(ty){}449 const std::optional<unsigned long long> & i ) 450 : Expr( loc, ty ), rep( r ), ival( i ) {} 462 451 463 452 /// Gets the integer value of this constant, if one is appropriate to its type. … … 483 472 484 473 std::optional<unsigned long long> ival; 485 486 // Intended only for legacy support of roundtripping the old AST.487 // Captures the very-locally inferred type, before the resolver modifies the type of this ConstantExpression.488 // In the old AST it's constExpr->constant.type489 ptr<Type> underlyer;490 friend class ::ConverterOldToNew;491 friend class ::ConverterNewToOld;492 474 }; 493 475 … … 779 761 const Expr * accept( Visitor & v ) const override { return v.visit( this ); } 780 762 781 friend class ::ConverterOldToNew;782 783 763 private: 784 764 TupleAssignExpr * clone() const override { return new TupleAssignExpr{ *this }; } 785 TupleAssignExpr( const CodeLocation & loc, const Type * result, const StmtExpr * s );786 787 765 MUTATE_FRIEND 788 766 }; -
src/CodeGen/CodeGenerator.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // CodeGenerator New.cpp --7 // CodeGenerator.cpp -- 8 8 // 9 9 // Author : Andrew Beach … … 14 14 // 15 15 16 #include "CodeGenerator New.hpp"16 #include "CodeGenerator.hpp" 17 17 18 18 #include "AST/Print.hpp" -
src/CodeGen/CodeGenerator.hpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // CodeGenerator New.hpp --7 // CodeGenerator.hpp -- 8 8 // 9 9 // Author : Andrew Beach -
src/CodeGen/GenType.cc
r5ddb8bf r81da3da4 21 21 #include "AST/Print.hpp" // for print 22 22 #include "AST/Vector.hpp" // for vector 23 #include "CodeGenerator New.hpp"// for CodeGenerator23 #include "CodeGenerator.hpp" // for CodeGenerator 24 24 #include "Common/UniqueName.h" // for UniqueName 25 25 -
src/CodeGen/GenType.h
r5ddb8bf r81da3da4 20 20 #include "CodeGen/Options.h" // for Options 21 21 22 class Type;23 22 namespace ast { 24 23 class Type; … … 26 25 27 26 namespace CodeGen { 28 std::string genType( Type *type, const std::string &baseString, const Options &options );29 std::string genType( Type *type, const std::string &baseString, bool pretty = false, bool genC = false, bool lineMarks = false );30 std::string genPrettyType( Type * type, const std::string & baseString );31 27 32 28 std::string genType( ast::Type const * type, const std::string & base, const Options & options ); -
src/CodeGen/Generate.cc
r5ddb8bf r81da3da4 19 19 #include <string> // for operator<< 20 20 21 #include "CodeGenerator New.hpp"// for CodeGenerator, doSemicolon, ...21 #include "CodeGenerator.hpp" // for CodeGenerator, doSemicolon, ... 22 22 #include "GenType.h" // for genPrettyType 23 23 -
src/CodeGen/module.mk
r5ddb8bf r81da3da4 16 16 17 17 SRC_CODEGEN = \ 18 CodeGen/CodeGenerator New.cpp \19 CodeGen/CodeGenerator New.hpp \18 CodeGen/CodeGenerator.cpp \ 19 CodeGen/CodeGenerator.hpp \ 20 20 CodeGen/GenType.cc \ 21 21 CodeGen/GenType.h \ -
src/Common/Assert.cc
r5ddb8bf r81da3da4 10 10 // Created On : Thu Aug 18 13:26:59 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 19 17:07:08 201613 // Update Count : 1 012 // Last Modified On : Mon Nov 20 22:57:18 2023 13 // Update Count : 11 14 14 // 15 15 … … 39 39 } 40 40 41 void abort(const char *fmt, ... 42 void abort(const char *fmt, ... 41 void abort(const char *fmt, ... ) noexcept __attribute__((noreturn, format(printf, 1, 2))); 42 void abort(const char *fmt, ... ) noexcept { 43 43 va_list args; 44 44 va_start( args, fmt ); -
src/Concurrency/Actors.cpp
r5ddb8bf r81da3da4 265 265 decl->location, 266 266 "__CFA_receive_wrap", 267 {}, // forall268 267 { 269 268 new ObjectDecl( … … 288 287 ) 289 288 }, // params 290 { 289 { 291 290 new ObjectDecl( 292 291 decl->location, … … 400 399 ) 401 400 )); 402 401 403 402 // Generates: return receiver; 404 403 sendBody->push_back( new ReturnStmt( decl->location, new NameExpr( decl->location, "receiver" ) ) ); … … 408 407 decl->location, 409 408 "?|?", 410 {}, // forall411 409 { 412 410 new ObjectDecl( … … 421 419 ) 422 420 }, // params 423 { 421 { 424 422 new ObjectDecl( 425 423 decl->location, … … 434 432 { Function::Inline } 435 433 ); 436 434 437 435 // forward decls to resolve use before decl problem for '|' routines 438 436 forwardDecls.insertDecl( *actorIter, *messageIter , ast::deepCopy( sendOperatorFunction ) ); -
src/Concurrency/Corun.cpp
r5ddb8bf r81da3da4 113 113 new FunctionDecl( loc, 114 114 fnName, // name 115 {}, // forall116 115 { 117 116 new ObjectDecl( loc, … … 261 260 new FunctionDecl( loc, 262 261 fnName, // name 263 {}, // forall264 262 {}, // params 265 263 {}, // return -
src/Concurrency/Keywords.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Keywords New.cpp -- Implement concurrency constructs from their keywords.7 // Keywords.cpp -- Implement concurrency constructs from their keywords. 8 8 // 9 9 // Author : Andrew Beach … … 14 14 // 15 15 16 #include "Concurrency/Keywords.h" 17 16 18 #include <iostream> 17 18 #include "Concurrency/Keywords.h"19 19 20 20 #include "AST/Copy.hpp" … … 30 30 #include "Common/utility.h" 31 31 #include "Common/UniqueName.h" 32 #include "ControlStruct/LabelGenerator New.hpp"32 #include "ControlStruct/LabelGenerator.hpp" 33 33 #include "InitTweak/InitTweak.h" 34 34 #include "Virtual/Tables.h" … … 482 482 location, 483 483 getter_name, 484 {}, // forall485 484 { this_decl }, // params 486 485 { ret_decl }, // returns … … 499 498 location, 500 499 "main", 501 {},502 500 { ast::deepCopy( this_decl ) }, 503 501 {}, … … 575 573 location, 576 574 "lock", 577 { /* forall */ },578 575 { 579 576 // Copy the declaration of this. … … 607 604 location, 608 605 "unlock", 609 { /* forall */ },610 606 { 611 607 // Last use, consume the declaration of this. -
src/Concurrency/Waitfor.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Waitfor New.cpp -- Expand waitfor clauses into code.7 // Waitfor.cpp -- Expand waitfor clauses into code. 8 8 // 9 9 // Author : Andrew Beach -
src/Concurrency/Waituntil.cpp
r5ddb8bf r81da3da4 553 553 return new FunctionDecl( loc, 554 554 predName, 555 {}, // forall556 555 { 557 556 new ObjectDecl( loc, … … 560 559 ) 561 560 }, 562 { 561 { 563 562 new ObjectDecl( loc, 564 563 "sat_ret", -
src/Concurrency/module.mk
r5ddb8bf r81da3da4 20 20 Concurrency/Corun.cpp \ 21 21 Concurrency/Corun.hpp \ 22 Concurrency/Keywords New.cpp \22 Concurrency/Keywords.cpp \ 23 23 Concurrency/Keywords.h \ 24 Concurrency/Waitfor New.cpp \24 Concurrency/Waitfor.cpp \ 25 25 Concurrency/Waitfor.h \ 26 26 Concurrency/Waituntil.cpp \ -
src/ControlStruct/ExceptDecl.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ExceptDecl New.cpp --7 // ExceptDecl.cpp -- 8 8 // 9 9 // Author : Andrew Beach -
src/ControlStruct/ExceptDecl.h
r5ddb8bf r81da3da4 16 16 #pragma once 17 17 18 #include <list> // for list19 20 class Declaration;21 22 18 namespace ast { 23 19 class TranslationUnit; … … 25 21 26 22 namespace ControlStruct { 23 27 24 /// Unfold exception declarations into raw structure declarations. 28 25 /// Also builds vtable declarations and converts vtable types. 29 void translateExcept( std::list< Declaration *> & translationUnit );30 26 void translateExcept( ast::TranslationUnit & translationUnit ); 27 31 28 } -
src/ControlStruct/ExceptTranslate.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ExceptTranslate New.cpp -- Conversion of exception control flow structures.7 // ExceptTranslate.cpp -- Conversion of exception control flow structures. 8 8 // 9 9 // Author : Andrew Beach … … 26 26 namespace { 27 27 28 29 30 31 block->push_back(new ast::DeclStmt(block->location, item));32 28 typedef std::list<ast::CatchClause*> CatchList; 29 30 void appendDeclStmt( ast::CompoundStmt * block, ast::DeclWithType * item ) { 31 block->push_back( new ast::DeclStmt( block->location, item ) ); 32 } 33 33 34 34 class TranslateThrowsCore final : public ast::WithGuards { … … 253 253 location, 254 254 "try", 255 {}, //forall256 255 {}, //no param 257 256 {}, //no return … … 267 266 location, 268 267 "catch", 269 {}, //forall270 268 { make_index_object( location ), make_exception_object( location ) }, 271 269 {}, //return void … … 281 279 location, 282 280 "match", 283 {}, //forall284 281 { make_exception_object( location ) }, 285 282 { make_unused_index_object( location ) }, … … 295 292 location, 296 293 "handle", 297 {}, //forall298 294 { make_exception_object( location ) }, 299 295 { make_bool_object( location ) }, … … 309 305 location, 310 306 "finally", 311 {}, //forall312 307 { make_voidptr_object( location ) }, 313 308 {}, //return void -
src/ControlStruct/ExceptTranslate.h
r5ddb8bf r81da3da4 16 16 #pragma once 17 17 18 #include <list> // for list19 20 class Declaration;21 18 namespace ast { 22 19 class TranslationUnit; … … 24 21 25 22 namespace ControlStruct { 26 void translateThrows( std::list< Declaration *> & translationUnit );27 void translateThrows( ast::TranslationUnit & transUnit );28 /* Replaces all throw & throwResume statements with function calls.29 * These still need to be resolved, so call this before the reslover.30 */31 23 32 void translateTries( std::list< Declaration *> & translationUnit ); 33 void translateTries( ast::TranslationUnit & transUnit ); 34 /* Replaces all try blocks (and their many clauses) with function definitions and calls. 35 * This uses the exception built-ins to produce typed output and should take place after 36 * the resolver. It also produces virtual casts and should happen before they are expanded. 37 */ 24 void translateThrows( ast::TranslationUnit & transUnit ); 25 /* Replaces all throw & throwResume statements with function calls. 26 * These still need to be resolved, so call this before the reslover. 27 */ 28 29 void translateTries( ast::TranslationUnit & transUnit ); 30 /* Replaces all try blocks (and their many clauses) with function definitions and calls. 31 * This uses the exception built-ins to produce typed output and should take place after 32 * the resolver. It also produces virtual casts and should happen before they are expanded. 33 */ 34 38 35 } 39 36 -
src/ControlStruct/LabelGenerator.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // LabelGenerator New.cpp --7 // LabelGenerator.cpp -- 8 8 // 9 9 // Author : Peter A. Buhr … … 14 14 // 15 15 16 #include "LabelGenerator New.hpp"16 #include "LabelGenerator.hpp" 17 17 18 18 #include "AST/Attribute.hpp" -
src/ControlStruct/LabelGenerator.hpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // LabelGenerator.h --7 // LabelGenerator.hpp -- 8 8 // 9 9 // Author : Rodolfo G. Esteves … … 26 26 27 27 namespace ControlStruct { 28 ast::Label newLabel( const std::string &, const ast::Stmt * ); 29 ast::Label newLabel( const std::string &, const CodeLocation & ); 28 29 ast::Label newLabel( const std::string &, const ast::Stmt * ); 30 ast::Label newLabel( const std::string &, const CodeLocation & ); 31 30 32 } // namespace ControlStruct 31 33 -
src/ControlStruct/MultiLevelExit.cpp
r5ddb8bf r81da3da4 16 16 #include "MultiLevelExit.hpp" 17 17 18 #include <set> 19 18 20 #include "AST/Pass.hpp" 19 21 #include "AST/Stmt.hpp" 20 #include "LabelGeneratorNew.hpp" 21 22 #include <set> 22 #include "LabelGenerator.hpp" 23 23 24 using namespace std; 24 25 using namespace ast; -
src/ControlStruct/module.mk
r5ddb8bf r81da3da4 16 16 17 17 SRC += \ 18 ControlStruct/ExceptDecl New.cpp \18 ControlStruct/ExceptDecl.cpp \ 19 19 ControlStruct/ExceptDecl.h \ 20 ControlStruct/ExceptTranslate New.cpp \20 ControlStruct/ExceptTranslate.cpp \ 21 21 ControlStruct/ExceptTranslate.h \ 22 22 ControlStruct/FixLabels.cpp \ … … 24 24 ControlStruct/HoistControlDecls.cpp \ 25 25 ControlStruct/HoistControlDecls.hpp \ 26 ControlStruct/LabelGenerator New.cpp \27 ControlStruct/LabelGenerator New.hpp \26 ControlStruct/LabelGenerator.cpp \ 27 ControlStruct/LabelGenerator.hpp \ 28 28 ControlStruct/MultiLevelExit.cpp \ 29 29 ControlStruct/MultiLevelExit.hpp -
src/GenPoly/Box.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Box New.cpp -- Implement polymorphic function calls and types.7 // Box.cpp -- Implement polymorphic function calls and types. 8 8 // 9 9 // Author : Andrew Beach … … 32 32 #include "GenPoly/Lvalue.h" // for generalizedLvalue 33 33 #include "GenPoly/ScopedSet.h" // for ScopedSet 34 #include "GenPoly/ScrubTy Vars.h"// for scrubTypeVars, scrubAllTypeVars34 #include "GenPoly/ScrubTypeVars.hpp" // for scrubTypeVars, scrubAllTypeVars 35 35 #include "ResolvExpr/Unify.h" // for typesCompatible 36 36 #include "SymTab/Mangler.h" // for mangle, mangleType … … 39 39 40 40 namespace { 41 42 /// The layout type is used to represent sizes, alignments and offsets. 43 ast::BasicType * makeLayoutType() { 44 return new ast::BasicType( ast::BasicType::LongUnsignedInt ); 45 } 46 47 /// Fixed version of layout type (just adding a 'C' in C++ style). 48 ast::BasicType * makeLayoutCType() { 49 return new ast::BasicType( ast::BasicType::LongUnsignedInt, 50 ast::CV::Qualifiers( ast::CV::Const ) ); 51 } 41 52 42 53 // -------------------------------------------------------------------------- … … 60 71 } 61 72 return sizedParams; 62 }63 64 ast::BasicType * makeSizeAlignType() {65 return new ast::BasicType( ast::BasicType::LongUnsignedInt );66 73 } 67 74 … … 76 83 sizedParam->location, 77 84 sizeofName( paramName ), 78 make SizeAlignType()85 makeLayoutCType() 79 86 ) ); 80 87 params.emplace_back( new ast::ObjectDecl( 81 88 sizedParam->location, 82 89 alignofName( paramName ), 83 make SizeAlignType()90 makeLayoutCType() 84 91 ) ); 85 92 } 86 93 } 87 94 88 ast::Type * make SizeAlignOutType() {89 return new ast::PointerType( make SizeAlignType() );95 ast::Type * makeLayoutOutType() { 96 return new ast::PointerType( makeLayoutType() ); 90 97 } 91 98 … … 104 111 location, 105 112 sizeofName( aggr->name ), 106 make SizeAlignOutType()113 makeLayoutOutType() 107 114 ); 108 115 ast::ObjectDecl * alignParam = new ast::ObjectDecl( 109 116 location, 110 117 alignofName( aggr->name ), 111 make SizeAlignOutType()118 makeLayoutOutType() 112 119 ); 113 120 ast::ObjectDecl * offsetParam = nullptr; … … 117 124 location, 118 125 offsetofName( aggr->name ), 119 make SizeAlignOutType()126 makeLayoutOutType() 120 127 ); 121 128 params.push_back( offsetParam ); … … 1372 1379 }; 1373 1380 1374 // size/align/offset parameters may not be used, so add the unused attribute.1375 1381 ast::ObjectDecl * makeObj( 1376 1382 CodeLocation const & location, std::string const & name ) { 1383 // The size/align parameters may be unused, so add the unused attribute. 1377 1384 return new ast::ObjectDecl( location, name, 1378 make SizeAlignType(),1385 makeLayoutCType(), 1379 1386 nullptr, ast::Storage::Classes(), ast::Linkage::C, nullptr, 1380 1387 { new ast::Attribute( "unused" ) } ); 1388 } 1389 1390 /// A modified and specialized version of ast::add_qualifiers. 1391 ast::Type const * addConst( ast::Type const * type ) { 1392 ast::CV::Qualifiers cvq = { ast::CV::Const }; 1393 if ( ( type->qualifiers & cvq ) != 0 ) return type; 1394 auto mutType = ast::mutate( type ); 1395 mutType->qualifiers |= cvq; 1396 return mutType; 1381 1397 } 1382 1398 … … 1418 1434 } 1419 1435 for ( ast::ptr<ast::DeclWithType> & assert : mutDecl->assertions ) { 1436 ast::DeclWithType * mutAssert = ast::mutate( assert.get() ); 1420 1437 // Assertion parameters may not be used in body, 1421 1438 // pass along with unused attribute. 1422 assert.get_and_mutate()->attributes.push_back(1423 new ast::Attribute( "unused") );1424 inferredParams. push_back( assert );1439 mutAssert->attributes.push_back( new ast::Attribute( "unused" ) ); 1440 mutAssert->set_type( addConst( mutAssert->get_type() ) ); 1441 inferredParams.emplace_back( mutAssert ); 1425 1442 } 1426 1443 mutDecl->assertions.clear(); … … 1609 1626 1610 1627 /// Converts polymorphic type into a suitable monomorphic representation. 1611 /// Currently: __attribute__(( aligned(8) )) char[size_T];1628 /// Currently: __attribute__(( aligned(8) )) char[size_T]; 1612 1629 ast::Type * polyToMonoType( CodeLocation const & location, 1613 1630 ast::Type const * declType ) { … … 1615 1632 auto size = new ast::NameExpr( location, 1616 1633 sizeofName( Mangle::mangleType( declType ) ) ); 1617 auto aligned = new ast::Attribute( "aligned",1618 { ast::ConstantExpr::from_int( location, 8 ) } );1619 1634 auto ret = new ast::ArrayType( charType, size, 1620 1635 ast::VariableLen, ast::DynamicDim, ast::CV::Qualifiers() ); 1621 ret->attributes.push_back( aligned ); 1636 ret->attributes.emplace_back( new ast::Attribute( "aligned", 1637 { ast::ConstantExpr::from_int( location, 8 ) } ) ); 1622 1638 return ret; 1623 1639 } … … 1645 1661 ast::TypeInstType inst( decl->name, decl ); 1646 1662 std::string typeName = Mangle::mangleType( &inst ); 1647 ast::Type * layoutType = new ast::BasicType(1648 ast::BasicType::LongUnsignedInt );1649 1663 1650 1664 ast::ObjectDecl * sizeDecl = new ast::ObjectDecl( decl->location, 1651 sizeofName( typeName ), layoutType,1665 sizeofName( typeName ), makeLayoutCType(), 1652 1666 new ast::SingleInit( decl->location, 1653 1667 new ast::SizeofExpr( decl->location, deepCopy( base ) ) … … 1655 1669 ); 1656 1670 ast::ObjectDecl * alignDecl = new ast::ObjectDecl( decl->location, 1657 alignofName( typeName ), layoutType,1671 alignofName( typeName ), makeLayoutCType(), 1658 1672 new ast::SingleInit( decl->location, 1659 1673 new ast::AlignofExpr( decl->location, deepCopy( base ) ) … … 1752 1766 long findMember( ast::DeclWithType const * memberDecl, 1753 1767 const ast::vector<ast::Decl> & baseDecls ) { 1754 for ( auto pair: enumerate( baseDecls ) ) {1755 if ( isMember( memberDecl, pair.val.get() ) ) {1756 return pair.idx;1768 for ( auto const & [index, value] : enumerate( baseDecls ) ) { 1769 if ( isMember( memberDecl, value.get() ) ) { 1770 return index; 1757 1771 } 1758 1772 } … … 1912 1926 knownOffsets.insert( offsetName ); 1913 1927 1914 auto baseMembers = type->base->members;1915 ast::Type const * offsetType = new ast::BasicType(1916 ast::BasicType::LongUnsignedInt );1917 1918 1928 // Build initializer list for offset array. 1919 1929 ast::vector<ast::Init> inits; 1920 for ( ast::ptr<ast::Decl> & member : baseMembers ) {1930 for ( ast::ptr<ast::Decl> const & member : type->base->members ) { 1921 1931 auto memberDecl = member.as<ast::DeclWithType>(); 1922 1932 assertf( memberDecl, "Requesting offset of non-DWT member: %s", … … 1932 1942 auto offsetArray = makeVar( expr->location, offsetName, 1933 1943 new ast::ArrayType( 1934 offsetType,1935 ast::ConstantExpr::from_ulong( expr->location, baseMembers.size() ),1944 makeLayoutType(), 1945 ast::ConstantExpr::from_ulong( expr->location, inits.size() ), 1936 1946 ast::FixedLen, 1937 1947 ast::DynamicDim … … 2012 2022 // parameters to the layout call. 2013 2023 knownLayouts.insert( typeName ); 2014 ast::Type const * layoutType = makeSizeAlignType();2015 2024 2016 2025 int memberCount = inst->base->members.size(); … … 2018 2027 // All empty structures have the same layout (size 1, align 1). 2019 2028 makeVar( location, 2020 sizeofName( typeName ), layoutType,2029 sizeofName( typeName ), makeLayoutType(), 2021 2030 new ast::SingleInit( location, 2022 2031 ast::ConstantExpr::from_ulong( location, 1 ) ) ); 2023 2032 makeVar( location, 2024 alignofName( typeName ), ast::deepCopy( layoutType),2033 alignofName( typeName ), makeLayoutType(), 2025 2034 new ast::SingleInit( location, 2026 2035 ast::ConstantExpr::from_ulong( location, 1 ) ) ); … … 2028 2037 } else { 2029 2038 ast::ObjectDecl const * sizeofVar = makeVar( location, 2030 sizeofName( typeName ), deepCopy( layoutType), nullptr );2039 sizeofName( typeName ), makeLayoutType(), nullptr ); 2031 2040 ast::ObjectDecl const * alignofVar = makeVar( location, 2032 alignofName( typeName ), deepCopy( layoutType), nullptr );2041 alignofName( typeName ), makeLayoutType(), nullptr ); 2033 2042 ast::ObjectDecl const * offsetofVar = makeVar( location, 2034 2043 offsetofName( typeName ), 2035 2044 new ast::ArrayType( 2036 layoutType,2045 makeLayoutType(), 2037 2046 ast::ConstantExpr::from_int( location, memberCount ), 2038 2047 ast::FixedLen, … … 2078 2087 // parameters to the layout call. 2079 2088 knownLayouts.insert( typeName ); 2080 ast::Type const * layoutType = makeSizeAlignType();2081 2089 2082 2090 ast::ObjectDecl * sizeofVar = makeVar( location, 2083 sizeofName( typeName ), layoutType);2091 sizeofName( typeName ), makeLayoutType() ); 2084 2092 ast::ObjectDecl * alignofVar = makeVar( location, 2085 alignofName( typeName ), ast::deepCopy( layoutType) );2093 alignofName( typeName ), makeLayoutType() ); 2086 2094 2087 2095 ast::UntypedExpr * layoutCall = new ast::UntypedExpr( location, -
src/GenPoly/FindFunction.cc
r5ddb8bf r81da3da4 22 22 #include "GenPoly/ErasableScopedMap.h" // for ErasableScopedMap<>::iterator 23 23 #include "GenPoly/GenPoly.h" // for TyVarMap 24 #include "ScrubTy Vars.h" // for ScrubTyVars24 #include "ScrubTypeVars.hpp" // for scrubTypeVars 25 25 26 26 namespace GenPoly { -
src/GenPoly/InstantiateGeneric.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // InstantiateGeneric New.cpp -- Create concrete instances of generic types.7 // InstantiateGeneric.cpp -- Create concrete instances of generic types. 8 8 // 9 9 // Author : Andrew Beach … … 31 31 #include "Common/UniqueName.h" // for UniqueName 32 32 #include "GenPoly/GenPoly.h" // for isPolyType, typesPolyCompatible 33 #include "GenPoly/ScrubTy Vars.h" // for scrubAll33 #include "GenPoly/ScrubTypeVars.hpp" // for scrubAllTypeVars 34 34 #include "ResolvExpr/AdjustExprType.hpp" // for adjustExprType 35 35 #include "ResolvExpr/Unify.h" // for typesCompatible -
src/GenPoly/Lvalue.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Lvalue New.cpp -- Clean up lvalues and remove references.7 // Lvalue.cpp -- Clean up lvalues and remove references. 8 8 // 9 9 // Author : Andrew Beach -
src/GenPoly/ScrubTypeVars.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ScrubTy Vars.cc-- Remove polymorphic types.7 // ScrubTypeVars.cpp -- Remove polymorphic types. 8 8 // 9 9 // Author : Richard C. Bilson … … 14 14 // 15 15 16 #include "ScrubTypeVars.hpp" 17 16 18 #include <utility> // for pair 17 19 … … 19 21 #include "GenPoly.h" // for mangleType, TyVarMap, alignof... 20 22 #include "GenPoly/ErasableScopedMap.h" // for ErasableScopedMap<>::const_it... 21 #include "ScrubTyVars.h"22 23 #include "SymTab/Mangler.h" // for mangleType 23 24 -
src/GenPoly/ScrubTypeVars.hpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ScrubTy Vars.h-- Remove polymorphic types.7 // ScrubTypeVars.hpp -- Remove polymorphic types. 8 8 // 9 9 // Author : Richard C. Bilson … … 16 16 #pragma once 17 17 18 #include <cassert> // for assert18 #include <cassert> // for strict_dynamic_cast 19 19 20 20 #include "AST/Fwd.hpp" // for Node 21 #include "GenPoly.h" // for TypeVarMap , isPolyType, isDynType21 #include "GenPoly.h" // for TypeVarMap 22 22 23 23 namespace GenPoly { -
src/GenPoly/Specialize.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Specialize New.cpp -- Generate thunks to specialize polymorphic functions.7 // Specialize.cpp -- Generate thunks to specialize polymorphic functions. 8 8 // 9 9 // Author : Andrew Beach -
src/GenPoly/module.mk
r5ddb8bf r81da3da4 22 22 23 23 SRC += $(SRC_GENPOLY) \ 24 GenPoly/Box New.cpp \24 GenPoly/Box.cpp \ 25 25 GenPoly/Box.h \ 26 26 GenPoly/ErasableScopedMap.h \ 27 27 GenPoly/FindFunction.cc \ 28 28 GenPoly/FindFunction.h \ 29 GenPoly/InstantiateGeneric New.cpp \29 GenPoly/InstantiateGeneric.cpp \ 30 30 GenPoly/InstantiateGeneric.h \ 31 GenPoly/Lvalue New.cpp \31 GenPoly/Lvalue.cpp \ 32 32 GenPoly/ScopedSet.h \ 33 GenPoly/ScrubTy Vars.cc\34 GenPoly/ScrubTy Vars.h\35 GenPoly/Specialize New.cpp \33 GenPoly/ScrubTypeVars.cpp \ 34 GenPoly/ScrubTypeVars.hpp \ 35 GenPoly/Specialize.cpp \ 36 36 GenPoly/Specialize.h 37 37 -
src/InitTweak/FixGlobalInit.cc
r5ddb8bf r81da3da4 84 84 if (inLibrary) ctorParams.emplace_back(ast::ConstantExpr::from_int(location, 200)); 85 85 auto initFunction = new ast::FunctionDecl(location, 86 "__global_init__", {}, {}, {}, 86 "__global_init__", {}, {}, {}, {}, 87 87 new ast::CompoundStmt(location, std::move(fixer.core.initStmts)), 88 88 ast::Storage::Static, ast::Linkage::C, … … 96 96 if (inLibrary) dtorParams.emplace_back(ast::ConstantExpr::from_int(location, 200)); 97 97 auto destroyFunction = new ast::FunctionDecl( location, 98 "__global_destroy__", {}, {}, {}, 98 "__global_destroy__", {}, {}, {}, {}, 99 99 new ast::CompoundStmt(location, std::move(fixer.core.destroyStmts)), 100 100 ast::Storage::Static, ast::Linkage::C, -
src/InitTweak/FixInit.cpp
r5ddb8bf r81da3da4 74 74 fname, 75 75 std::move(typeParams), 76 {}, 76 77 {dstParam}, 77 78 {}, … … 899 900 900 901 // void __objName_dtor_atexitN(...) {...} 901 ast::FunctionDecl * dtorCaller = new ast::FunctionDecl(loc, objDecl->mangleName + dtorCallerNamer.newName(), {}, {}, {}, new ast::CompoundStmt(loc, {dtor}), ast::Storage::Static, ast::Linkage::C );902 ast::FunctionDecl * dtorCaller = new ast::FunctionDecl(loc, objDecl->mangleName + dtorCallerNamer.newName(), {}, {}, {}, {}, new ast::CompoundStmt(loc, {dtor}), ast::Storage::Static, ast::Linkage::C ); 902 903 dtorCaller->fixUniqueId(); 903 904 // dtorCaller->stmts->push_back( dtor ); -
src/InitTweak/InitTweak.cc
r5ddb8bf r81da3da4 342 342 if (!assign) { 343 343 auto td = new ast::TypeDecl(CodeLocation(), "T", {}, nullptr, ast::TypeDecl::Dtype, true); 344 assign = new ast::FunctionDecl(CodeLocation(), "?=?", {td}, 344 assign = new ast::FunctionDecl(CodeLocation(), "?=?", {td}, {}, 345 345 { new ast::ObjectDecl(CodeLocation(), "_dst", new ast::ReferenceType(new ast::TypeInstType("T", td))), 346 346 new ast::ObjectDecl(CodeLocation(), "_src", new ast::TypeInstType("T", td))}, -
src/InitTweak/module.mk
r5ddb8bf r81da3da4 24 24 InitTweak/FixGlobalInit.cc \ 25 25 InitTweak/FixGlobalInit.h \ 26 InitTweak/FixInit. h\27 InitTweak/FixInit New.cpp26 InitTweak/FixInit.cpp \ 27 InitTweak/FixInit.h 28 28 29 29 SRCDEMANGLE += $(SRC_INITTWEAK) -
src/MakeLibCfa.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // MakeLibCfa New.cpp --7 // MakeLibCfa.cpp -- 8 8 // 9 9 // Author : Henry Xue -
src/Makefile.am
r5ddb8bf r81da3da4 22 22 CompilationState.cc \ 23 23 CompilationState.h \ 24 MakeLibCfa New.cpp \24 MakeLibCfa.cpp \ 25 25 MakeLibCfa.h 26 26 … … 72 72 73 73 cfa_cpplib_PROGRAMS += $(DEMANGLER) 74 EXTRA_PROGRAMS = demangler75 demangler_SOURCES = SymTab/demangler.cc # test driver for the demangler, also useful as a sanity check that libdemangle.a is complete76 demangler_LDADD = libdemangle.a -ldl # yywrap74 EXTRA_PROGRAMS = ../driver/demangler 75 ___driver_demangler_SOURCES = SymTab/demangler.cc # test driver for the demangler, also useful as a sanity check that libdemangle.a is complete 76 ___driver_demangler_LDADD = libdemangle.a -ldl # yywrap 77 77 noinst_LIBRARIES = $(LIBDEMANGLE) 78 78 EXTRA_LIBRARIES = libdemangle.a -
src/Parser/ParseNode.h
r5ddb8bf r81da3da4 33 33 #include "Parser/parserutility.h" // for maybeBuild, maybeCopy 34 34 35 class Attribute;36 class Declaration;37 35 struct DeclarationNode; 38 class DeclarationWithType;39 class Initializer;40 36 class InitializerNode; 41 37 class ExpressionNode; -
src/Parser/TypeData.h
r5ddb8bf r81da3da4 133 133 ast::Init * init = nullptr, std::vector<ast::ptr<ast::Attribute>> && attributes = std::vector<ast::ptr<ast::Attribute>>() ); 134 134 ast::FunctionType * buildFunctionType( const TypeData * ); 135 ast::Decl * addEnumBase( Declaration *, const TypeData * );136 135 void buildKRFunction( const TypeData::Function_t & function ); 137 136 -
src/ResolvExpr/CandidateFinder.cpp
r5ddb8bf r81da3da4 105 105 106 106 // CandidateFinder finder{ symtab, env }; 107 // finder.find( arg, Resolv Mode::withAdjustment() );107 // finder.find( arg, ResolveMode::withAdjustment() ); 108 108 // assertf( finder.candidates.size() > 0, 109 109 // "Somehow castable expression failed to find alternatives." ); … … 974 974 // xxx - is it possible that handleTupleAssignment and main finder both produce candidates? 975 975 // this means there exists ctor/assign functions with a tuple as first parameter. 976 Resolv Mode mode = {976 ResolveMode mode = { 977 977 true, // adjust 978 978 !untypedExpr->func.as<ast::NameExpr>(), // prune if not calling by name … … 989 989 CandidateFinder opFinder( context, tenv ); 990 990 // okay if there aren't any function operations 991 opFinder.find( opExpr, Resolv Mode::withoutFailFast() );991 opFinder.find( opExpr, ResolveMode::withoutFailFast() ); 992 992 PRINT( 993 993 std::cerr << "known function ops:" << std::endl; … … 1175 1175 if ( castExpr->kind == ast::CastExpr::Return ) { 1176 1176 finder.strictMode = true; 1177 finder.find( castExpr->arg, Resolv Mode::withAdjustment() );1177 finder.find( castExpr->arg, ResolveMode::withAdjustment() ); 1178 1178 1179 1179 // return casts are eliminated (merely selecting an overload, no actual operation) 1180 1180 candidates = std::move(finder.candidates); 1181 1181 } 1182 finder.find( castExpr->arg, Resolv Mode::withAdjustment() );1182 finder.find( castExpr->arg, ResolveMode::withAdjustment() ); 1183 1183 1184 1184 if ( !finder.candidates.empty() ) reason.code = NoMatch; … … 1251 1251 CandidateFinder finder( context, tenv ); 1252 1252 // don't prune here, all alternatives guaranteed to have same type 1253 finder.find( castExpr->arg, Resolv Mode::withoutPrune() );1253 finder.find( castExpr->arg, ResolveMode::withoutPrune() ); 1254 1254 for ( CandidateRef & r : finder.candidates ) { 1255 1255 addCandidate( … … 1298 1298 1299 1299 // don't prune here, since it's guaranteed all alternatives will have the same type 1300 finder.find( tech1.get(), Resolv Mode::withoutPrune() );1300 finder.find( tech1.get(), ResolveMode::withoutPrune() ); 1301 1301 pick_alternatives(finder.candidates, false); 1302 1302 … … 1307 1307 std::unique_ptr<const ast::Expr> fallback { ast::UntypedExpr::createDeref(loc, new ast::UntypedExpr(loc, new ast::NameExpr(loc, castExpr->concrete_target.getter), { castExpr->arg })) }; 1308 1308 // don't prune here, since it's guaranteed all alternatives will have the same type 1309 finder.find( fallback.get(), Resolv Mode::withoutPrune() );1309 finder.find( fallback.get(), ResolveMode::withoutPrune() ); 1310 1310 1311 1311 pick_alternatives(finder.candidates, true); … … 1316 1316 void Finder::postvisit( const ast::UntypedMemberExpr * memberExpr ) { 1317 1317 CandidateFinder aggFinder( context, tenv ); 1318 aggFinder.find( memberExpr->aggregate, Resolv Mode::withAdjustment() );1318 aggFinder.find( memberExpr->aggregate, ResolveMode::withAdjustment() ); 1319 1319 for ( CandidateRef & agg : aggFinder.candidates ) { 1320 1320 // it's okay for the aggregate expression to have reference type -- cast it to the … … 1475 1475 void Finder::postvisit( const ast::LogicalExpr * logicalExpr ) { 1476 1476 CandidateFinder finder1( context, tenv ); 1477 finder1.find( logicalExpr->arg1, Resolv Mode::withAdjustment() );1477 finder1.find( logicalExpr->arg1, ResolveMode::withAdjustment() ); 1478 1478 if ( finder1.candidates.empty() ) return; 1479 1479 1480 1480 CandidateFinder finder2( context, tenv ); 1481 finder2.find( logicalExpr->arg2, Resolv Mode::withAdjustment() );1481 finder2.find( logicalExpr->arg2, ResolveMode::withAdjustment() ); 1482 1482 if ( finder2.candidates.empty() ) return; 1483 1483 … … 1505 1505 // candidates for condition 1506 1506 CandidateFinder finder1( context, tenv ); 1507 finder1.find( conditionalExpr->arg1, Resolv Mode::withAdjustment() );1507 finder1.find( conditionalExpr->arg1, ResolveMode::withAdjustment() ); 1508 1508 if ( finder1.candidates.empty() ) return; 1509 1509 … … 1511 1511 CandidateFinder finder2( context, tenv ); 1512 1512 finder2.allowVoid = true; 1513 finder2.find( conditionalExpr->arg2, Resolv Mode::withAdjustment() );1513 finder2.find( conditionalExpr->arg2, ResolveMode::withAdjustment() ); 1514 1514 if ( finder2.candidates.empty() ) return; 1515 1515 … … 1517 1517 CandidateFinder finder3( context, tenv ); 1518 1518 finder3.allowVoid = true; 1519 finder3.find( conditionalExpr->arg3, Resolv Mode::withAdjustment() );1519 finder3.find( conditionalExpr->arg3, ResolveMode::withAdjustment() ); 1520 1520 if ( finder3.candidates.empty() ) return; 1521 1521 … … 1570 1570 1571 1571 CandidateFinder finder2( context, env ); 1572 finder2.find( commaExpr->arg2, Resolv Mode::withAdjustment() );1572 finder2.find( commaExpr->arg2, ResolveMode::withAdjustment() ); 1573 1573 1574 1574 for ( const CandidateRef & r2 : finder2.candidates ) { … … 1584 1584 CandidateFinder finder( context, tenv ); 1585 1585 finder.allowVoid = true; 1586 finder.find( ctorExpr->callExpr, Resolv Mode::withoutPrune() );1586 finder.find( ctorExpr->callExpr, ResolveMode::withoutPrune() ); 1587 1587 for ( CandidateRef & r : finder.candidates ) { 1588 1588 addCandidate( *r, new ast::ConstructorExpr{ ctorExpr->location, r->expr } ); … … 1593 1593 // resolve low and high, accept candidates where low and high types unify 1594 1594 CandidateFinder finder1( context, tenv ); 1595 finder1.find( rangeExpr->low, Resolv Mode::withAdjustment() );1595 finder1.find( rangeExpr->low, ResolveMode::withAdjustment() ); 1596 1596 if ( finder1.candidates.empty() ) return; 1597 1597 1598 1598 CandidateFinder finder2( context, tenv ); 1599 finder2.find( rangeExpr->high, Resolv Mode::withAdjustment() );1599 finder2.find( rangeExpr->high, ResolveMode::withAdjustment() ); 1600 1600 if ( finder2.candidates.empty() ) return; 1601 1601 … … 1673 1673 void Finder::postvisit( const ast::UniqueExpr * unqExpr ) { 1674 1674 CandidateFinder finder( context, tenv ); 1675 finder.find( unqExpr->expr, Resolv Mode::withAdjustment() );1675 finder.find( unqExpr->expr, ResolveMode::withAdjustment() ); 1676 1676 for ( CandidateRef & r : finder.candidates ) { 1677 1677 // ensure that the the id is passed on so that the expressions are "linked" … … 1699 1699 // only open for the duration of resolving the UntypedExpr. 1700 1700 CandidateFinder finder( context, tenv, toType ); 1701 finder.find( initExpr->expr, Resolv Mode::withAdjustment() );1701 finder.find( initExpr->expr, ResolveMode::withAdjustment() ); 1702 1702 1703 1703 Cost minExprCost = Cost::infinity; … … 1889 1889 } 1890 1890 1891 void CandidateFinder::find( const ast::Expr * expr, Resolv Mode mode ) {1891 void CandidateFinder::find( const ast::Expr * expr, ResolveMode mode ) { 1892 1892 // Find alternatives for expression 1893 1893 ast::Pass<Finder> finder{ *this }; … … 2004 2004 for ( const auto & x : xs ) { 2005 2005 out.emplace_back( context, env ); 2006 out.back().find( x, Resolv Mode::withAdjustment() );2006 out.back().find( x, ResolveMode::withAdjustment() ); 2007 2007 2008 2008 PRINT( -
src/ResolvExpr/CandidateFinder.hpp
r5ddb8bf r81da3da4 17 17 18 18 #include "Candidate.hpp" 19 #include "Resolv Mode.h"19 #include "ResolveMode.hpp" 20 20 #include "AST/Fwd.hpp" 21 21 #include "AST/Node.hpp" … … 43 43 44 44 /// Fill candidates with feasible resolutions for `expr` 45 void find( const ast::Expr * expr, Resolv Mode mode = {} );45 void find( const ast::Expr * expr, ResolveMode mode = {} ); 46 46 bool pruneCandidates( CandidateList & candidates, CandidateList & out, std::vector<std::string> & errors ); 47 47 -
src/ResolvExpr/CandidatePrinter.cpp
r5ddb8bf r81da3da4 16 16 #include "CandidatePrinter.hpp" 17 17 18 #include <iostream> 19 18 20 #include "AST/Expr.hpp" 19 21 #include "AST/Pass.hpp" … … 23 25 #include "ResolvExpr/CandidateFinder.hpp" 24 26 #include "ResolvExpr/Resolver.h" 25 26 #include <iostream>27 27 28 28 namespace ResolvExpr { … … 39 39 ast::TypeEnvironment env; 40 40 CandidateFinder finder( { symtab, transUnit().global }, env ); 41 finder.find( stmt->expr, Resolv Mode::withAdjustment() );41 finder.find( stmt->expr, ResolveMode::withAdjustment() ); 42 42 int count = 1; 43 43 os << "There are " << finder.candidates.size() << " candidates\n"; -
src/ResolvExpr/CurrentObject.cc
r5ddb8bf r81da3da4 498 498 PRINT( std::cerr << "____untyped: " << expr << std::endl; ) 499 499 auto dit = desigAlts.begin(); 500 auto nexpr = dynamic_cast< const NameExpr * >( expr ); 500 501 501 502 for ( const Type * t : curTypes ) { 502 503 assert( dit != desigAlts.end() ); 503 504 DesignatorChain & d = *dit; 504 if ( auto nexpr = dynamic_cast< const NameExpr *>( expr ) ) { 505 // Name Designation: 506 if ( nexpr ) { 505 507 PRINT( std::cerr << "____actual: " << t << std::endl; ) 506 508 if ( auto refType = dynamic_cast< const BaseInstType * >( t ) ) { … … 515 517 } 516 518 } 517 } else if ( auto at = dynamic_cast< const ArrayType * >( t ) ) {518 auto nexpr = dynamic_cast< const NameExpr *>( expr );519 for ( const Decl * mem : refType->lookup( nexpr->name ) ) {520 if ( auto field = dynamic_cast< const ObjectDecl * >( mem ) ) {521 DesignatorChain d2 = d;522 d2.emplace_back( new VariableExpr{ expr->location, field } );523 newDesigAlts.emplace_back( std::move( d2 ) );524 newTypes.emplace_back( at->base );525 }526 }527 519 } 528 520 529 521 ++dit; 522 // Index Designation: 530 523 } else { 531 524 if ( auto at = dynamic_cast< const ArrayType * >( t ) ) { -
src/ResolvExpr/ResolveMode.hpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Resolv Mode.h--7 // ResolveMode.hpp -- 8 8 // 9 9 // Author : Aaron B. Moss … … 19 19 20 20 /// Flag set for resolution 21 struct Resolv Mode {21 struct ResolveMode { 22 22 const bool adjust; ///< Adjust array and function types to pointer types? [false] 23 23 const bool prune; ///< Prune alternatives to min-cost per return type? [true] 24 24 const bool failFast; ///< Fail on no resulting alternatives? [true] 25 25 26 constexpr Resolv Mode(bool a, bool p, bool ff)26 constexpr ResolveMode(bool a, bool p, bool ff) 27 27 : adjust(a), prune(p), failFast(ff) {} 28 28 29 29 /// Default settings 30 constexpr Resolv Mode() : adjust(false), prune(true), failFast(true) {}30 constexpr ResolveMode() : adjust(false), prune(true), failFast(true) {} 31 31 32 32 /// With adjust flag set; turns array and function types into equivalent pointers 33 static constexpr Resolv Mode withAdjustment() { return { true, true, true }; }33 static constexpr ResolveMode withAdjustment() { return { true, true, true }; } 34 34 35 35 /// With adjust flag set but prune unset; pruning ensures there is at least one alternative 36 36 /// per result type 37 static constexpr Resolv Mode withoutPrune() { return { true, false, true }; }37 static constexpr ResolveMode withoutPrune() { return { true, false, true }; } 38 38 39 39 /// With adjust and prune flags set but failFast unset; failFast ensures there is at least 40 40 /// one resulting alternative 41 static constexpr Resolv Mode withoutFailFast() { return { true, true, false }; }41 static constexpr ResolveMode withoutFailFast() { return { true, true, false }; } 42 42 43 43 /// The same mode, but with satisfyAssns turned on; for top-level calls 44 Resolv Mode atTopLevel() const { return { adjust, true, failFast }; }44 ResolveMode atTopLevel() const { return { adjust, true, failFast }; } 45 45 }; 46 46 -
src/ResolvExpr/Resolver.cc
r5ddb8bf r81da3da4 25 25 #include "Resolver.h" 26 26 #include "ResolveTypeof.h" 27 #include "Resolv Mode.h" // for ResolvMode27 #include "ResolveMode.hpp" // for ResolveMode 28 28 #include "typeops.h" // for extractResultType 29 29 #include "Unify.h" // for unify 30 30 #include "CompilationState.h" 31 #include "AST/Chain.hpp"32 31 #include "AST/Decl.hpp" 33 32 #include "AST/Init.hpp" … … 104 103 } 105 104 } 106 } 107 } 105 } 106 } 108 107 visit_children = false; 109 108 } … … 123 122 CandidateRef findUnfinishedKindExpression( 124 123 const ast::Expr * untyped, const ResolveContext & context, const std::string & kind, 125 std::function<bool(const Candidate &)> pred = anyCandidate, Resolv Mode mode = {}124 std::function<bool(const Candidate &)> pred = anyCandidate, ResolveMode mode = {} 126 125 ) { 127 126 if ( ! untyped ) return nullptr; … … 263 262 ast::ptr< ast::CastExpr > untyped = new ast::CastExpr{ expr }; 264 263 CandidateRef choice = findUnfinishedKindExpression( 265 untyped, context, "", anyCandidate, Resolv Mode::withAdjustment() );264 untyped, context, "", anyCandidate, ResolveMode::withAdjustment() ); 266 265 267 266 // a cast expression has either 0 or 1 interpretations (by language rules); … … 292 291 const ast::Expr * untyped, const ResolveContext & context, 293 292 std::function<bool(const Candidate &)> pred = anyCandidate, 294 const std::string & kind = "", Resolv Mode mode = {}293 const std::string & kind = "", ResolveMode mode = {} 295 294 ) { 296 295 if ( ! untyped ) return {}; … … 607 606 ( objectDecl->get_type() )->base->base ) { 608 607 objectDecl = fixObjectType( objectDecl, context ); 609 currentObject = ast::CurrentObject{ 610 objectDecl->location, 608 currentObject = ast::CurrentObject{ 609 objectDecl->location, 611 610 enumBase 612 611 }; … … 860 859 861 860 // Find all candidates for a function in canonical form 862 funcFinder.find( clause.target, Resolv Mode::withAdjustment() );861 funcFinder.find( clause.target, ResolveMode::withAdjustment() ); 863 862 864 863 if ( funcFinder.candidates.empty() ) { -
src/ResolvExpr/module.mk
r5ddb8bf r81da3da4 47 47 ResolvExpr/ResolveTypeof.cc \ 48 48 ResolvExpr/ResolveTypeof.h \ 49 ResolvExpr/Resolv Mode.h\49 ResolvExpr/ResolveMode.hpp \ 50 50 ResolvExpr/SatisfyAssertions.cpp \ 51 51 ResolvExpr/SatisfyAssertions.hpp \ -
src/Tuples/TupleAssignment.cc
r5ddb8bf r81da3da4 13 13 // Update Count : 10 14 14 // 15 16 #include "Tuples.h" 15 17 16 18 #include <algorithm> // for transform … … 224 226 // by the cast type as needed, and transfer the resulting environment. 225 227 ResolvExpr::CandidateFinder finder( spotter.crntFinder.context, env ); 226 finder.find( rhsCand->expr, ResolvExpr::Resolv Mode::withAdjustment() );228 finder.find( rhsCand->expr, ResolvExpr::ResolveMode::withAdjustment() ); 227 229 assert( 1 == finder.candidates.size() ); 228 230 env = std::move( finder.candidates.front()->env ); … … 345 347 346 348 try { 347 finder.find( expr, ResolvExpr::Resolv Mode::withAdjustment() );349 finder.find( expr, ResolvExpr::ResolveMode::withAdjustment() ); 348 350 } catch (...) { 349 351 // No match is not failure, just that this tuple assignment is invalid. -
src/Tuples/TupleExpansion.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // TupleExpansion New.cpp --7 // TupleExpansion.cpp -- 8 8 // 9 9 // Author : Henry Xue … … 294 294 } 295 295 296 const ast::Type * makeTupleType( const std::vector<ast::ptr<ast::Expr>> & exprs ) { 297 // If there are no expressions, the answer is set, otherwise go through a loop. 298 if ( exprs.empty() ) return new ast::TupleType( {} ); 299 300 std::vector<ast::ptr<ast::Type>> types; 301 ast::CV::Qualifiers quals( 302 ast::CV::Const | ast::CV::Volatile | ast::CV::Restrict | 303 ast::CV::Atomic | ast::CV::Mutex ); 304 305 for ( const ast::Expr * expr : exprs ) { 306 assert( expr->result ); 307 // If the type of any expr is void, the type of the entire tuple is void. 308 if ( expr->result->isVoid() ) return new ast::VoidType(); 309 310 // Qualifiers on the tuple type are the qualifiers that exist on all components. 311 quals &= expr->result->qualifiers; 312 313 types.emplace_back( expr->result ); 314 } 315 316 return new ast::TupleType( std::move( types ), quals ); 317 } 318 319 const ast::TypeInstType * isTtype( const ast::Type * type ) { 320 if ( const ast::TypeInstType * inst = dynamic_cast< const ast::TypeInstType * >( type ) ) { 321 if ( inst->base && inst->base->kind == ast::TypeDecl::Ttype ) { 322 return inst; 323 } 324 } 325 return nullptr; 326 } 327 296 328 } // namespace Tuples 329 -
src/Tuples/module.mk
r5ddb8bf r81da3da4 19 19 Tuples/Explode.h \ 20 20 Tuples/TupleAssignment.cc \ 21 Tuples/TupleExpansion.cc \ 22 Tuples/TupleExpansionNew.cpp \ 21 Tuples/TupleExpansion.cpp \ 23 22 Tuples/Tuples.cc \ 24 23 Tuples/Tuples.h -
src/Validate/FindSpecialDecls.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FindSpecialDecls New.cpp -- Find special declarations used in the compiler.7 // FindSpecialDecls.cpp -- Find special declarations used in the compiler. 8 8 // 9 9 // Author : Andrew Beach -
src/Validate/FixReturnTypes.cpp
r5ddb8bf r81da3da4 19 19 #include "AST/Pass.hpp" 20 20 #include "AST/Type.hpp" 21 #include "CodeGen/CodeGenerator New.hpp"21 #include "CodeGen/CodeGenerator.hpp" 22 22 #include "ResolvExpr/Unify.h" 23 24 namespace ast {25 class TranslationUnit;26 }27 23 28 24 namespace Validate { -
src/Validate/LinkInstanceTypes.cpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Link ReferenceToTypes.cpp -- Connect instance types to declarations.7 // LinkInstanceTypes.cpp -- Connect instance types to declarations. 8 8 // 9 9 // Author : Andrew Beach … … 14 14 // 15 15 16 #include "Validate/Link ReferenceToTypes.hpp"16 #include "Validate/LinkInstanceTypes.hpp" 17 17 18 18 #include "AST/Pass.hpp" … … 331 331 } // namespace 332 332 333 void link ReferenceToTypes( ast::TranslationUnit & translationUnit ) {333 void linkInstanceTypes( ast::TranslationUnit & translationUnit ) { 334 334 ast::Pass<LinkTypesCore>::run( translationUnit ); 335 335 } -
src/Validate/LinkInstanceTypes.hpp
r5ddb8bf r81da3da4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Link ReferenceToTypes.hpp -- Connect instance types to declarations.7 // LinkInstanceTypes.hpp -- Connect instance types to declarations. 8 8 // 9 9 // Author : Andrew Beach … … 25 25 /// adjustments, such as setting the sized flag. 26 26 /// Because of the sized flag, it must happen before auto-gen. 27 void link ReferenceToTypes( ast::TranslationUnit & translationUnit );27 void linkInstanceTypes( ast::TranslationUnit & translationUnit ); 28 28 29 29 } -
src/Validate/module.mk
r5ddb8bf r81da3da4 27 27 Validate/EnumAndPointerDecay.cpp \ 28 28 Validate/EnumAndPointerDecay.hpp \ 29 Validate/FindSpecialDecls New.cpp \29 Validate/FindSpecialDecls.cpp \ 30 30 Validate/FixQualifiedTypes.cpp \ 31 31 Validate/FixQualifiedTypes.hpp \ … … 44 44 Validate/LabelAddressFixer.cpp \ 45 45 Validate/LabelAddressFixer.hpp \ 46 Validate/Link ReferenceToTypes.cpp \47 Validate/Link ReferenceToTypes.hpp \46 Validate/LinkInstanceTypes.cpp \ 47 Validate/LinkInstanceTypes.hpp \ 48 48 Validate/NoIdSymbolTable.hpp \ 49 49 Validate/ReplaceTypedef.cpp \ -
src/Virtual/Tables.cc
r5ddb8bf r81da3da4 165 165 location, 166 166 functionName, 167 { /* forall */ },168 167 { new ast::ObjectDecl( 169 168 location, -
src/Virtual/VirtualDtor.cpp
r5ddb8bf r81da3da4 248 248 decl->location, 249 249 "__CFA_set_dtor", 250 {}, // forall251 250 { 252 251 new ObjectDecl( … … 320 319 decl->location, 321 320 "delete", 322 {}, // forall323 321 { 324 322 new ObjectDecl( -
src/include/cassert
r5ddb8bf r81da3da4 9 9 // Author : Peter A. Buhr 10 10 // Created On : Thu Aug 18 13:19:26 2016 11 // Last Modified By : Andrew Beach12 // Last Modified On : Mon Jun 3 13:11:00 201713 // Update Count : 1 811 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Nov 20 23:12:34 2023 13 // Update Count : 19 14 14 // 15 15 … … 53 53 } 54 54 55 extern void abort(const char *fmt, ... 55 extern void abort(const char *fmt, ... ) noexcept __attribute__((noreturn, format(printf, 1, 2))); 56 56 // Local Variables: // 57 57 // tab-width: 4 // -
src/main.cc
r5ddb8bf r81da3da4 78 78 #include "Validate/InitializerLength.hpp" // for setLengthFromInitializer 79 79 #include "Validate/LabelAddressFixer.hpp" // for fixLabelAddresses 80 #include "Validate/Link ReferenceToTypes.hpp" // for linkReferenceToTypes80 #include "Validate/LinkInstanceTypes.hpp" // for linkInstanceTypes 81 81 #include "Validate/ReplaceTypedef.hpp" // for replaceTypedef 82 82 #include "Validate/ReturnCheck.hpp" // for checkReturnStatements 83 83 #include "Validate/VerifyCtorDtorAssign.hpp" // for verifyCtorDtorAssign 84 84 #include "Virtual/ExpandCasts.h" // for expandCasts 85 #include "Virtual/VirtualDtor.hpp" 85 #include "Virtual/VirtualDtor.hpp" // for implementVirtDtors 86 86 87 87 using namespace std; … … 318 318 PASS( "Enum and Pointer Decay", Validate::decayEnumsAndPointers, transUnit ); 319 319 320 PASS( "Link Reference To Types", Validate::linkReferenceToTypes, transUnit );320 PASS( "Link Instance Types", Validate::linkInstanceTypes, transUnit ); 321 321 322 322 PASS( "Forall Pointer Decay", Validate::decayForallPointers, transUnit ); -
tests/.expect/PRNG.x64.txt
r5ddb8bf r81da3da4 26 26 27 27 Sequential 28 trials 10000000 0 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%28 trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0% 29 29 30 30 Concurrent 31 trials 10000000 0 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%32 trials 10000000 0 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%33 trials 10000000 0 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%34 trials 10000000 0 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%31 trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0% 32 trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0% 33 trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0% 34 trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0% 35 35 36 36 prng() prng(5) prng(0,5) … … 58 58 59 59 Sequential 60 trials 2000000 0 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%60 trials 2000000 buckets 100000 min 4 max 46 avg 20.0 std 4.5 rstd 22.3% 61 61 62 62 Concurrent 63 trials 2000000 0 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%64 trials 2000000 0 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%65 trials 2000000 0 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%66 trials 2000000 0 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%63 trials 2000000 buckets 100000 min 4 max 46 avg 20.0 std 4.5 rstd 22.3% 64 trials 2000000 buckets 100000 min 4 max 46 avg 20.0 std 4.5 rstd 22.3% 65 trials 2000000 buckets 100000 min 4 max 46 avg 20.0 std 4.5 rstd 22.3% 66 trials 2000000 buckets 100000 min 4 max 46 avg 20.0 std 4.5 rstd 22.3% 67 67 68 68 prng(t) prng(t,5) prng(t,0,5) … … 90 90 91 91 Sequential 92 trials 10000000 0 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%92 trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0% 93 93 94 94 Concurrent 95 trials 10000000 0 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%96 trials 10000000 0 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%97 trials 10000000 0 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%98 trials 10000000 0 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%95 trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0% 96 trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0% 97 trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0% 98 trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0% -
tests/.expect/PRNG.x86.txt
r5ddb8bf r81da3da4 26 26 27 27 Sequential 28 trials 10000000 0 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%28 trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0% 29 29 30 30 Concurrent 31 trials 10000000 0 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%32 trials 10000000 0 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%33 trials 10000000 0 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%34 trials 10000000 0 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%31 trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0% 32 trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0% 33 trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0% 34 trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0% 35 35 36 36 prng() prng(5) prng(0,5) … … 58 58 59 59 Sequential 60 trials 2000000 0 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%60 trials 2000000 buckets 100000 min 3 max 42 avg 20.0 std 4.5 rstd 22.4% 61 61 62 62 Concurrent 63 trials 2000000 0 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%64 trials 2000000 0 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%65 trials 2000000 0 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%66 trials 2000000 0 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%63 trials 2000000 buckets 100000 min 3 max 42 avg 20.0 std 4.5 rstd 22.4% 64 trials 2000000 buckets 100000 min 3 max 42 avg 20.0 std 4.5 rstd 22.4% 65 trials 2000000 buckets 100000 min 3 max 42 avg 20.0 std 4.5 rstd 22.4% 66 trials 2000000 buckets 100000 min 3 max 42 avg 20.0 std 4.5 rstd 22.4% 67 67 68 68 prng(t) prng(t,5) prng(t,0,5) … … 90 90 91 91 Sequential 92 trials 10000000 0 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%92 trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0% 93 93 94 94 Concurrent 95 trials 10000000 0 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%96 trials 10000000 0 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%97 trials 10000000 0 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%98 trials 10000000 0 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%95 trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0% 96 trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0% 97 trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0% 98 trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0% -
tests/.expect/functions.arm64.txt
r5ddb8bf r81da3da4 105 105 struct _tuple2_ { 106 106 }; 107 static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, unsigned long int _sizeof_Y15tuple_param_2_0, unsigned long int _alignof_Y15tuple_param_2_0, unsigned long int _sizeof_Y15tuple_param_2_1,unsigned long int _alignof_Y15tuple_param_2_1){107 static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, const unsigned long int _sizeof_Y15tuple_param_2_0, const unsigned long int _alignof_Y15tuple_param_2_0, const unsigned long int _sizeof_Y15tuple_param_2_1, const unsigned long int _alignof_Y15tuple_param_2_1){ 108 108 ((void)((*_sizeof__tuple2_)=0)); 109 109 ((void)((*_alignof__tuple2_)=1)); … … 136 136 struct _tuple3_ { 137 137 }; 138 static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, unsigned long int _sizeof_Y15tuple_param_3_0, unsigned long int _alignof_Y15tuple_param_3_0, unsigned long int _sizeof_Y15tuple_param_3_1, unsigned long int _alignof_Y15tuple_param_3_1, unsigned long int _sizeof_Y15tuple_param_3_2,unsigned long int _alignof_Y15tuple_param_3_2){138 static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, const unsigned long int _sizeof_Y15tuple_param_3_0, const unsigned long int _alignof_Y15tuple_param_3_0, const unsigned long int _sizeof_Y15tuple_param_3_1, const unsigned long int _alignof_Y15tuple_param_3_1, const unsigned long int _sizeof_Y15tuple_param_3_2, const unsigned long int _alignof_Y15tuple_param_3_2){ 139 139 ((void)((*_sizeof__tuple3_)=0)); 140 140 ((void)((*_alignof__tuple3_)=1)); -
tests/.expect/functions.x64.txt
r5ddb8bf r81da3da4 105 105 struct _tuple2_ { 106 106 }; 107 static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, unsigned long int _sizeof_Y15tuple_param_2_0, unsigned long int _alignof_Y15tuple_param_2_0, unsigned long int _sizeof_Y15tuple_param_2_1,unsigned long int _alignof_Y15tuple_param_2_1){107 static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, const unsigned long int _sizeof_Y15tuple_param_2_0, const unsigned long int _alignof_Y15tuple_param_2_0, const unsigned long int _sizeof_Y15tuple_param_2_1, const unsigned long int _alignof_Y15tuple_param_2_1){ 108 108 ((void)((*_sizeof__tuple2_)=0)); 109 109 ((void)((*_alignof__tuple2_)=1)); … … 136 136 struct _tuple3_ { 137 137 }; 138 static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, unsigned long int _sizeof_Y15tuple_param_3_0, unsigned long int _alignof_Y15tuple_param_3_0, unsigned long int _sizeof_Y15tuple_param_3_1, unsigned long int _alignof_Y15tuple_param_3_1, unsigned long int _sizeof_Y15tuple_param_3_2,unsigned long int _alignof_Y15tuple_param_3_2){138 static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, const unsigned long int _sizeof_Y15tuple_param_3_0, const unsigned long int _alignof_Y15tuple_param_3_0, const unsigned long int _sizeof_Y15tuple_param_3_1, const unsigned long int _alignof_Y15tuple_param_3_1, const unsigned long int _sizeof_Y15tuple_param_3_2, const unsigned long int _alignof_Y15tuple_param_3_2){ 139 139 ((void)((*_sizeof__tuple3_)=0)); 140 140 ((void)((*_alignof__tuple3_)=1)); -
tests/.expect/functions.x86.txt
r5ddb8bf r81da3da4 105 105 struct _tuple2_ { 106 106 }; 107 static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, unsigned long int _sizeof_Y15tuple_param_2_0, unsigned long int _alignof_Y15tuple_param_2_0, unsigned long int _sizeof_Y15tuple_param_2_1,unsigned long int _alignof_Y15tuple_param_2_1){107 static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, const unsigned long int _sizeof_Y15tuple_param_2_0, const unsigned long int _alignof_Y15tuple_param_2_0, const unsigned long int _sizeof_Y15tuple_param_2_1, const unsigned long int _alignof_Y15tuple_param_2_1){ 108 108 ((void)((*_sizeof__tuple2_)=0)); 109 109 ((void)((*_alignof__tuple2_)=1)); … … 136 136 struct _tuple3_ { 137 137 }; 138 static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, unsigned long int _sizeof_Y15tuple_param_3_0, unsigned long int _alignof_Y15tuple_param_3_0, unsigned long int _sizeof_Y15tuple_param_3_1, unsigned long int _alignof_Y15tuple_param_3_1, unsigned long int _sizeof_Y15tuple_param_3_2,unsigned long int _alignof_Y15tuple_param_3_2){138 static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, const unsigned long int _sizeof_Y15tuple_param_3_0, const unsigned long int _alignof_Y15tuple_param_3_0, const unsigned long int _sizeof_Y15tuple_param_3_1, const unsigned long int _alignof_Y15tuple_param_3_1, const unsigned long int _sizeof_Y15tuple_param_3_2, const unsigned long int _alignof_Y15tuple_param_3_2){ 139 139 ((void)((*_sizeof__tuple3_)=0)); 140 140 ((void)((*_alignof__tuple3_)=1)); -
tests/PRNG.cfa
r5ddb8bf r81da3da4 10 10 // Created On : Wed Dec 29 09:38:12 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 14 08:49:53202313 // Update Count : 42 512 // Last Modified On : Tue Dec 5 08:14:57 2023 13 // Update Count : 428 14 14 // 15 15 … … 32 32 #define STARTTIME start = timeHiRes() 33 33 #define ENDTIME( extra ) sout | wd(0,1, (timeHiRes() - start)`ms / 1000.) | extra "seconds" 34 enum { BUCKETS = 100_000, TRIALS = 1 _000_000_000 };34 enum { BUCKETS = 100_000, TRIALS = 100_000_000 }; 35 35 #else 36 36 #define STARTTIME 37 37 #define ENDTIME( extra ) 38 enum { BUCKETS = 100_000, TRIALS = 10 0_000_000 };38 enum { BUCKETS = 100_000, TRIALS = 10_000_000 }; 39 39 #endif // TIME 40 40
Note:
See TracChangeset
for help on using the changeset viewer.