Changes in / [509ec82:3e2e9b2]
- Files:
-
- 2 added
- 3 deleted
- 18 edited
-
doc/proposals/alt-enums.md (added)
-
doc/proposals/enum.tex (added)
-
doc/proposals/enums.md (deleted)
-
libcfa/src/concurrency/future.hfa (modified) (2 diffs)
-
src/ResolvExpr/ResolveTypeof.cpp (modified) (2 diffs)
-
src/ResolvExpr/Resolver.cpp (modified) (4 diffs)
-
src/ResolvExpr/Unify.cpp (modified) (1 diff)
-
src/Validate/ReplaceTypedef.cpp (modified) (4 diffs)
-
tests/.expect/array-ERR1.txt (modified) (2 diffs)
-
tests/.expect/array-ERR2.txt (modified) (1 diff)
-
tests/.expect/array-ERR3.txt (modified) (1 diff)
-
tests/.expect/array.txt (modified) (1 diff)
-
tests/.expect/functions.arm64.txt (modified) (1 diff)
-
tests/.expect/functions.x64.txt (modified) (1 diff)
-
tests/.expect/functions.x86.txt (modified) (1 diff)
-
tests/.expect/tuplearray.txt (modified) (1 diff)
-
tests/.expect/typedefRedef-ERR1.txt (modified) (1 diff)
-
tests/.expect/typedefRedef.txt (modified) (1 diff)
-
tests/array-collections/.expect/c-dependent.txt (deleted)
-
tests/array-collections/c-dependent.cfa (deleted)
-
tests/array.cfa (modified) (2 diffs)
-
tests/tuplearray.cfa (modified) (2 diffs)
-
tests/typedefRedef.cfa (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/future.hfa
r509ec82 r3e2e9b2 9 9 // Author : Thierry Delisle & Peiran Hong & Colby Parsons 10 10 // Created On : Wed Jan 06 17:33:18 2021 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Nov 29 16:07:34 202413 // Update Count : 3011 // Last Modified By : 12 // Last Modified On : 13 // Update Count : 14 14 // 15 15 … … 23 23 //---------------------------------------------------------------------------- 24 24 // future 25 // I don't use future_t here as I need to use a lock for this future since it supports multiple consumers. 26 // future_t is lockfree and uses atomics which aren't needed given we use locks here 25 // I don't use future_t here since I need to use a lock for this future 26 // since it supports multiple consumers 27 // future_t is lockfree and uses atomics which aren't needed given we use locks here 27 28 forall( T ) { 28 enum { FUTURE_EMPTY = 0, FUTURE_FULFILLED = 1 }; 29 // enum { FUTURE_EMPTY = 0, FUTURE_FULFILLED = 1 }; // Enums seem to be broken so feel free to add this back afterwards 30 31 // temporary enum replacement 32 const int FUTURE_EMPTY = 0; 33 const int FUTURE_FULFILLED = 1; 29 34 30 35 struct future { -
src/ResolvExpr/ResolveTypeof.cpp
r509ec82 r3e2e9b2 88 88 FixArrayDimension(const ResolveContext & context) : context( context ) {} 89 89 90 template< typename PtrType > 91 const PtrType * previsitImpl( const PtrType * type ) { 92 // Note: resolving dimension expressions seems to require duplicate logic, 93 // here and Resolver.cpp: handlePtrType 94 95 if (!type->dimension) return type; 96 auto mutType = mutate(type); 90 const ast::ArrayType * previsit (const ast::ArrayType * arrayType) { 91 if (!arrayType->dimension) return arrayType; 92 auto mutType = mutate(arrayType); 97 93 auto globalSizeType = context.global.sizeType; 98 94 ast::ptr<ast::Type> sizetype = globalSizeType ? globalSizeType : new ast::BasicType( ast::BasicKind::LongUnsignedInt ); 99 mutType->dimension = findSingleExpression( type->dimension, sizetype, context );95 mutType->dimension = findSingleExpression(arrayType->dimension, sizetype, context ); 100 96 101 97 if (InitTweak::isConstExpr(mutType->dimension)) { … … 106 102 } 107 103 return mutType; 108 }109 110 const ast::ArrayType * previsit (const ast::ArrayType * arrayType) {111 return previsitImpl( arrayType );112 }113 114 const ast::PointerType * previsit (const ast::PointerType * pointerType) {115 return previsitImpl( pointerType );116 104 } 117 105 }; -
src/ResolvExpr/Resolver.cpp
r509ec82 r3e2e9b2 494 494 } 495 495 496 // Returns a version of `ty`, with some detail redacted.497 // `ty` is that of a parameter or return of `functionDecl`.498 // Redaction:499 // - concerns the dimension expression, when `ty` is a pointer or array500 // - prevents escape of variables bound by other parameter declarations501 // - replaces the whole dimension with `*` if it uses such a variable502 // - produces the caller's view of `functionDecl`, where `ty` is from the callee/body's view503 // Example 1504 // functionDecl: void f( int n, float a[][5][n + 1] );505 // outcome: f : void (*)( int , float [][5][*] ), redaction on deepest ArrayType506 // Example 2507 // functionDecl: void f( int n, float a[n] );508 // outcome: f : void (*)( int , float [*] ), redaction on PointerType509 // Example 3510 // in scope: int n;511 // functionDecl: void f( float a[][n] );512 // outcome: f : void (*)( float [][n] ), no redaction513 static const ast::Type * redactBoundDimExprs(514 const ast::Type * ty,515 const ast::FunctionDecl * functionDecl516 );517 struct UsesParams {518 const ast::FunctionDecl * functionDecl;519 UsesParams( const ast::FunctionDecl * functionDecl ) : functionDecl(functionDecl) {}520 bool result = false;521 void postvisit( const ast::VariableExpr * e ) {522 for ( auto p : functionDecl->params ) {523 if ( p.get() == e->var ) result = true;524 }525 }526 };527 struct Redactor {528 const ast::FunctionDecl * functionDecl;529 Redactor( const ast::FunctionDecl * functionDecl ) : functionDecl(functionDecl) {}530 template< typename PtrType >531 const PtrType * postvisitImpl( const PtrType * type ) {532 if ( type->dimension && ast::Pass<UsesParams>::read( type->dimension.get(), functionDecl ) ) {533 // PtrType * newtype = ast::shallowCopy( type );534 // newtype->dimension = nullptr;535 // type = newtype;536 auto mutType = mutate(type);537 mutType->dimension = nullptr;538 type = mutType;539 }540 return type;541 }542 543 const ast::ArrayType * postvisit (const ast::ArrayType * arrayType) {544 return postvisitImpl( arrayType );545 }546 547 const ast::PointerType * postvisit (const ast::PointerType * pointerType) {548 return postvisitImpl( pointerType );549 }550 };551 static const ast::Type * redactBoundDimExprs(552 const ast::Type * ty,553 const ast::FunctionDecl * functionDecl554 ) {555 if ( ast::Pass<UsesParams>::read( ty, functionDecl ) ) {556 ast::Type * newty = ast::deepCopy( ty );557 ast::Pass<Redactor> visitor(functionDecl);558 ty = newty->accept(visitor);559 }560 return ty;561 }562 563 496 const ast::FunctionDecl * Resolver::previsit( const ast::FunctionDecl * functionDecl ) { 564 497 GuardValue( functionReturn ); … … 601 534 param = fixObjectType(param.strict_as<ast::ObjectDecl>(), context); 602 535 symtab.addId(param); 603 auto exportParamT = redactBoundDimExprs( param->get_type(), mutDecl ); 604 paramTypes.emplace_back( exportParamT ); 536 paramTypes.emplace_back(param->get_type()); 605 537 } 606 538 for (auto & ret : mutDecl->returns) { 607 539 ret = fixObjectType(ret.strict_as<ast::ObjectDecl>(), context); 608 auto exportRetT = redactBoundDimExprs( ret->get_type(), mutDecl ); 609 returnTypes.emplace_back( exportRetT ); 540 returnTypes.emplace_back(ret->get_type()); 610 541 } 611 542 // since function type in decl is just a view of param types, need to update that as well … … 768 699 template< typename PtrType > 769 700 const PtrType * handlePtrType( const PtrType * type, const ResolveContext & context ) { 770 // Note: resolving dimension expressions seems to require duplicate logic,771 // here and ResolveTypeof.cpp:fixArrayType.772 701 if ( type->dimension ) { 773 702 const ast::Type * sizeType = context.global.sizeType.get(); … … 775 704 assertf(dimension->env->empty(), "array dimension expr has nonempty env"); 776 705 dimension.get_and_mutate()->env = nullptr; 777 type =ast::mutate_field( type, &PtrType::dimension, dimension );706 ast::mutate_field( type, &PtrType::dimension, dimension ); 778 707 } 779 708 return type; -
src/ResolvExpr/Unify.cpp
r509ec82 r3e2e9b2 292 292 if ( !array2 ) return; 293 293 294 // Permit cases where one side has a dimension or isVarLen, 295 // while the other side is the opposite. 296 // Acheves a wildcard-iterpretation semantics, where lack of 297 // dimension (`float a[]` or `float a[25][*]`) means 298 // "anything here is fine." 299 // Sole known case where a verbatim-match semantics is intended 300 // is typedef redefinition, for which extra checking is added 301 // in src/Validate/ReplaceTypedef.cpp. 302 303 if ( array->dimension && array2->dimension ) { 294 if ( array->isVarLen != array2->isVarLen ) return; 295 if ( (array->dimension != nullptr) != (array2->dimension != nullptr) ) return; 296 297 if ( array->dimension ) { 304 298 assert( array2->dimension ); 305 299 // type unification calls expression unification (mutual recursion) -
src/Validate/ReplaceTypedef.cpp
r509ec82 r3e2e9b2 120 120 } 121 121 } 122 122 123 struct VarLenChecker : public ast::WithShortCircuiting { 123 124 bool result = false; … … 125 126 void previsit( ast::ArrayType const * at ) { result |= at->isVarLen; } 126 127 }; 127 static bool hasVarLen( const ast::Type * t ) { 128 return ast::Pass<VarLenChecker>::read( t ); 129 } 130 struct ArrayTypeExtractor { 131 std::vector<const ast::ArrayType *> result; 132 void postvisit( const ast::ArrayType * at ) { 133 result.push_back( at ); 134 } 135 }; 136 static bool dimensionPresenceMismatched( const ast::Type * t0, const ast::Type * t1) { 137 std::vector<const ast::ArrayType *> at0s = std::move( 138 ast::Pass<ArrayTypeExtractor>::read( t0 ) ); 139 std::vector<const ast::ArrayType *> at1s = std::move( 140 ast::Pass<ArrayTypeExtractor>::read( t1 ) ); 141 assert( at0s.size() == at1s.size() ); 142 for (size_t i = 0; i < at0s.size(); i++) { 143 const ast::ArrayType * at0 = at0s[i]; 144 const ast::ArrayType * at1 = at1s[i]; 145 assert( ResolvExpr::typesCompatible( at0, at1 ) ); 146 if ( (at0->dimension != nullptr) != (at1->dimension != nullptr) ) return true; 147 } 148 return false; 149 } 128 150 129 ast::Decl const * ReplaceTypedefCore::postvisit( 151 130 ast::TypedefDecl const * decl ) { … … 154 133 ast::Type const * t0 = decl->base; 155 134 ast::Type const * t1 = typedefNames[ decl->name ].first->base; 156 // [hasVarLen]157 135 // Cannot redefine VLA typedefs. Note: this is slightly incorrect, 158 136 // because our notion of VLAs at this point in the translator is … … 161 139 // constant/enumerator. The effort required to fix this corner case 162 140 // likely outweighs the utility of allowing it. 163 // [dimensionPresenceMismatched]164 // Core typesCompatible logic interprets absent dimensions as wildcards,165 // i.e. float[][*] matches float[][42].166 // For detecting incompatible typedefs, we have to interpret them verbatim,167 // i.e. float[] is different than float[42].168 // But typesCompatible does assure that the pair of types is structurally169 // consistent, outside of the dimension expressions. This assurance guards170 // the dimension-presence traversal. So this traversal logic can (and does)171 // assume that ArrayTypes will be encountered in analogous places.172 141 if ( !ResolvExpr::typesCompatible( t0, t1 ) 173 || hasVarLen( t0 ) 174 || hasVarLen( t1 ) 175 || dimensionPresenceMismatched( t0, t1 ) ) { 142 || ast::Pass<VarLenChecker>::read( t0 ) 143 || ast::Pass<VarLenChecker>::read( t1 ) ) { 176 144 SemanticError( decl->location, "Cannot redefine typedef %s", decl->name.c_str() ); 177 145 } -
tests/.expect/array-ERR1.txt
r509ec82 r3e2e9b2 1 array.cfa:1 25:25: warning: Preprocessor started1 array.cfa:119:25: warning: Preprocessor started 2 2 array.cfa:40:22: error: '[*]' not allowed in other than function prototype scope 3 3 array.cfa:46:24: error: '[*]' not allowed in other than function prototype scope … … 5 5 array.cfa:52:16: error: array size missing in '_X2a1A0i_2' 6 6 array.cfa:53:26: error: '[*]' not allowed in other than function prototype scope 7 array.cfa: At top level:8 array.cfa:64:1: error: '[*]' not allowed in other than function prototype scope -
tests/.expect/array-ERR2.txt
r509ec82 r3e2e9b2 1 array.cfa:1 25:25: warning: Preprocessor started2 array.cfa:1 17:32: error: syntax error, unexpected STATIC before token "static"1 array.cfa:119:25: warning: Preprocessor started 2 array.cfa:109:32: error: syntax error, unexpected STATIC before token "static" -
tests/.expect/array-ERR3.txt
r509ec82 r3e2e9b2 1 array.cfa:1 25:25: warning: Preprocessor started2 array.cfa:11 8:32: error: syntax error, unexpected ']' before token "]"1 array.cfa:119:25: warning: Preprocessor started 2 array.cfa:110:32: error: syntax error, unexpected ']' before token "]" -
tests/.expect/array.txt
r509ec82 r3e2e9b2 1 array.cfa:1 25:25: warning: Preprocessor started1 array.cfa:119:25: warning: Preprocessor started -
tests/.expect/functions.arm64.txt
r509ec82 r3e2e9b2 310 310 __attribute__ ((unused)) const struct _conc__tuple2_3 _X10_retval_f5KT2PiKi_1; 311 311 } 312 signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(signed int (*__anonymous_object42)(void), signed int *(*__anonymous_object43)(void), signed int **(*__anonymous_object44)(void), signed int *const *(*__anonymous_object45)(void), signed int *const *const (*__anonymous_object46)(void), signed int *__anonymous_object47, signed int __anonymous_object48[ ((unsigned long int )10)], signed int **__anonymous_object49, signed int *__anonymous_object50[((unsigned long int )10)], signed int ***__anonymous_object51, signed int **__anonymous_object52[((unsigned long int )10)], signed int *const **__anonymous_object53, signed int *const *__anonymous_object54[((unsigned long int )10)], signed int *const *const *__anonymous_object55, signed int *const *const __anonymous_object56[((unsigned long int )10)]);313 signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(__attribute__ ((unused)) signed int (*__anonymous_object57)(void), __attribute__ ((unused)) signed int *(*__anonymous_object58)(void), __attribute__ ((unused)) signed int **(*__anonymous_object59)(void), __attribute__ ((unused)) signed int *const *(*__anonymous_object60)(void), __attribute__ ((unused)) signed int *const *const (*__anonymous_object61)(void), __attribute__ ((unused)) signed int *__anonymous_object62, __attribute__ ((unused)) signed int __anonymous_object63[ ((unsigned long int )10)], __attribute__ ((unused)) signed int **__anonymous_object64, __attribute__ ((unused)) signed int *__anonymous_object65[((unsigned long int )10)], __attribute__ ((unused)) signed int ***__anonymous_object66, __attribute__ ((unused)) signed int **__anonymous_object67[((unsigned long int )10)], __attribute__ ((unused)) signed int *const **__anonymous_object68, __attribute__ ((unused)) signed int *const *__anonymous_object69[((unsigned long int )10)], __attribute__ ((unused)) signed int *const *const *__anonymous_object70, __attribute__ ((unused)) signed int *const *const __anonymous_object71[((unsigned long int )10)]){312 signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(signed int (*__anonymous_object42)(void), signed int *(*__anonymous_object43)(void), signed int **(*__anonymous_object44)(void), signed int *const *(*__anonymous_object45)(void), signed int *const *const (*__anonymous_object46)(void), signed int *__anonymous_object47, signed int __anonymous_object48[10], signed int **__anonymous_object49, signed int *__anonymous_object50[10], signed int ***__anonymous_object51, signed int **__anonymous_object52[10], signed int *const **__anonymous_object53, signed int *const *__anonymous_object54[10], signed int *const *const *__anonymous_object55, signed int *const *const __anonymous_object56[10]); 313 signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(__attribute__ ((unused)) signed int (*__anonymous_object57)(void), __attribute__ ((unused)) signed int *(*__anonymous_object58)(void), __attribute__ ((unused)) signed int **(*__anonymous_object59)(void), __attribute__ ((unused)) signed int *const *(*__anonymous_object60)(void), __attribute__ ((unused)) signed int *const *const (*__anonymous_object61)(void), __attribute__ ((unused)) signed int *__anonymous_object62, __attribute__ ((unused)) signed int __anonymous_object63[10], __attribute__ ((unused)) signed int **__anonymous_object64, __attribute__ ((unused)) signed int *__anonymous_object65[10], __attribute__ ((unused)) signed int ***__anonymous_object66, __attribute__ ((unused)) signed int **__anonymous_object67[10], __attribute__ ((unused)) signed int *const **__anonymous_object68, __attribute__ ((unused)) signed int *const *__anonymous_object69[10], __attribute__ ((unused)) signed int *const *const *__anonymous_object70, __attribute__ ((unused)) signed int *const *const __anonymous_object71[10]){ 314 314 __attribute__ ((unused)) signed int _X9_retval_fi_1; 315 315 } -
tests/.expect/functions.x64.txt
r509ec82 r3e2e9b2 310 310 __attribute__ ((unused)) const struct _conc__tuple2_3 _X10_retval_f5KT2PiKi_1; 311 311 } 312 signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(signed int (*__anonymous_object42)(void), signed int *(*__anonymous_object43)(void), signed int **(*__anonymous_object44)(void), signed int *const *(*__anonymous_object45)(void), signed int *const *const (*__anonymous_object46)(void), signed int *__anonymous_object47, signed int __anonymous_object48[ ((unsigned long int )10)], signed int **__anonymous_object49, signed int *__anonymous_object50[((unsigned long int )10)], signed int ***__anonymous_object51, signed int **__anonymous_object52[((unsigned long int )10)], signed int *const **__anonymous_object53, signed int *const *__anonymous_object54[((unsigned long int )10)], signed int *const *const *__anonymous_object55, signed int *const *const __anonymous_object56[((unsigned long int )10)]);313 signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(__attribute__ ((unused)) signed int (*__anonymous_object57)(void), __attribute__ ((unused)) signed int *(*__anonymous_object58)(void), __attribute__ ((unused)) signed int **(*__anonymous_object59)(void), __attribute__ ((unused)) signed int *const *(*__anonymous_object60)(void), __attribute__ ((unused)) signed int *const *const (*__anonymous_object61)(void), __attribute__ ((unused)) signed int *__anonymous_object62, __attribute__ ((unused)) signed int __anonymous_object63[ ((unsigned long int )10)], __attribute__ ((unused)) signed int **__anonymous_object64, __attribute__ ((unused)) signed int *__anonymous_object65[((unsigned long int )10)], __attribute__ ((unused)) signed int ***__anonymous_object66, __attribute__ ((unused)) signed int **__anonymous_object67[((unsigned long int )10)], __attribute__ ((unused)) signed int *const **__anonymous_object68, __attribute__ ((unused)) signed int *const *__anonymous_object69[((unsigned long int )10)], __attribute__ ((unused)) signed int *const *const *__anonymous_object70, __attribute__ ((unused)) signed int *const *const __anonymous_object71[((unsigned long int )10)]){312 signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(signed int (*__anonymous_object42)(void), signed int *(*__anonymous_object43)(void), signed int **(*__anonymous_object44)(void), signed int *const *(*__anonymous_object45)(void), signed int *const *const (*__anonymous_object46)(void), signed int *__anonymous_object47, signed int __anonymous_object48[10], signed int **__anonymous_object49, signed int *__anonymous_object50[10], signed int ***__anonymous_object51, signed int **__anonymous_object52[10], signed int *const **__anonymous_object53, signed int *const *__anonymous_object54[10], signed int *const *const *__anonymous_object55, signed int *const *const __anonymous_object56[10]); 313 signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(__attribute__ ((unused)) signed int (*__anonymous_object57)(void), __attribute__ ((unused)) signed int *(*__anonymous_object58)(void), __attribute__ ((unused)) signed int **(*__anonymous_object59)(void), __attribute__ ((unused)) signed int *const *(*__anonymous_object60)(void), __attribute__ ((unused)) signed int *const *const (*__anonymous_object61)(void), __attribute__ ((unused)) signed int *__anonymous_object62, __attribute__ ((unused)) signed int __anonymous_object63[10], __attribute__ ((unused)) signed int **__anonymous_object64, __attribute__ ((unused)) signed int *__anonymous_object65[10], __attribute__ ((unused)) signed int ***__anonymous_object66, __attribute__ ((unused)) signed int **__anonymous_object67[10], __attribute__ ((unused)) signed int *const **__anonymous_object68, __attribute__ ((unused)) signed int *const *__anonymous_object69[10], __attribute__ ((unused)) signed int *const *const *__anonymous_object70, __attribute__ ((unused)) signed int *const *const __anonymous_object71[10]){ 314 314 __attribute__ ((unused)) signed int _X9_retval_fi_1; 315 315 } -
tests/.expect/functions.x86.txt
r509ec82 r3e2e9b2 310 310 __attribute__ ((unused)) const struct _conc__tuple2_3 _X10_retval_f5KT2PiKi_1; 311 311 } 312 signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(signed int (*__anonymous_object42)(void), signed int *(*__anonymous_object43)(void), signed int **(*__anonymous_object44)(void), signed int *const *(*__anonymous_object45)(void), signed int *const *const (*__anonymous_object46)(void), signed int *__anonymous_object47, signed int __anonymous_object48[ ((unsigned int )10)], signed int **__anonymous_object49, signed int *__anonymous_object50[((unsigned int )10)], signed int ***__anonymous_object51, signed int **__anonymous_object52[((unsigned int )10)], signed int *const **__anonymous_object53, signed int *const *__anonymous_object54[((unsigned int )10)], signed int *const *const *__anonymous_object55, signed int *const *const __anonymous_object56[((unsigned int )10)]);313 signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(__attribute__ ((unused)) signed int (*__anonymous_object57)(void), __attribute__ ((unused)) signed int *(*__anonymous_object58)(void), __attribute__ ((unused)) signed int **(*__anonymous_object59)(void), __attribute__ ((unused)) signed int *const *(*__anonymous_object60)(void), __attribute__ ((unused)) signed int *const *const (*__anonymous_object61)(void), __attribute__ ((unused)) signed int *__anonymous_object62, __attribute__ ((unused)) signed int __anonymous_object63[ ((unsigned int )10)], __attribute__ ((unused)) signed int **__anonymous_object64, __attribute__ ((unused)) signed int *__anonymous_object65[((unsigned int )10)], __attribute__ ((unused)) signed int ***__anonymous_object66, __attribute__ ((unused)) signed int **__anonymous_object67[((unsigned int )10)], __attribute__ ((unused)) signed int *const **__anonymous_object68, __attribute__ ((unused)) signed int *const *__anonymous_object69[((unsigned int )10)], __attribute__ ((unused)) signed int *const *const *__anonymous_object70, __attribute__ ((unused)) signed int *const *const __anonymous_object71[((unsigned int )10)]){312 signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(signed int (*__anonymous_object42)(void), signed int *(*__anonymous_object43)(void), signed int **(*__anonymous_object44)(void), signed int *const *(*__anonymous_object45)(void), signed int *const *const (*__anonymous_object46)(void), signed int *__anonymous_object47, signed int __anonymous_object48[10], signed int **__anonymous_object49, signed int *__anonymous_object50[10], signed int ***__anonymous_object51, signed int **__anonymous_object52[10], signed int *const **__anonymous_object53, signed int *const *__anonymous_object54[10], signed int *const *const *__anonymous_object55, signed int *const *const __anonymous_object56[10]); 313 signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(__attribute__ ((unused)) signed int (*__anonymous_object57)(void), __attribute__ ((unused)) signed int *(*__anonymous_object58)(void), __attribute__ ((unused)) signed int **(*__anonymous_object59)(void), __attribute__ ((unused)) signed int *const *(*__anonymous_object60)(void), __attribute__ ((unused)) signed int *const *const (*__anonymous_object61)(void), __attribute__ ((unused)) signed int *__anonymous_object62, __attribute__ ((unused)) signed int __anonymous_object63[10], __attribute__ ((unused)) signed int **__anonymous_object64, __attribute__ ((unused)) signed int *__anonymous_object65[10], __attribute__ ((unused)) signed int ***__anonymous_object66, __attribute__ ((unused)) signed int **__anonymous_object67[10], __attribute__ ((unused)) signed int *const **__anonymous_object68, __attribute__ ((unused)) signed int *const *__anonymous_object69[10], __attribute__ ((unused)) signed int *const *const *__anonymous_object70, __attribute__ ((unused)) signed int *const *const __anonymous_object71[10]){ 314 314 __attribute__ ((unused)) signed int _X9_retval_fi_1; 315 315 } -
tests/.expect/tuplearray.txt
r509ec82 r3e2e9b2 9 9 1, 2 10 10 1, 2 11 2, 412 2, 413 2, 414 2, 415 2, 416 2, 417 2, 418 2, 419 2, 420 2, 4 -
tests/.expect/typedefRedef-ERR1.txt
r509ec82 r3e2e9b2 1 typedefRedef.cfa: 87:25: warning: Compiled1 typedefRedef.cfa:75:25: warning: Compiled 2 2 typedefRedef.cfa:4:1 error: Cannot redefine typedef Foo 3 3 typedefRedef.cfa:31:1 error: Cannot redefine typedef ARR 4 typedefRedef.cfa:37:1 error: Cannot redefine typedef ARRSa 5 typedefRedef.cfa:43:1 error: Cannot redefine typedef ARRSb 6 typedefRedef.cfa:77:1 error: Cannot redefine typedef ARR 4 typedefRedef.cfa:65:1 error: Cannot redefine typedef ARR -
tests/.expect/typedefRedef.txt
r509ec82 r3e2e9b2 1 typedefRedef.cfa: 87:25: warning: Compiled1 typedefRedef.cfa:75:25: warning: Compiled -
tests/array.cfa
r509ec82 r3e2e9b2 57 57 } 58 58 59 int fred2(int n,60 int a1[],61 E1( int a2[*], )62 int a4[3],63 int T[3],64 int a5[n]65 ) {}66 67 59 int mary( int T[3], // same as: int *T 68 60 int p1[const 3], // same as: int const *p1 … … 118 110 E3( int fm4( int r, int c, int m[][] ); ) // m's immediate element type is incomplete 119 111 int fm5x( int, int, int[*][*] ); // same as fm1 decl 120 int fm5y( int r, int c, int m[r][c] ) {} // same as fm1 defn 121 112 #ifndef __cforall 113 int fm5y( int r, int c, int m[r][c] ) {} // BUG 276: CFA chokes but should accept 114 // C: same as fm1 defn 115 #endif 122 116 123 117 -
tests/tuplearray.cfa
r509ec82 r3e2e9b2 20 20 [void] bar12( * [3][10] [int,int] f ); 21 21 22 [void] foo1( [10] [int,int] f ) { 23 for ( i; 10 ) f[i] = [1, 2]; 24 } 25 [void] foo2( size_t size, [size] [int,int] f ) { 26 for ( i; size ) f[i] = [2, 4]; 22 //[void] foo( size_t size, [size] [int,int] f ) { 23 [void] foo( size_t size, [10] [int,int] f ) { 24 for ( i; size ) f[i] = [1, 2]; 27 25 } 28 26 … … 31 29 // [int,int] arr[10]; // unimplemented 32 30 33 foo1( arr ); 34 for ( i; 10 ) sout | arr[i]; 35 36 foo2( 10, arr ); 31 foo( 10, arr ); 37 32 for ( i; 10 ) sout | arr[i]; 38 33 } -
tests/typedefRedef.cfa
r509ec82 r3e2e9b2 30 30 // if a typedef has an array dimension, it can only be redefined to the same dimension 31 31 typedef int ARR[2]; 32 #endif33 34 typedef [ float[], char[], int[] ] ARRSa;35 typedef [ float[], char[], int[] ] ARRSa;36 #ifdef ERR137 typedef [ float[], char[2], int[] ] ARRSa;38 #endif39 40 typedef int ARRSb[][1][2][3];41 typedef int ARRSb[][1][2][3];42 #ifdef ERR143 typedef int ARRSb[][1][2][99];44 32 #endif 45 33
Note:
See TracChangeset
for help on using the changeset viewer.