Skip to content
Success

Changes

Summary

  1. Fix #276; add support for c-array parameters using dependent lengths. (details)
  2. Update the enumeration proposal with some updates now that the rework is complete. Deleted the old thesis draft. (details)
  3. Try to fix arch-specific test failure from my last commit (details)
  4. Try 2 to fix arch-specific test failure from my last commit (details)
Commit 81e768d1c7e5b625cf5e14ca13ea80c649602ad5 by Michael Brooks
Fix #276; add support for c-array parameters using dependent lengths.

Without this fix, declarations like
void f( int m, int n, float[m][n] );
would either
- generate bad C code, with unmangled variable names appearing in the function definition, or
- refuse to resolve a valid-c call of such a function.

tests/array-collections/c-dependent: add direct tests of such cases
tests/tuplearray: activate and expand cases which were blocked on #276
tests/array: activate case fm5y, which was blocked on #276; [noise] adjust source line numbers in .expect
tests/typedefRedef: expand coverage of "error, an array detail is different" cases; [noise] adjust source line numbers in .expect
tests/functions: [noise] adjust .expect to have resolved array sizes (extra casts) in the diffed code dump

The fix is:
- (ResolvExpr/ResolveTypeof, ResolvExpr/Resolver) Resolve the dimension expressions, where they were missed.
- (ResolvExpr/Resolver) Prevent dimension expressions that are bound to other parameters from escaping in the function's type, to where they are out of scope.  In the f example above, redact the type shown to callers from `void (*)(int, int, float[m][n])` to `void (*)(int, int, float[][*])`.
- (ResolvExpr/Unify) Relax the matching rules for such a type, when used at a call site, letting the patameters wildcard type match with the concrete type in scope at the caller's side.
- (Validate/ReplaceTypedef) Apply the former, stricter matching rules to the one place where they are still needed: detecting inconsistent typedefs.
The file was modifiedsrc/ResolvExpr/ResolveTypeof.cpp
The file was modifiedsrc/Validate/ReplaceTypedef.cpp
The file was modifiedtests/.expect/functions.x86.txt
The file was modifiedtests/array.cfa
The file was modifiedtests/.expect/functions.arm64.txt
The file was modifiedtests/.expect/typedefRedef.txt
The file was modifiedtests/typedefRedef.cfa
The file was modifiedsrc/ResolvExpr/Resolver.cpp
The file was modifiedsrc/ResolvExpr/Unify.cpp
The file was addedtests/array-collections/.expect/c-dependent.txt
The file was modifiedtests/.expect/typedefRedef-ERR1.txt
The file was modifiedtests/.expect/tuplearray.txt
The file was addedtests/array-collections/c-dependent.cfa
The file was modifiedtests/.expect/array-ERR1.txt
The file was modifiedtests/.expect/array.txt
The file was modifiedtests/.expect/functions.x64.txt
The file was modifiedtests/tuplearray.cfa
The file was modifiedtests/.expect/array-ERR2.txt
The file was modifiedtests/.expect/array-ERR3.txt
Commit 46c4deae2f30b239301bab9eba643e6846b4983d by ajbeach
Update the enumeration proposal with some updates now that the rework is complete. Deleted the old thesis draft.
The file was removeddoc/proposals/enum.tex
The file was addeddoc/proposals/enums.md
The file was removeddoc/proposals/alt-enums.md
Commit 730992a46db1e678f1efc3eadd79eb3111ea6ef9 by Michael Brooks
Try to fix arch-specific test failure from my last commit
The file was modifiedtests/.expect/functions.x86.txt
Commit 718601e180b4bc52849b853fe3f82c00ceb387e5 by Michael Brooks
Try 2 to fix arch-specific test failure from my last commit
The file was modifiedtests/.expect/functions.x86.txt