Changes in / [4269d1b:8a9a3ab]
- Files:
-
- 45 added
- 45 deleted
- 36 edited
-
driver/cfa.cc (modified) (3 diffs)
-
libcfa/src/Makefile.am (modified) (4 diffs)
-
libcfa/src/bits/collections.hfa (added)
-
libcfa/src/bits/containers.hfa (deleted)
-
libcfa/src/bits/weakso_locks.hfa (modified) (1 diff)
-
libcfa/src/collections/array.hfa (added)
-
libcfa/src/collections/list.hfa (added)
-
libcfa/src/collections/lockfree.hfa (added)
-
libcfa/src/collections/maybe.cfa (added)
-
libcfa/src/collections/maybe.hfa (added)
-
libcfa/src/collections/pair.cfa (added)
-
libcfa/src/collections/pair.hfa (added)
-
libcfa/src/collections/result.cfa (added)
-
libcfa/src/collections/result.hfa (added)
-
libcfa/src/collections/string.cfa (added)
-
libcfa/src/collections/string.hfa (added)
-
libcfa/src/collections/string_res.cfa (added)
-
libcfa/src/collections/string_res.hfa (added)
-
libcfa/src/collections/string_sharectx.hfa (added)
-
libcfa/src/collections/vector.cfa (added)
-
libcfa/src/collections/vector.hfa (added)
-
libcfa/src/collections/vector2.hfa (added)
-
libcfa/src/concurrency/alarm.hfa (modified) (2 diffs)
-
libcfa/src/concurrency/invoke.h (modified) (2 diffs)
-
libcfa/src/concurrency/kernel.hfa (modified) (2 diffs)
-
libcfa/src/concurrency/locks.hfa (modified) (1 diff)
-
libcfa/src/concurrency/once.hfa (modified) (1 diff)
-
libcfa/src/concurrency/select.hfa (modified) (1 diff)
-
libcfa/src/containers/array.hfa (deleted)
-
libcfa/src/containers/list.hfa (deleted)
-
libcfa/src/containers/lockfree.hfa (deleted)
-
libcfa/src/containers/maybe.cfa (deleted)
-
libcfa/src/containers/maybe.hfa (deleted)
-
libcfa/src/containers/pair.cfa (deleted)
-
libcfa/src/containers/pair.hfa (deleted)
-
libcfa/src/containers/result.cfa (deleted)
-
libcfa/src/containers/result.hfa (deleted)
-
libcfa/src/containers/string.cfa (deleted)
-
libcfa/src/containers/string.hfa (deleted)
-
libcfa/src/containers/string_res.cfa (deleted)
-
libcfa/src/containers/string_res.hfa (deleted)
-
libcfa/src/containers/string_sharectx.hfa (deleted)
-
libcfa/src/containers/vector.cfa (deleted)
-
libcfa/src/containers/vector.hfa (deleted)
-
libcfa/src/containers/vector2.hfa (deleted)
-
libcfa/src/executor.baseline.txt (modified) (1 diff)
-
libcfa/src/executor.cfa (modified) (1 diff)
-
libcfa/src/iostream.cfa (modified) (3 diffs)
-
libcfa/src/iostream.hfa (modified) (3 diffs)
-
src/InitTweak/FixInitNew.cpp (modified) (1 diff)
-
src/Parser/parser.yy (modified) (3 diffs)
-
src/ResolvExpr/CurrentObject.cc (modified) (2 diffs)
-
src/ResolvExpr/ResolveTypeof.cc (modified) (9 diffs)
-
src/ResolvExpr/ResolveTypeof.h (modified) (1 diff)
-
src/ResolvExpr/Resolver.cc (modified) (1 diff)
-
src/Validate/GenericParameter.cpp (modified) (1 diff)
-
tests/Makefile.am (modified) (3 diffs)
-
tests/array-collections/.expect/array-basic.txt (added)
-
tests/array-collections/.expect/array-md-sbscr-cases.arm64.txt (added)
-
tests/array-collections/.expect/array-md-sbscr-cases.x64.txt (added)
-
tests/array-collections/.expect/array-sbscr-types.txt (added)
-
tests/array-collections/.expect/dimexpr-match-c-ERRS.arm64.txt (added)
-
tests/array-collections/.expect/dimexpr-match-c-ERRS.x64.txt (added)
-
tests/array-collections/.expect/dimexpr-match-c-ERRS.x86.txt (added)
-
tests/array-collections/.expect/dimexpr-match-c.txt (added)
-
tests/array-collections/.expect/dimexpr-match-cfa-ERRS.arm64.txt (added)
-
tests/array-collections/.expect/dimexpr-match-cfa-ERRS.x64.txt (added)
-
tests/array-collections/.expect/dimexpr-match-cfa-ERRS.x86.txt (added)
-
tests/array-collections/.expect/dimexpr-match-cfa.txt (added)
-
tests/array-collections/.expect/language-dim-mismatch.txt (added)
-
tests/array-collections/.expect/safety-summary.txt (added)
-
tests/array-collections/.expect/symtab-collision.txt (added)
-
tests/array-collections/array-basic.cfa (added)
-
tests/array-collections/array-md-sbscr-cases.cfa (added)
-
tests/array-collections/array-sbscr-types.cfa (added)
-
tests/array-collections/dimexpr-match-c.cfa (added)
-
tests/array-collections/dimexpr-match-cfa.cfa (added)
-
tests/array-collections/dimexpr-match-detail.sh (added)
-
tests/array-collections/dimexpr-match.hfa (added)
-
tests/array-collections/language-dim-mismatch.cfa (added)
-
tests/array-collections/safety-summary.cfa (added)
-
tests/array-collections/symtab-collision.cfa (added)
-
tests/array-container/.expect/array-basic.txt (deleted)
-
tests/array-container/.expect/array-md-sbscr-cases.arm64.txt (deleted)
-
tests/array-container/.expect/array-md-sbscr-cases.x64.txt (deleted)
-
tests/array-container/.expect/array-sbscr-types.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-c-ERRS.arm64.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-c-ERRS.x64.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-c-ERRS.x86.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-c.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-cfa-ERRS.arm64.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-cfa-ERRS.x64.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-cfa-ERRS.x86.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-cfa.txt (deleted)
-
tests/array-container/.expect/language-dim-mismatch.txt (deleted)
-
tests/array-container/.expect/safety-summary.txt (deleted)
-
tests/array-container/.expect/symtab-collision.txt (deleted)
-
tests/array-container/array-basic.cfa (deleted)
-
tests/array-container/array-md-sbscr-cases.cfa (deleted)
-
tests/array-container/array-sbscr-types.cfa (deleted)
-
tests/array-container/dimexpr-match-c.cfa (deleted)
-
tests/array-container/dimexpr-match-cfa.cfa (deleted)
-
tests/array-container/dimexpr-match-detail.sh (deleted)
-
tests/array-container/dimexpr-match.hfa (deleted)
-
tests/array-container/language-dim-mismatch.cfa (deleted)
-
tests/array-container/safety-summary.cfa (deleted)
-
tests/array-container/symtab-collision.cfa (deleted)
-
tests/collections/atomic_mpsc.cfa (modified) (1 diff)
-
tests/collections/string-api-coverage.cfa (modified) (1 diff)
-
tests/collections/string-istream.cfa (modified) (1 diff)
-
tests/collections/string-overwrite.cfa (modified) (1 diff)
-
tests/collections/vector-demo.cfa (modified) (1 diff)
-
tests/concurrency/unified_locking/thread_test.cfa (modified) (1 diff)
-
tests/include/.expect/vector-collections.txt (added)
-
tests/include/.expect/vector-containers.txt (deleted)
-
tests/include/vector-collections.cfa (added)
-
tests/include/vector-containers.cfa (deleted)
-
tests/list/dlist-insert-remove.cfa (modified) (1 diff)
-
tests/maybe.cfa (modified) (1 diff)
-
tests/pybin/settings.py (modified) (1 diff)
-
tests/result.cfa (modified) (1 diff)
-
tests/test.py (modified) (1 diff)
-
tests/zombies/gc_no_raii/premake4.lua (modified) (1 diff)
-
tests/zombies/hashtable.cfa (modified) (1 diff)
-
tests/zombies/hashtable2.cfa (modified) (1 diff)
-
tests/zombies/linked-list-perf/experiment.koad (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
driver/cfa.cc
r4269d1b r8a9a3ab 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 9 14:36:41202313 // Update Count : 4 7912 // Last Modified On : Wed Aug 30 21:48:48 2023 13 // Update Count : 480 14 14 // 15 15 … … 361 361 } // if 362 362 args[nargs++] = "-I" CFA_INCDIR "concurrency"; 363 args[nargs++] = "-I" CFA_INCDIR "co ntainers";363 args[nargs++] = "-I" CFA_INCDIR "collections"; 364 364 libbase = CFA_LIBDIR; 365 365 break; … … 372 372 } // if 373 373 args[nargs++] = "-I" TOP_SRCDIR "libcfa/src" "/concurrency"; 374 args[nargs++] = "-I" TOP_SRCDIR "libcfa/src" "/co ntainers";374 args[nargs++] = "-I" TOP_SRCDIR "libcfa/src" "/collections"; 375 375 376 376 libbase = TOP_BUILDDIR "libcfa/"; -
libcfa/src/Makefile.am
r4269d1b r8a9a3ab 11 11 ## Created On : Sun May 31 08:54:01 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Mon Aug 14 17:10:51202314 ## Update Count : 26 213 ## Last Modified On : Wed Aug 30 21:22:45 2023 14 ## Update Count : 263 15 15 ############################################################################### 16 16 … … 52 52 bits/algorithm.hfa \ 53 53 bits/align.hfa \ 54 bits/co ntainers.hfa \54 bits/collections.hfa \ 55 55 bits/debug.hfa \ 56 56 bits/defs.hfa \ … … 63 63 concurrency/iofwd.hfa \ 64 64 concurrency/barrier.hfa \ 65 co ntainers/array.hfa \66 co ntainers/list.hfa \67 co ntainers/lockfree.hfa \68 co ntainers/string_sharectx.hfa \69 co ntainers/vector2.hfa \65 collections/array.hfa \ 66 collections/list.hfa \ 67 collections/lockfree.hfa \ 68 collections/string_sharectx.hfa \ 69 collections/vector2.hfa \ 70 70 vec/vec.hfa \ 71 71 vec/vec2.hfa \ … … 89 89 bits/weakso_locks.hfa \ 90 90 algorithms/range_iterator.hfa \ 91 co ntainers/maybe.hfa \92 co ntainers/pair.hfa \93 co ntainers/result.hfa \94 co ntainers/string.hfa \95 co ntainers/string_res.hfa \96 co ntainers/vector.hfa \91 collections/maybe.hfa \ 92 collections/pair.hfa \ 93 collections/result.hfa \ 94 collections/string.hfa \ 95 collections/string_res.hfa \ 96 collections/vector.hfa \ 97 97 device/cpu.hfa 98 98 -
libcfa/src/bits/weakso_locks.hfa
r4269d1b r8a9a3ab 20 20 #include "bits/locks.hfa" 21 21 #include "bits/sequence.hfa" 22 #include "bits/co ntainers.hfa"23 #include "co ntainers/list.hfa"22 #include "bits/collections.hfa" 23 #include "collections/list.hfa" 24 24 25 25 struct select_node; -
libcfa/src/concurrency/alarm.hfa
r4269d1b r8a9a3ab 10 10 // Created On : Fri Jun 2 11:31:25 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 26 16:25:41 201813 // Update Count : 1 112 // Last Modified On : Wed Aug 30 21:27:40 2023 13 // Update Count : 12 14 14 // 15 15 … … 23 23 #include "time.hfa" 24 24 25 #include "co ntainers/list.hfa"25 #include "collections/list.hfa" 26 26 27 27 struct thread$; -
libcfa/src/concurrency/invoke.h
r4269d1b r8a9a3ab 10 10 // Created On : Tue Jan 17 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 14 13:39:31 202313 // Update Count : 5912 // Last Modified On : Wed Aug 30 21:27:51 2023 13 // Update Count : 60 14 14 // 15 15 16 16 // No not use #pragma once was this file is included twice in some places. It has its own guard system. 17 17 18 #include "bits/co ntainers.hfa"18 #include "bits/collections.hfa" 19 19 #include "bits/defs.hfa" 20 20 #include "bits/locks.hfa" … … 23 23 24 24 #ifdef __cforall 25 #include "co ntainers/list.hfa"25 #include "collections/list.hfa" 26 26 extern "C" { 27 27 #endif -
libcfa/src/concurrency/kernel.hfa
r4269d1b r8a9a3ab 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 4 12:29:26 202013 // Update Count : 2 212 // Last Modified On : Wed Aug 30 21:28:46 2023 13 // Update Count : 23 14 14 // 15 15 … … 20 20 #include "coroutine.hfa" 21 21 22 #include "co ntainers/list.hfa"22 #include "collections/list.hfa" 23 23 24 24 extern "C" { -
libcfa/src/concurrency/locks.hfa
r4269d1b r8a9a3ab 21 21 22 22 #include "bits/weakso_locks.hfa" 23 #include "co ntainers/lockfree.hfa"24 #include "co ntainers/list.hfa"23 #include "collections/lockfree.hfa" 24 #include "collections/list.hfa" 25 25 26 26 #include "limits.hfa" -
libcfa/src/concurrency/once.hfa
r4269d1b r8a9a3ab 16 16 #pragma once 17 17 18 #include "co ntainers/lockfree.hfa"18 #include "collections/lockfree.hfa" 19 19 #include "kernel/fwd.hfa" 20 20 -
libcfa/src/concurrency/select.hfa
r4269d1b r8a9a3ab 17 17 #pragma once 18 18 19 #include "co ntainers/list.hfa"19 #include "collections/list.hfa" 20 20 #include "alarm.hfa" 21 21 #include "kernel.hfa" -
libcfa/src/executor.baseline.txt
r4269d1b r8a9a3ab 5 5 6 6 #include <thread.hfa> 7 #include <co ntainers/list.hfa>7 #include <collections/list.hfa> 8 8 9 9 forall( T & | $dlistable(T, T) ) { -
libcfa/src/executor.cfa
r4269d1b r8a9a3ab 5 5 6 6 #include <thread.hfa> 7 #include <co ntainers/list.hfa>7 #include <collections/list.hfa> 8 8 9 9 forall( T &, TLink& = dlink(T) | embedded(T, TLink, dlink(T)) ) { -
libcfa/src/iostream.cfa
r4269d1b r8a9a3ab 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 28 13:36:16 202313 // Update Count : 15 2712 // Last Modified On : Thu Aug 31 11:27:56 2023 13 // Update Count : 1545 14 14 // 15 15 … … 971 971 } // if 972 972 973 int check = f.wd - 1; 974 const char * scanset = f.scanset;; 973 const char * scanset = f.scanset; 975 974 if ( f.flags.delimit ) scanset = f.delimit; // getline ? 976 977 // getline978 // if ( f.flags.delimit ) {979 // enum { size = 32 };980 // char fmtstr[size];981 // snprintf( fmtstr, size, "%%%d[^%c]s", f.wd, f.delimit );982 // if ( ! f.flags.rwd ) f.s[check] = '\0'; // insert sentinel983 // int len = fmt( is, fmtstr, f.s ); // read upto delimiter984 // if ( ! f.flags.rwd && f.s[check] != '\0' ) // sentinel overwritten ?985 // throw (cstring_length){ &cstring_length_vt };986 // if ( len == 0 ) f.s[0] = '\0'; // empty read => argument unchanged => set empty987 // // fprintf( stderr, "getline %s %s %d %d %d '%c'\n", fmtstr, f.s, len, f.wd, check, f.s[check] );988 // if ( ! eof( is ) ) fmt( is, "%*c" ); // ignore delimiter989 // return is;990 // } // if991 975 992 976 size_t len = 0; … … 1013 997 } // if 1014 998 999 int check = f.wd - 1; 1015 1000 if ( ! f.flags.rwd ) f.s[check] = '\0'; // insert sentinel 1016 1001 len = fmt( is, fmtstr, f.s ); 1017 1002 //fprintf( stderr, "KK %s %zd %d %c %s\n", fmtstr, len, check, f.s[check], f.s ); 1003 1018 1004 if ( ! f.flags.rwd && f.s[check] != '\0' ) // sentinel overwritten ? 1019 1005 throw (cstring_length){ &cstring_length_vt }; 1020 1006 1021 1007 if ( f.flags.delimit ) { // getline ? 1022 if ( len == 0 ) f.s[0] = '\0'; // empty read => argument unchanged => set empty1023 if ( ! eof( is ) ) fmt( is, "%*c" ); // ignore delimiter1008 if ( len == 0 ) f.s[0] = '\0'; // empty read => argument unchanged => set empty 1009 if ( ! eof( is ) ) fmt( is, "%*c" ); // ignore delimiter 1024 1010 } //if 1025 1011 return is; -
libcfa/src/iostream.hfa
r4269d1b r8a9a3ab 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 25 14:55:06202313 // Update Count : 5 3512 // Last Modified On : Thu Aug 31 10:55:35 2023 13 // Update Count : 544 14 14 // 15 15 … … 406 406 // *********************************** manipulators *********************************** 407 407 408 struct _Istream_Cstr { 409 char * s; 408 struct _Istream_str_base { 410 409 union { 411 410 const char * scanset; … … 422 421 } flags; 423 422 }; 423 }; // _Istream_str_base 424 425 struct _Istream_Cstr { 426 char * s; 427 inline _Istream_str_base; 424 428 }; // _Istream_Cstr 425 429 426 430 static inline { 427 431 // width must include room for null terminator 428 _Istream_Cstr wdi( unsigned int wd, char s[] ) { return (_Istream_Cstr)@{ s, { 0p}, wd, {.all : 0} }; }432 _Istream_Cstr wdi( unsigned int wd, char s[] ) { return (_Istream_Cstr)@{ s, { {0p}, wd, {.all : 0} } }; } 429 433 // read width does not include null terminator 430 434 _Istream_Cstr wdi( unsigned int wd, unsigned int rwd, char s[] ) { 431 435 if ( wd <= rwd ) throw (cstring_length){ &cstring_length_vt }; 432 return (_Istream_Cstr)@{ s, { 0p}, rwd, {.flags.rwd : true} };436 return (_Istream_Cstr)@{ s, { {0p}, rwd, {.flags.rwd : true} } }; 433 437 } 434 _Istream_Cstr skip( const char scanset[] ) { return (_Istream_Cstr)@{ 0p, { scanset}, -1, {.all : 0} }; }435 _Istream_Cstr skip( unsigned int wd ) { return (_Istream_Cstr)@{ 0p, { 0p}, wd, {.all : 0} }; }438 _Istream_Cstr skip( const char scanset[] ) { return (_Istream_Cstr)@{ 0p, { {scanset}, -1, {.all : 0} } }; } 439 _Istream_Cstr skip( unsigned int wd ) { return (_Istream_Cstr)@{ 0p, { {0p}, wd, {.all : 0} } }; } 436 440 _Istream_Cstr & getline( _Istream_Cstr & fmt, const char delimit = '\n' ) { 437 441 fmt.delimit[0] = delimit; fmt.delimit[1] = '\0'; fmt.flags.delimit = true; fmt.flags.inex = true; return fmt; } 438 442 _Istream_Cstr & incl( const char scanset[], _Istream_Cstr & fmt ) { fmt.scanset = scanset; fmt.flags.inex = false; return fmt; } 439 443 _Istream_Cstr & excl( const char scanset[], _Istream_Cstr & fmt ) { fmt.scanset = scanset; fmt.flags.inex = true; return fmt; } 440 _Istream_Cstr ignore( char s[] ) { return (_Istream_Cstr)@{ s, { 0p}, -1, {.flags.ignore : true} }; }444 _Istream_Cstr ignore( char s[] ) { return (_Istream_Cstr)@{ s, { {0p}, -1, {.flags.ignore : true} } }; } 441 445 _Istream_Cstr & ignore( _Istream_Cstr & fmt ) { fmt.flags.ignore = true; return fmt; } 442 446 } // distribution -
src/InitTweak/FixInitNew.cpp
r4269d1b r8a9a3ab 573 573 assertf( global.dtorDestroy, "Destructor generation requires __destroy_Destructor." ); 574 574 575 const CodeLocation loc = ret->location;575 const CodeLocation & loc = ret->location; 576 576 577 577 // generate a __Destructor for ret that calls the destructor -
src/Parser/parser.yy
r4269d1b r8a9a3ab 2691 2691 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt identifier attribute_list_opt 2692 2692 { 2693 if ( $3 ->storageClasses.any() || $3->type->qualifiers.val != 0) {2693 if ( $3 && ($3->storageClasses.any() || $3->type->qualifiers.val != 0 )) { 2694 2694 SemanticError( yylloc, "syntax error, storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); 2695 2695 } … … 2829 2829 2830 2830 cfa_abstract_parameter_declaration: // CFA, new & old style parameter declaration 2831 abstract_parameter_declaration 2831 // empty 2832 { $$ = nullptr; } 2833 | abstract_parameter_declaration 2832 2834 | cfa_identifier_parameter_declarator_no_tuple 2833 2835 | cfa_abstract_tuple … … 3854 3856 // { SemanticError( yylloc, "New array dimension is currently unimplemented." ); $$ = nullptr; } 3855 3857 | '[' push array_type_list pop ']' // CFA 3856 { SemanticError( yylloc, "Type array dimension is currently unimplemented." ); $$ = nullptr; }3858 { $$ = DeclarationNode::newArray( $3, nullptr, false ); } 3857 3859 | multi_array_dimension 3858 3860 ; -
src/ResolvExpr/CurrentObject.cc
r4269d1b r8a9a3ab 1045 1045 PRINT( std::cerr << "____untyped: " << expr << std::endl; ) 1046 1046 auto dit = desigAlts.begin(); 1047 if ( auto nexpr = dynamic_cast< const NameExpr * >( expr ) ) { 1048 for ( const Type * t : curTypes ) {1049 assert( dit != desigAlts.end() );1050 1051 DesignatorChain & d = *dit;1047 1048 for ( const Type * t : curTypes ) { 1049 assert( dit != desigAlts.end() ); 1050 DesignatorChain & d = *dit; 1051 if ( auto nexpr = dynamic_cast< const NameExpr *>( expr ) ) { 1052 1052 PRINT( std::cerr << "____actual: " << t << std::endl; ) 1053 1053 if ( auto refType = dynamic_cast< const BaseInstType * >( t ) ) { … … 1062 1062 } 1063 1063 } 1064 } else if ( auto at = dynamic_cast< const ArrayType * >( t ) ) { 1065 auto nexpr = dynamic_cast< const NameExpr *>( expr ); 1066 auto res = eval( nexpr ); 1067 for ( const Decl * mem : refType->lookup( nexpr->name ) ) { 1068 if ( auto field = dynamic_cast< const ObjectDecl * >( mem ) ) { 1069 DesignatorChain d2 = d; 1070 d2.emplace_back( new VariableExpr{ expr->location, field } ); 1071 newDesigAlts.emplace_back( std::move( d2 ) ); 1072 // newTypes.emplace_back( field->type ); 1073 newTypes.emplace_back( at->base ); 1074 } 1075 } 1076 1077 // d.emplace_back( expr ); 1078 // newDesigAlts.emplace_back( d ); 1079 // newTypes.emplace_back( at->base ); 1064 1080 } 1065 1081 1066 1082 ++dit; 1067 } 1068 } else { 1069 for ( const Type * t : curTypes ) { 1070 assert( dit != desigAlts.end() ); 1071 1072 DesignatorChain & d = *dit; 1083 } else { 1073 1084 if ( auto at = dynamic_cast< const ArrayType * >( t ) ) { 1074 1085 PRINT( std::cerr << "____alt: " << at->get_base() << std::endl; ) -
src/ResolvExpr/ResolveTypeof.cc
r4269d1b r8a9a3ab 15 15 16 16 #include "ResolveTypeof.h" 17 #include "RenameVars.h" 18 19 #include <cassert> // for assert 17 18 #include <cassert> // for assert 20 19 21 20 #include "AST/CVQualifiers.hpp" … … 25 24 #include "AST/Type.hpp" 26 25 #include "AST/TypeEnvironment.hpp" 27 #include "Common/PassVisitor.h" // for PassVisitor 28 #include "Common/utility.h" // for copy 29 #include "Resolver.h" // for resolveInVoidContext 26 #include "Common/PassVisitor.h" // for PassVisitor 27 #include "Common/utility.h" // for copy 28 #include "InitTweak/InitTweak.h" // for isConstExpr 29 #include "RenameVars.h" 30 #include "Resolver.h" // for resolveInVoidContext 31 #include "SymTab/Mangler.h" 30 32 #include "SynTree/Expression.h" // for Expression 31 33 #include "SynTree/Mutator.h" // for Mutator 32 34 #include "SynTree/Type.h" // for TypeofType, Type 33 #include "SymTab/Mangler.h"34 #include "InitTweak/InitTweak.h" // for isConstExpr35 35 36 36 namespace SymTab { … … 39 39 40 40 namespace ResolvExpr { 41 namespace {41 namespace { 42 42 #if 0 43 43 void … … 52 52 } 53 53 54 class ResolveTypeof_old : public WithShortCircuiting {55 public:54 class ResolveTypeof_old : public WithShortCircuiting { 55 public: 56 56 ResolveTypeof_old( const SymTab::Indexer &indexer ) : indexer( indexer ) {} 57 57 void premutate( TypeofType *typeofType ); 58 58 Type * postmutate( TypeofType *typeofType ); 59 59 60 private:61 const SymTab::Indexer &indexer;62 };60 private: 61 const SymTab::Indexer &indexer; 62 }; 63 63 64 64 Type * resolveTypeof( Type *type, const SymTab::Indexer &indexer ) { … … 71 71 } 72 72 73 Type * ResolveTypeof_old::postmutate( TypeofType *typeofType ) {73 Type * ResolveTypeof_old::postmutate( TypeofType *typeofType ) { 74 74 #if 0 75 75 std::cerr << "resolving typeof: "; … … 77 77 std::cerr << std::endl; 78 78 #endif 79 // pass on null expression79 // pass on null expression 80 80 if ( ! typeofType->expr ) return typeofType; 81 81 82 bool isBasetypeof = typeofType->is_basetypeof;83 auto oldQuals = typeofType->get_qualifiers().val;84 85 Type* newType;82 bool isBasetypeof = typeofType->is_basetypeof; 83 auto oldQuals = typeofType->get_qualifiers().val; 84 85 Type* newType; 86 86 if ( TypeExpr* tyExpr = dynamic_cast<TypeExpr*>(typeofType->expr) ) { 87 // typeof wrapping type88 newType = tyExpr->type;89 tyExpr->type = nullptr;90 delete tyExpr;91 } else {92 // typeof wrapping expression87 // typeof wrapping type 88 newType = tyExpr->type; 89 tyExpr->type = nullptr; 90 delete tyExpr; 91 } else { 92 // typeof wrapping expression 93 93 Expression * newExpr = resolveInVoidContext( typeofType->expr, indexer ); 94 94 assert( newExpr->result && ! newExpr->result->isVoid() ); 95 newType = newExpr->result;96 newExpr->result = nullptr;97 delete typeofType;98 delete newExpr;99 }100 101 // clear qualifiers for base, combine with typeoftype quals in any case102 if ( isBasetypeof ) {95 newType = newExpr->result; 96 newExpr->result = nullptr; 97 delete typeofType; 98 delete newExpr; 99 } 100 101 // clear qualifiers for base, combine with typeoftype quals in any case 102 if ( isBasetypeof ) { 103 103 // replace basetypeof(<enum>) by int 104 104 if ( dynamic_cast<EnumInstType*>(newType) ) { … … 112 112 = ( newType->get_qualifiers().val & ~Type::Qualifiers::Mask ) | oldQuals; 113 113 } else { 114 newType->get_qualifiers().val |= oldQuals;115 }116 117 return newType;118 }114 newType->get_qualifiers().val |= oldQuals; 115 } 116 117 return newType; 118 } 119 119 120 120 namespace { 121 struct ResolveTypeof_new : public ast::WithShortCircuiting {122 const ResolveContext & context;121 struct ResolveTypeof_new : public ast::WithShortCircuiting { 122 const ResolveContext & context; 123 123 124 124 ResolveTypeof_new( const ResolveContext & context ) : … … 127 127 void previsit( const ast::TypeofType * ) { visit_children = false; } 128 128 129 const ast::Type * postvisit( const ast::TypeofType * typeofType ) {130 // pass on null expression131 if ( ! typeofType->expr ) return typeofType;132 133 ast::ptr< ast::Type > newType;134 if ( auto tyExpr = typeofType->expr.as< ast::TypeExpr >() ) {135 // typeof wrapping type136 newType = tyExpr->type;137 } else {138 // typeof wrapping expression139 ast::TypeEnvironment dummy;140 ast::ptr< ast::Expr > newExpr =141 resolveInVoidContext( typeofType->expr, context, dummy );142 assert( newExpr->result && ! newExpr->result->isVoid() );143 newType = newExpr->result;144 }145 146 // clear qualifiers for base, combine with typeoftype quals regardless147 if ( typeofType->kind == ast::TypeofType::Basetypeof ) {148 // replace basetypeof(<enum>) by int129 const ast::Type * postvisit( const ast::TypeofType * typeofType ) { 130 // pass on null expression 131 if ( ! typeofType->expr ) return typeofType; 132 133 ast::ptr< ast::Type > newType; 134 if ( auto tyExpr = typeofType->expr.as< ast::TypeExpr >() ) { 135 // typeof wrapping type 136 newType = tyExpr->type; 137 } else { 138 // typeof wrapping expression 139 ast::TypeEnvironment dummy; 140 ast::ptr< ast::Expr > newExpr = 141 resolveInVoidContext( typeofType->expr, context, dummy ); 142 assert( newExpr->result && ! newExpr->result->isVoid() ); 143 newType = newExpr->result; 144 } 145 146 // clear qualifiers for base, combine with typeoftype quals regardless 147 if ( typeofType->kind == ast::TypeofType::Basetypeof ) { 148 // replace basetypeof(<enum>) by int 149 149 if ( newType.as< ast::EnumInstType >() ) { 150 150 newType = new ast::BasicType{ 151 151 ast::BasicType::SignedInt, newType->qualifiers, copy(newType->attributes) }; 152 }152 } 153 153 reset_qualifiers( 154 154 newType, 155 155 ( newType->qualifiers & ~ast::CV::EquivQualifiers ) | typeofType->qualifiers ); 156 } else {156 } else { 157 157 add_qualifiers( newType, typeofType->qualifiers ); 158 }159 160 return newType.release();161 }162 };158 } 159 160 return newType.release(); 161 } 162 }; 163 163 } // anonymous namespace 164 164 … … 195 195 196 196 const ast::ObjectDecl * fixObjectType( const ast::ObjectDecl * decl , const ResolveContext & context ) { 197 if (decl->isTypeFixed) { 198 return decl; 199 } 200 201 auto mutDecl = mutate(decl); 202 { 203 auto resolvedType = resolveTypeof(decl->type, context); 204 resolvedType = fixArrayType(resolvedType, context); 205 mutDecl->type = resolvedType; 206 } 207 208 // Do not mangle unnamed variables. 209 if (!mutDecl->name.empty()) { 210 mutDecl->mangleName = Mangle::mangle(mutDecl); 211 } 212 213 mutDecl->type = renameTyVars(mutDecl->type, RenameMode::GEN_EXPR_ID); 214 mutDecl->isTypeFixed = true; 215 return mutDecl; 216 } 217 218 } // namespace ResolvExpr 197 if (decl->isTypeFixed) { 198 return decl; 199 } 200 201 auto mutDecl = mutate(decl); 202 fixObjectInit(decl, context); 203 { 204 auto resolvedType = resolveTypeof(decl->type, context); 205 resolvedType = fixArrayType(resolvedType, context); 206 mutDecl->type = resolvedType; 207 } 208 209 // Do not mangle unnamed variables. 210 if (!mutDecl->name.empty()) { 211 mutDecl->mangleName = Mangle::mangle(mutDecl); 212 } 213 214 mutDecl->type = renameTyVars(mutDecl->type, RenameMode::GEN_EXPR_ID); 215 mutDecl->isTypeFixed = true; 216 return mutDecl; 217 } 218 219 const ast::ObjectDecl *fixObjectInit(const ast::ObjectDecl *decl, 220 const ResolveContext &context) { 221 if (decl->isTypeFixed) { 222 return decl; 223 } 224 225 auto mutDecl = mutate(decl); 226 227 if ( auto mutListInit = mutDecl->init.as<ast::ListInit>() ) { 228 // std::list<ast::Designation *> newDesignations; 229 230 for ( size_t k = 0; k < mutListInit->designations.size(); k++ ) { 231 const ast::Designation *des = mutListInit->designations[k].get(); 232 // Desination here 233 ast::Designation * newDesination = new ast::Designation(des->location); 234 235 if (des->designators.size() == 0) continue; 236 237 // The designator I want to replace 238 const ast::Expr * designator = des->designators.at(0); 239 240 if ( const ast::NameExpr * designatorName = dynamic_cast<const ast::NameExpr *>(designator) ) { 241 auto candidates = context.symtab.lookupId(designatorName->name); 242 // Does not work for the overloading case currently 243 // assert( candidates.size() == 1 ); 244 if ( candidates.size() != 1 ) return mutDecl; 245 auto candidate = candidates.at(0); 246 if ( const ast::EnumInstType * enumInst = dynamic_cast<const ast::EnumInstType *>(candidate.id->get_type()) ) { 247 // determine that is an enumInst, swap it with its const value 248 assert( candidates.size() == 1 ); 249 const ast::EnumDecl * baseEnum = enumInst->base; 250 // Need to iterate over all enum value to find the initializer to swap 251 for ( size_t m = 0; m < baseEnum->members.size(); ++m ) { 252 if ( baseEnum->members.at(m)->name == designatorName->name ) { 253 const ast::ObjectDecl * mem = baseEnum->members.at(m).as<const ast::ObjectDecl>(); 254 assert(mem); 255 if ( mem->init ) { 256 const ast::SingleInit * memInit = mem->init.as<const ast::SingleInit>(); 257 ast::Expr * initValue = shallowCopy( memInit->value.get() ); 258 newDesination->designators.push_back( initValue ); 259 } else { 260 SemanticError(des->location, "TODO: Enum Array Designation with no explicit value is not implemented"); 261 } 262 } 263 } 264 if ( newDesination->designators.size() == 0 ) { 265 SemanticError(des->location, "Resolution Error: Resolving array designation as Enum Instance value, but cannot find a desgination value"); 266 } 267 } else { 268 newDesination->designators.push_back( des->designators.at(0) ); 269 } 270 } else { 271 newDesination->designators.push_back( des->designators.at(0) ); 272 } 273 mutListInit = ast::mutate_field_index(mutListInit, &ast::ListInit::designations, k, newDesination); 274 } 275 } 276 return mutDecl; 277 } 278 279 } // namespace ResolvExpr 219 280 220 281 // Local Variables: // -
src/ResolvExpr/ResolveTypeof.h
r4269d1b r8a9a3ab 32 32 const ast::Type * fixArrayType( const ast::Type *, const ResolveContext & ); 33 33 const ast::ObjectDecl * fixObjectType( const ast::ObjectDecl * decl , const ResolveContext & ); 34 const ast::ObjectDecl * fixObjectInit( const ast::ObjectDecl * decl , const ResolveContext &); 34 35 } // namespace ResolvExpr 35 36 -
src/ResolvExpr/Resolver.cc
r4269d1b r8a9a3ab 1507 1507 if ( InitTweak::tryConstruct( mutDecl ) && ( managedTypes.isManaged( mutDecl ) || ((! isInFunction() || mutDecl->storage.is_static ) && ! InitTweak::isConstExpr( mutDecl->init ) ) ) ) { 1508 1508 // constructed objects cannot be designated 1509 if ( InitTweak::isDesignated( mutDecl->init ) ) SemanticError( mutDecl, "Cannot include designations in the initializer for a managed Object. If this is really what you want, then initialize with @=.\n" ); 1509 // if ( InitTweak::isDesignated( mutDecl->init ) ) SemanticError( mutDecl, "Cannot include designations in the initializer for a managed Object. If this is really what you want, then initialize with @=.\n" ); 1510 if ( InitTweak::isDesignated( mutDecl->init ) ) { 1511 SemanticError( mutDecl, "Cannot include designations in the initializer for a managed Object. If this is really what you want, then initialize with @=.\n" ); 1512 } 1510 1513 // constructed objects should not have initializers nested too deeply 1511 1514 if ( ! InitTweak::checkInitDepth( mutDecl ) ) SemanticError( mutDecl, "Managed object's initializer is too deep " ); -
src/Validate/GenericParameter.cpp
r4269d1b r8a9a3ab 301 301 const ast::Expr * TranslateDimensionCore::postvisit( 302 302 const ast::TypeExpr * expr ) { 303 // Does nothing, except prevents matching ast::Expr (above). 303 if ( auto instType = dynamic_cast<const ast::EnumInstType *>( expr->type.get() ) ) { 304 const ast::EnumDecl * baseEnum = instType->base.get(); 305 return ast::ConstantExpr::from_int( expr->location, baseEnum->members.size() ); 306 } 304 307 return expr; 305 308 } -
tests/Makefile.am
r4269d1b r8a9a3ab 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Sun May 28 08:15:43202314 ## Update Count : 19 613 ## Last Modified On : Wed Aug 30 22:31:45 2023 14 ## Update Count : 197 15 15 ############################################################################### 16 16 … … 91 91 concurrency/unified_locking/mutex_test.hfa \ 92 92 concurrency/channels/parallel_harness.hfa \ 93 array-co ntainer/dimexpr-match.hfa \94 array-co ntainer/dimexpr-match-detail.sh93 array-collections/dimexpr-match.hfa \ 94 array-collections/dimexpr-match-detail.sh 95 95 96 96 dist-hook: … … 227 227 -cp ${test} ${abspath ${@}} 228 228 229 array-co ntainer/dimexpr-match-c-ERRS : array-container/dimexpr-match-c.cfa229 array-collections/dimexpr-match-c-ERRS : array-collections/dimexpr-match-c.cfa 230 230 ${CFACOMPILE_SYNTAX} -DERRS 231 231 -cp ${test} ${abspath ${@}} 232 232 233 array-co ntainer/dimexpr-match-cfa-ERRS : array-container/dimexpr-match-cfa.cfa233 array-collections/dimexpr-match-cfa-ERRS : array-collections/dimexpr-match-cfa.cfa 234 234 ${CFACOMPILE_SYNTAX} -DERRS 235 235 -cp ${test} ${abspath ${@}} -
tests/collections/atomic_mpsc.cfa
r4269d1b r8a9a3ab 1 1 #include <fstream.hfa> 2 #include <co ntainers/lockfree.hfa>2 #include <collections/lockfree.hfa> 3 3 #include <thread.hfa> 4 4 -
tests/collections/string-api-coverage.cfa
r4269d1b r8a9a3ab 1 #include <co ntainers/string.hfa>1 #include <collections/string.hfa> 2 2 #include <string_sharectx.hfa> 3 3 -
tests/collections/string-istream.cfa
r4269d1b r8a9a3ab 1 1 #include <iostream.hfa> 2 #include <co ntainers/string.hfa>3 #include <co ntainers/string_res.hfa>2 #include <collections/string.hfa> 3 #include <collections/string_res.hfa> 4 4 5 5 -
tests/collections/string-overwrite.cfa
r4269d1b r8a9a3ab 1 #include <co ntainers/string.hfa>1 #include <collections/string.hfa> 2 2 #include <string_sharectx.hfa> 3 3 -
tests/collections/vector-demo.cfa
r4269d1b r8a9a3ab 1 #include <co ntainers/vector2.hfa>1 #include <collections/vector2.hfa> 2 2 3 3 void raiiTests() { -
tests/concurrency/unified_locking/thread_test.cfa
r4269d1b r8a9a3ab 3 3 #include <stdlib.hfa> 4 4 #include <thread.hfa> 5 #include <co ntainers/array.hfa>5 #include <collections/array.hfa> 6 6 7 7 static unsigned int taskCount = 4; -
tests/list/dlist-insert-remove.cfa
r4269d1b r8a9a3ab 1 #include <co ntainers/list.hfa>1 #include <collections/list.hfa> 2 2 #include <fstream.hfa> 3 3 #include <assert.h> -
tests/maybe.cfa
r4269d1b r8a9a3ab 10 10 // Created On : Thr May 25 16:02:00 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 25 15:13:28 202013 // Update Count : 212 // Last Modified On : Wed Aug 30 21:45:27 2023 13 // Update Count : 3 14 14 // 15 15 16 16 #include <assert.h> 17 #include <co ntainers/maybe.hfa>17 #include <collections/maybe.hfa> 18 18 19 19 void checkPredicates() { -
tests/pybin/settings.py
r4269d1b r8a9a3ab 141 141 all_install = [Install(o) for o in list(dict.fromkeys(options.install))] 142 142 archive = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None 143 invariant = options. no_invariant143 invariant = options.invariant 144 144 continue_ = options.continue_ 145 145 dry_run = options.dry_run # must be called before tools.config_hash() -
tests/result.cfa
r4269d1b r8a9a3ab 10 10 // Created On : Thr May 25 16:50:00 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 25 15:22:59 202013 // Update Count : 212 // Last Modified On : Wed Aug 30 21:46:34 2023 13 // Update Count : 3 14 14 // 15 15 16 16 #include <assert.h> 17 #include <co ntainers/result.hfa>17 #include <collections/result.hfa> 18 18 19 19 void checkPredicates() { -
tests/test.py
r4269d1b r8a9a3ab 114 114 parser.add_argument('--install', help='Run all tests based on installed binaries or tree binaries', type=comma_separated(yes_no), default='no') 115 115 parser.add_argument('--continue', help='When multiple specifications are passed (debug/install/arch), sets whether or not to continue if the last specification failed', type=yes_no, default='yes', dest='continue_') 116 parser.add_argument('-- invariant', help='Tell the compiler to check invariants.', action='store_true')117 parser.add_argument('-- no-invariant', help='Tell the compiler not to check invariants.', action='store_false')116 parser.add_argument('--no-invariant', help='Tell the compiler not to check invariants.', action='store_false', dest='invariant') 117 parser.add_argument('--invariant', help='Tell the compiler to check invariants.', action='store_const', const=True) 118 118 parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=180) 119 119 parser.add_argument('--global-timeout', help='Maximum cumulative duration in seconds after the ALL tests are considered to have timed out', type=int, default=7200) -
tests/zombies/gc_no_raii/premake4.lua
r4269d1b r8a9a3ab 48 48 linkoptions (linkOptionList) 49 49 includedirs (includeDirList) 50 files { "src/**.c", "co ntainers/**.c" }50 files { "src/**.c", "collections/**.c" } 51 51 52 52 configuration "debug" -
tests/zombies/hashtable.cfa
r4269d1b r8a9a3ab 1 1 2 #include <co ntainers/list.hfa>2 #include <collections/list.hfa> 3 3 4 4 #include <exception.hfa> -
tests/zombies/hashtable2.cfa
r4269d1b r8a9a3ab 1 1 2 #include <co ntainers/list.hfa>2 #include <collections/list.hfa> 3 3 4 4 typedef unsigned int K; -
tests/zombies/linked-list-perf/experiment.koad
r4269d1b r8a9a3ab 67 67 #elif defined IMPL_CFA_MIKE_NEW 68 68 69 #include <co ntainers/list.hfa>69 #include <collections/list.hfa> 70 70 struct S { 71 71 int f[64]; // FIXME: make "is volatile" consistent; given bug #TBD
Note:
See TracChangeset
for help on using the changeset viewer.