Changes in / [f53afafb:5cefa43]
- Files:
-
- 2 added
- 6 deleted
- 14 edited
-
benchmark/io/sendfile/consumer.c (deleted)
-
benchmark/io/sendfile/producer.c (deleted)
-
driver/cc1.cc (modified) (3 diffs)
-
libcfa/src/concurrency/kernel/startup.cfa (modified) (2 diffs)
-
libcfa/src/concurrency/preemption.cfa (modified) (2 diffs)
-
libcfa/src/math.trait.hfa (modified) (4 diffs)
-
src/AST/AssertAcyclic.cpp (added)
-
src/AST/AssertAcyclic.hpp (added)
-
src/AST/Decl.cpp (modified) (1 diff)
-
src/AST/Util.cpp (deleted)
-
src/AST/Util.hpp (deleted)
-
src/AST/module.mk (modified) (2 diffs)
-
src/SymTab/Validate.cc (modified) (7 diffs)
-
src/SymTab/Validate.h (modified) (1 diff)
-
src/Validate/ForallPointerDecay.cpp (deleted)
-
src/Validate/ForallPointerDecay.hpp (deleted)
-
src/Validate/module.mk (modified) (1 diff)
-
src/main.cc (modified) (4 diffs)
-
tests/.expect/declarationSpecifier.arm64.txt (modified) (2 diffs)
-
tests/.expect/gccExtensions.arm64.txt (modified) (2 diffs)
-
tests/.expect/random.arm64.txt (modified) (1 diff)
-
tests/meta/dumpable.cfa (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
driver/cc1.cc
rf53afafb r5cefa43 10 10 // Created On : Fri Aug 26 14:23:51 2005 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 17 18:04:23 202213 // Update Count : 4 2212 // Last Modified On : Wed Jul 21 09:46:24 2021 13 // Update Count : 419 14 14 // 15 15 … … 61 61 static string __CFA_FLAGPREFIX__( "__CFA_FLAG" ); // "__CFA_FLAG__=" suffix 62 62 63 static void checkEnv1( ) {// stage 163 static void checkEnv1( const char * args[], int & nargs ) { // stage 1 64 64 extern char ** environ; 65 65 … … 155 155 cerr << "Stage1" << endl; 156 156 #endif // __DEBUG_H__ 157 checkEnv1( );// arguments passed via environment variables157 checkEnv1( args, nargs ); // arguments passed via environment variables 158 158 #ifdef __DEBUG_H__ 159 159 for ( int i = 1; i < argc; i += 1 ) { -
libcfa/src/concurrency/kernel/startup.cfa
rf53afafb r5cefa43 18 18 19 19 // C Includes 20 #include <errno.h> // errno20 #include <errno.h> // errno 21 21 #include <signal.h> 22 #include <string.h> // strerror23 #include <unistd.h> // sysconf22 #include <string.h> // strerror 23 #include <unistd.h> // sysconf 24 24 25 25 extern "C" { 26 #include <limits.h> // PTHREAD_STACK_MIN27 #include <unistd.h> // syscall28 #include <sys/eventfd.h> // eventfd29 #include <sys/mman.h> // mprotect30 #include <sys/resource.h> // getrlimit26 #include <limits.h> // PTHREAD_STACK_MIN 27 #include <unistd.h> // syscall 28 #include <sys/eventfd.h> // eventfd 29 #include <sys/mman.h> // mprotect 30 #include <sys/resource.h> // getrlimit 31 31 } 32 32 33 33 // CFA Includes 34 34 #include "kernel_private.hfa" 35 #include "startup.hfa" // STARTUP_PRIORITY_XXX35 #include "startup.hfa" // STARTUP_PRIORITY_XXX 36 36 #include "limits.hfa" 37 37 #include "math.hfa" … … 736 736 check( pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute 737 737 738 size_t stacksize = max( PTHREAD_STACK_MIN, DEFAULT_STACK_SIZE );738 size_t stacksize = DEFAULT_STACK_SIZE; 739 739 740 740 void * stack; -
libcfa/src/concurrency/preemption.cfa
rf53afafb r5cefa43 10 10 // Created On : Mon Jun 5 14:20:42 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 17 11:18:57 202213 // Update Count : 5 912 // Last Modified On : Fri Nov 6 07:42:13 2020 13 // Update Count : 54 14 14 // 15 15 … … 243 243 //---------- 244 244 // special case for preemption since used often 245 __attribute__((optimize("no-reorder-blocks")))bool __preemption_enabled() {245 bool __preemption_enabled() { 246 246 // create a assembler label before 247 247 // marked as clobber all to avoid movement -
libcfa/src/math.trait.hfa
rf53afafb r5cefa43 16 16 #pragma once 17 17 18 trait Not( U) {19 void ?{}( U&, zero_t );20 int !?( U);18 trait Not( T ) { 19 void ?{}( T &, zero_t ); 20 int !?( T ); 21 21 }; // Not 22 22 … … 26 26 }; // Equality 27 27 28 trait Relational( U | Equality( U) ) {29 int ?<?( U, U);30 int ?<=?( U, U);31 int ?>?( U, U);32 int ?>=?( U, U);28 trait Relational( T | Equality( T ) ) { 29 int ?<?( T, T ); 30 int ?<=?( T, T ); 31 int ?>?( T, T ); 32 int ?>=?( T, T ); 33 33 }; // Relational 34 34 … … 39 39 }; // Signed 40 40 41 trait Additive( U | Signed( U) ) {42 U ?+?( U, U);43 U ?-?( U, U);44 U ?+=?( U &, U);45 U ?-=?( U &, U);41 trait Additive( T | Signed( T ) ) { 42 T ?+?( T, T ); 43 T ?-?( T, T ); 44 T ?+=?( T &, T ); 45 T ?-=?( T &, T ); 46 46 }; // Additive 47 47 … … 49 49 void ?{}( T &, one_t ); 50 50 // T ?++( T & ); 51 // T ++?( T & );51 // T ++?( T &); 52 52 // T ?--( T & ); 53 53 // T --?( T & ); 54 54 }; // Incdec 55 55 56 trait Multiplicative( U | Incdec( U) ) {57 U ?*?( U, U);58 U ?/?( U, U);59 U ?%?( U, U);60 U ?/=?( U &, U);56 trait Multiplicative( T | Incdec( T ) ) { 57 T ?*?( T, T ); 58 T ?/?( T, T ); 59 T ?%?( T, T ); 60 T ?/=?( T &, T ); 61 61 }; // Multiplicative 62 62 -
src/AST/Decl.cpp
rf53afafb r5cefa43 39 39 if ( uniqueId ) return; // ensure only set once 40 40 uniqueId = ++lastUniqueId; 41 // The extra readonly pointer is causing some reference counting issues. 42 // idMap[ uniqueId ] = this; 41 idMap[ uniqueId ] = this; 43 42 } 44 43 45 44 readonly<Decl> Decl::fromId( UniqueId id ) { 46 // Right now this map is always empty, so don't use it.47 assert( false );48 45 IdMapType::const_iterator i = idMap.find( id ); 49 46 if ( i != idMap.end() ) return i->second; -
src/AST/module.mk
rf53afafb r5cefa43 16 16 17 17 SRC_AST = \ 18 AST/AssertAcyclic.cpp \ 19 AST/AssertAcyclic.hpp \ 18 20 AST/Attribute.cpp \ 19 21 AST/Attribute.hpp \ … … 62 64 AST/TypeSubstitution.cpp \ 63 65 AST/TypeSubstitution.hpp \ 64 AST/Util.cpp \65 AST/Util.hpp \66 66 AST/Visitor.hpp 67 67 -
src/SymTab/Validate.cc
rf53afafb r5cefa43 194 194 }; 195 195 196 // These structs are the sub-sub-passes of ForallPointerDecay_old.197 198 struct TraitExpander_old final {199 void previsit( FunctionType * );200 void previsit( StructDecl * );201 void previsit( UnionDecl * );202 };203 204 struct AssertionFixer_old final {205 void previsit( FunctionType * );206 void previsit( StructDecl * );207 void previsit( UnionDecl * );208 };209 210 struct CheckOperatorTypes_old final {211 void previsit( ObjectDecl * );212 };213 214 struct FixUniqueIds_old final {215 void previsit( DeclarationWithType * );216 };217 218 196 struct ReturnChecker : public WithGuards { 219 197 /// Checks that return statements return nothing if their return type is void … … 408 386 409 387 void validate_D( std::list< Declaration * > & translationUnit ) { 388 PassVisitor<ForallPointerDecay_old> fpd; 410 389 { 411 390 Stats::Heap::newPass("validate-D"); … … 415 394 }); 416 395 Stats::Time::TimeBlock("Forall Pointer Decay", [&]() { 417 decayForallPointers( translationUnit); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution396 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution 418 397 }); 419 398 Stats::Time::TimeBlock("Hoist Control Declarations", [&]() { … … 475 454 476 455 void decayForallPointers( std::list< Declaration * > & translationUnit ) { 477 PassVisitor<TraitExpander_old> te; 478 acceptAll( translationUnit, te ); 479 PassVisitor<AssertionFixer_old> af; 480 acceptAll( translationUnit, af ); 481 PassVisitor<CheckOperatorTypes_old> cot; 482 acceptAll( translationUnit, cot ); 483 PassVisitor<FixUniqueIds_old> fui; 484 acceptAll( translationUnit, fui ); 485 } 486 487 void decayForallPointersA( std::list< Declaration * > & translationUnit ) { 488 PassVisitor<TraitExpander_old> te; 489 acceptAll( translationUnit, te ); 490 } 491 void decayForallPointersB( std::list< Declaration * > & translationUnit ) { 492 PassVisitor<AssertionFixer_old> af; 493 acceptAll( translationUnit, af ); 494 } 495 void decayForallPointersC( std::list< Declaration * > & translationUnit ) { 496 PassVisitor<CheckOperatorTypes_old> cot; 497 acceptAll( translationUnit, cot ); 498 } 499 void decayForallPointersD( std::list< Declaration * > & translationUnit ) { 500 PassVisitor<FixUniqueIds_old> fui; 501 acceptAll( translationUnit, fui ); 456 PassVisitor<ForallPointerDecay_old> fpd; 457 acceptAll( translationUnit, fpd ); 502 458 } 503 459 … … 514 470 PassVisitor<EnumAndPointerDecay_old> epc; 515 471 PassVisitor<LinkReferenceToTypes_old> lrt( indexer ); 516 PassVisitor<TraitExpander_old> te; 517 PassVisitor<AssertionFixer_old> af; 518 PassVisitor<CheckOperatorTypes_old> cot; 519 PassVisitor<FixUniqueIds_old> fui; 472 PassVisitor<ForallPointerDecay_old> fpd; 520 473 type->accept( epc ); 521 474 type->accept( lrt ); 522 type->accept( te ); 523 type->accept( af ); 524 type->accept( cot ); 525 type->accept( fui ); 475 type->accept( fpd ); 526 476 } 527 477 … … 1022 972 } 1023 973 1024 /// Replace all traits in assertion lists with their assertions.1025 void expandTraits( std::list< TypeDecl * > & forall ) {1026 for ( TypeDecl * type : forall ) {1027 std::list< DeclarationWithType * > asserts;1028 asserts.splice( asserts.end(), type->assertions );1029 // expand trait instances into their members1030 for ( DeclarationWithType * assertion : asserts ) {1031 if ( TraitInstType * traitInst = dynamic_cast< TraitInstType * >( assertion->get_type() ) ) {1032 // expand trait instance into all of its members1033 expandAssertions( traitInst, back_inserter( type->assertions ) );1034 delete traitInst;1035 } else {1036 // pass other assertions through1037 type->assertions.push_back( assertion );1038 } // if1039 } // for1040 }1041 }1042 1043 /// Fix each function in the assertion list and check for invalid void type.1044 void fixAssertions(1045 std::list< TypeDecl * > & forall, BaseSyntaxNode * node ) {1046 for ( TypeDecl * type : forall ) {1047 for ( DeclarationWithType *& assertion : type->assertions ) {1048 bool isVoid = fixFunction( assertion );1049 if ( isVoid ) {1050 SemanticError( node, "invalid type void in assertion of function " );1051 } // if1052 } // for1053 }1054 }1055 1056 974 void ForallPointerDecay_old::previsit( ObjectDecl * object ) { 1057 975 // ensure that operator names only apply to functions or function pointers … … 1076 994 void ForallPointerDecay_old::previsit( UnionDecl * aggrDecl ) { 1077 995 forallFixer( aggrDecl->parameters, aggrDecl ); 1078 }1079 1080 void TraitExpander_old::previsit( FunctionType * ftype ) {1081 expandTraits( ftype->forall );1082 }1083 1084 void TraitExpander_old::previsit( StructDecl * aggrDecl ) {1085 expandTraits( aggrDecl->parameters );1086 }1087 1088 void TraitExpander_old::previsit( UnionDecl * aggrDecl ) {1089 expandTraits( aggrDecl->parameters );1090 }1091 1092 void AssertionFixer_old::previsit( FunctionType * ftype ) {1093 fixAssertions( ftype->forall, ftype );1094 }1095 1096 void AssertionFixer_old::previsit( StructDecl * aggrDecl ) {1097 fixAssertions( aggrDecl->parameters, aggrDecl );1098 }1099 1100 void AssertionFixer_old::previsit( UnionDecl * aggrDecl ) {1101 fixAssertions( aggrDecl->parameters, aggrDecl );1102 }1103 1104 void CheckOperatorTypes_old::previsit( ObjectDecl * object ) {1105 // ensure that operator names only apply to functions or function pointers1106 if ( CodeGen::isOperator( object->name ) && ! dynamic_cast< FunctionType * >( object->type->stripDeclarator() ) ) {1107 SemanticError( object->location, toCString( "operator ", object->name.c_str(), " is not a function or function pointer." ) );1108 }1109 }1110 1111 void FixUniqueIds_old::previsit( DeclarationWithType * decl ) {1112 decl->fixUniqueId();1113 996 } 1114 997 -
src/SymTab/Validate.h
rf53afafb r5cefa43 43 43 void validate_F( std::list< Declaration * > &translationUnit ); 44 44 void decayForallPointers( std::list< Declaration * > & translationUnit ); 45 void decayForallPointersA( std::list< Declaration * > & translationUnit );46 void decayForallPointersB( std::list< Declaration * > & translationUnit );47 void decayForallPointersC( std::list< Declaration * > & translationUnit );48 void decayForallPointersD( std::list< Declaration * > & translationUnit );49 45 50 46 const ast::Type * validateType( -
src/Validate/module.mk
rf53afafb r5cefa43 20 20 Validate/CompoundLiteral.cpp \ 21 21 Validate/CompoundLiteral.hpp \ 22 Validate/ForallPointerDecay.cpp \23 Validate/ForallPointerDecay.hpp \24 22 Validate/HandleAttributes.cc \ 25 23 Validate/HandleAttributes.h \ -
src/main.cc
rf53afafb r5cefa43 32 32 33 33 #include "AST/Convert.hpp" 34 #include "AST/Print.hpp"35 34 #include "CompilationState.h" 36 35 #include "../config.h" // for CFA_LIBDIR … … 77 76 #include "Validate/Autogen.hpp" // for autogenerateRoutines 78 77 #include "Validate/FindSpecialDecls.h" // for findGlobalDecls 79 #include "Validate/ForallPointerDecay.hpp" // for decayForallPointers80 78 #include "Validate/CompoundLiteral.hpp" // for handleCompoundLiterals 81 79 #include "Validate/InitializerLength.hpp" // for setLengthFromInitializer … … 333 331 334 332 if( useNewAST ) { 335 PASS( "Implement Concurrent Keywords", Concurrency::applyKeywords( translationUnit ) ); 336 //PASS( "Forall Pointer Decay - A", SymTab::decayForallPointersA( translationUnit ) ); 337 //PASS( "Forall Pointer Decay - B", SymTab::decayForallPointersB( translationUnit ) ); 338 //PASS( "Forall Pointer Decay - C", SymTab::decayForallPointersC( translationUnit ) ); 339 //PASS( "Forall Pointer Decay - D", SymTab::decayForallPointersD( translationUnit ) ); 333 PASS( "Apply Concurrent Keywords", Concurrency::applyKeywords( translationUnit ) ); 334 PASS( "Forall Pointer Decay", SymTab::decayForallPointers( translationUnit ) ); 340 335 CodeTools::fillLocations( translationUnit ); 341 336 … … 347 342 348 343 forceFillCodeLocations( transUnit ); 349 350 // Must be after implement concurrent keywords; because uniqueIds351 // must be set on declaration before resolution.352 // Must happen before autogen routines are added.353 PASS( "Forall Pointer Decay", Validate::decayForallPointers( transUnit ) );354 344 355 345 // Must happen before autogen routines are added. -
tests/.expect/declarationSpecifier.arm64.txt
rf53afafb r5cefa43 1132 1132 char **_X13cfa_args_argvPPc_1; 1133 1133 char **_X13cfa_args_envpPPc_1; 1134 __attribute__ ((weak)) extern signed int _X17cfa_main_returnedi_1;1134 signed int _X17cfa_main_returnedi_1 = ((signed int )0); 1135 1135 signed int main(signed int _X4argci_1, char **_X4argvPPc_1, char **_X4envpPPc_1){ 1136 1136 __attribute__ ((unused)) signed int _X12_retval_maini_1; … … 1149 1149 signed int _tmp_cp_ret6; 1150 1150 signed int _X3reti_2 = (((void)(_tmp_cp_ret6=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret6); 1151 if ( ((&_X17cfa_main_returnedi_1)!=((signed int *)0)) ) { 1152 { 1153 ((void)(_X17cfa_main_returnedi_1=((signed int )1))); 1154 } 1155 1151 { 1152 ((void)(_X17cfa_main_returnedi_1=((signed int )1))); 1156 1153 } 1157 1154 -
tests/.expect/gccExtensions.arm64.txt
rf53afafb r5cefa43 324 324 char **_X13cfa_args_argvPPc_1; 325 325 char **_X13cfa_args_envpPPc_1; 326 __attribute__ ((weak)) extern signed int _X17cfa_main_returnedi_1;326 signed int _X17cfa_main_returnedi_1 = ((signed int )0); 327 327 signed int main(signed int _X4argci_1, char **_X4argvPPc_1, char **_X4envpPPc_1){ 328 328 __attribute__ ((unused)) signed int _X12_retval_maini_1; … … 341 341 signed int _tmp_cp_ret6; 342 342 signed int _X3reti_2 = (((void)(_tmp_cp_ret6=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret6); 343 if ( ((&_X17cfa_main_returnedi_1)!=((signed int *)0)) ) { 344 { 345 ((void)(_X17cfa_main_returnedi_1=((signed int )1))); 346 } 347 343 { 344 ((void)(_X17cfa_main_returnedi_1=((signed int )1))); 348 345 } 349 346 -
tests/.expect/random.arm64.txt
rf53afafb r5cefa43 1 1 õ 2 2 = 3 K 3 V 4 4 -911259971 5 5 6 6 11 6 -4 7 7 1232105397 8 8 0 9 1 19 18 10 10 -914096085 11 11 1 12 20 12 15 13 13 2077092859 14 14 1 15 1 215 11 16 16 0.677254 17 17 0.678106775246139 -
tests/meta/dumpable.cfa
rf53afafb r5cefa43 72 72 } 73 73 74 uint64_t avail = buf.f_bavail; 75 avail *= buf.f_bsize; 76 if(avail < 536870912_l64u) { 77 serr | "Available diskspace is less than ~500Mb: " | avail; 74 if((buf.f_bsize * buf.f_bavail) < 536870912) { 75 serr | "Available diskspace is less than ~500Mb: " | (buf.f_bsize * buf.f_bavail); 78 76 } 79 77
Note:
See TracChangeset
for help on using the changeset viewer.