Граф коммитов

8 коммитов

Автор SHA1 Сообщение Дата
Ayke van Laethem
0d646d8e95 builder: add support for Go 1.20
Not all features work yet, but allow it to compile with this Go version.
2023-01-17 08:38:54 +01:00
Ayke van Laethem
5afb63df60 cgo: refactor
This is a large refactor of the cgo package. It should fix a number of
smaller problems and be a bit more strict (like upstream CGo): it for
example requires every Go file in a package to include the header files
it needs instead of piggybacking on imports in earlier files.

The main benefit is that it should be a bit more maintainable and easier
to add new features in the future (like static functions).

This breaks the tinygo.org/x/bluetooth package, which should be updated
before this change lands.
2022-05-06 17:22:22 +02:00
Ayke van Laethem
c31aef06ba cgo: add support for C.CString and related functions 2021-11-24 21:09:29 +01:00
Ayke van Laethem
cceb655874 cgo: run CGo parser for all CGo fragments in a file
Previously, libclang was run on each fragment (import "C") separately.
However, in regular Go it's possible for later fragments to refer to
types in earlier fragments so they must have been parsed as one.

This commit changes the behavior to run only one C parser invocation for
each Go file.
2021-11-04 22:26:33 +01:00
Ayke van Laethem
138add2b96 cgo: fix line/column reporting in syntax error messages 2021-09-28 18:44:11 +02:00
Ayke van Laethem
70f8eeaca0 cgo: parse binary operators
This follows the Pratt parser design.
2021-05-21 17:54:13 +02:00
Elliott Sales de Andrade
b689f14bb2 Add support for Go 1.16. 2021-02-19 23:46:55 +01:00
Ayke van Laethem
6a1bb134f9 cgo: add tests for errors
This commit adds tests for CGo preprocessing. There are various errors
that can be reported while preprocessing, and they should integrate well
with the compiler (including accurate source location tracking).

Also allow CGo preprocessing to continue after Clang encountered an
error, for a better view of what happened.
2019-11-25 09:32:03 +01:00