Commit Graph

3816 Commits

Author SHA1 Message Date
Ryan Scott
84b29a3721 CI: Install diff, gcc, gmp, make on Windows before running tests
These are required to run some of the FFI tests.
2022-09-24 11:21:08 -04:00
Ryan Scott
27ac8d9717 Support FFI on Windows
This patch:

* Adds the appropriate conditional logic to use the `Win32` library to
  dynamically load shared libraries on Windows.
* Tweaks some FFI-related test cases to make them work portably on Windows. I
  have left comments describing each of the non-obvious tweaks that I had to
  make.
* Updates the reference manual accordingly.

Fixes #1394.
2022-09-24 11:21:03 -04:00
Iavor Diatchki
b72a5d97bd Don't try to get information for undefined names.
When we find an undefined name we record an error,
but we also generate a fake name, so that we can continue
processing and report other errors.  It is important
that we don't try to use this fake name.

This commit corrects this behavior where we'd try to get
information about an undefined intrface submodule.

Fixes #1440
2022-09-24 15:37:35 +03:00
Iavor Diatchki
09b68e2ae1 Fix typos in comments 2022-09-24 15:34:35 +03:00
Iavor S. Diatchki
146934b9d3
Merge pull request #1432 from GaloisInc/ffi-integer
Support `Integer`, `Z`, and `Rational` in FFI
2022-09-23 18:44:07 +03:00
Iavor Diatchki
96fb52dc9c Fix Mac OS test 2022-09-23 17:47:50 +03:00
Iavor Diatchki
c3f6181204 Add a couple of tests with Z 2022-09-23 17:13:14 +03:00
Iavor Diatchki
741959f918 Add gmp as en explicit dependency 2022-09-22 19:10:12 +03:00
Iavor Diatchki
e7a3f87858 Update FFI Section of Reference Manual to describe Integer/Rational/Z 2022-09-22 18:30:03 +03:00
Iavor Diatchki
4e75c38330 Modify generate-header to support Integer/Rational/Z
Add some tests
2022-09-22 17:15:04 +03:00
Iavor Diatchki
12f2bb086e Merge branch 'master' into ffi-integer 2022-09-22 16:18:36 +03:00
Iavor Diatchki
cb43685abc Just cosmeic tweaks 2022-09-22 16:17:22 +03:00
Iavor Diatchki
ddcc67b1cb Resolve Has selectors for each nested module separately.
This fixes #1439

See the comment on the new function `selectorScope`
for details.
2022-09-22 15:59:54 +03:00
Iavor Diatchki
516ad74a28 Remove unused functoion 2022-09-22 08:47:02 +03:00
Iavor S. Diatchki
6ab24582e1
Merge pull request #1429 from GaloisInc/ffi-generate-headers
Generate C header files from `foreign` declarations
2022-09-19 09:51:29 +03:00
Ryan Scott
4367eee0d1
Make fromTo and friends return VWord when appropriate (#1436)
Previous, `fromTo` and related functions would always return a `VSeq`. If the
type happened to be a `Bit`, this would violate the internal invariant that
sequences of `Bit`s are always represented with `VWord`s, leading to the panics
observed in #1435. This patch fixes the issue by using the `mkSeq` smart
constructor, which chooses between `VWord` and `VSeq` depending on the sequence
type.

Fixes #1435.
2022-09-17 10:48:15 -04:00
Iavor Diatchki
d241e4945b Restrict the names allowed in foreign declarations.
For now we allow alpha numeric characters and '_' which
should be fairly portable.
2022-09-14 18:37:34 +03:00
Iavor Diatchki
85c3f43840 Escape weird names (mostly quotes) in type parameters and record fields. 2022-09-14 18:21:26 +03:00
Iavor Diatchki
5a4a3967fc Merge remote-tracking branch 'origin/master' into ffi-generate-headers
# Conflicts:
#	docs/RefMan/_build/doctrees/FFI.doctree
#	docs/RefMan/_build/doctrees/environment.pickle
#	docs/RefMan/_build/html/FFI.html
#	docs/RefMan/_build/html/searchindex.js
2022-09-14 17:18:30 +03:00
Iavor S. Diatchki
6fd1a115e3
Merge pull request #1416 from GaloisInc/ffi-aes-ni
AES-NI version of SuiteB module using FFI
2022-09-14 16:58:51 +03:00
Iavor S. Diatchki
51b765efd8
Merge pull request #1431 from GaloisInc/ffi-slides
Add FFI presentation slides
2022-09-14 16:40:17 +03:00
Iavor S. Diatchki
f8b5543946
Merge pull request #1380 from GaloisInc/conditional-constraints
Numeric Constraint Guards
2022-09-14 16:38:08 +03:00
Iavor Diatchki
2be867e19d Report an error if we find unsupported constraints 2022-09-13 13:53:46 +03:00
Iavor Diatchki
61ad2527ed Fix pretty printer for propguards 2022-09-13 13:44:22 +03:00
Iavor Diatchki
69719529d2 Merge branch 'master' into conditional-constraints 2022-09-13 13:16:44 +03:00
Iavor Diatchki
44685f09b0 Fix test 2022-09-12 18:42:10 +03:00
Iavor Diatchki
4ef8000c0e Another test 2022-09-12 14:58:18 +03:00
Iavor Diatchki
3dc6c014f9 Clean up translation, and support for nested modules 2022-09-12 14:57:44 +03:00
Iavor Diatchki
16e7d4f751 Fixes to exhaustivness checking 2022-09-12 14:28:16 +03:00
Iavor Diatchki
4f82466a7f Simplify type checking of constraint guards 2022-09-12 11:35:34 +03:00
Bretton
adfb760cad FFI: Update ffi-type-errors test output 2022-09-10 13:09:27 -07:00
Bretton
8732bbee79 FFI: Add comments 2022-09-10 13:05:16 -07:00
Bretton
c5a8b234b6 FFI: Update error message with new types 2022-09-10 03:16:30 -07:00
Bretton
a372df22f9 FFI: Remove now supported types from error test 2022-09-10 03:12:00 -07:00
Bretton
f32a099dc9 FFI: Support Rational 2022-09-10 03:08:37 -07:00
Bretton
4c86ac633b FFI: Support Z 2022-09-10 02:35:07 -07:00
Bretton
daba20a03e FFI: Support Integer 2022-09-10 01:19:57 -07:00
Bretton
387a15e14c Add FFI presentation slides 2022-09-08 18:28:30 -07:00
Bretton
75bc5e1711 gen header: Reorganize code 2022-09-08 18:17:47 -07:00
Bretton
71b6813fb8 gen header: Fix name collision renaming 2022-09-08 18:08:41 -07:00
Bretton
986ec22ac7 gen header: Update refman 2022-09-08 17:39:18 -07:00
Bretton
2dfc6aa553 gen header: Add comments 2022-09-08 16:43:47 -07:00
Bretton
d45e9b9efd Merge branch 'master' into ffi-generate-headers 2022-09-08 16:13:54 -07:00
Bretton
e64603a7be gen header: Add test 2022-09-08 16:12:33 -07:00
Ryan Scott
3d4492a058
CI: Work around GHC installation issues on Windows (#1430)
This should avoid nasty linker errors as observed in
https://gitlab.haskell.org/ghc/ghc/-/issues/21111 until the upstream tools can
be fixed.
2022-09-08 15:57:13 -04:00
Bretton
44c7a98451 gen header: Print write location 2022-09-08 12:54:00 -07:00
Bretton
de4445623c gen header: Add description for command 2022-09-08 12:45:15 -07:00
Bretton
c22404ad6a Add :generate-foreign-header command 2022-09-07 20:54:48 -07:00
Iavor Diatchki
d211e521db Remove "currently" from error message 2022-09-06 19:27:08 +03:00
Iavor Diatchki
fb3935f41b * Introduce a separate type for a property guarded alternative
* Annotate each property with a location
* Disallow property guards with index declarations
  (maybe this could be made to work, but be conservative for now)
* Require signatures on all members of a recursive group with prop guards
2022-09-06 18:56:20 +03:00