Commit Graph

39 Commits

Author SHA1 Message Date
Carl Peto
3689427834 [AVR] standard library support for AVR
- when compiling embedded cross compile target standard libraries, include AVR
- add 16-bit pointer as a conditional compilation condition and get the void pointer size right for gyb sources
- attempt to fix clang importer not importing __swift_intptr_t correctly on 16 bit platforms
- changed the unit test target to avr-none-none-elf to match the cmake build

[AVR] got the standard library compiling in a somewhat restricted form:

General
- updated the Embedded Runtime
- tweaked CTypes.swift to fix clang import on 16 bit platforms

Strings
- as discussed in https://forums.swift.org/t/stringguts-stringobject-internals-how-to-layout-on-16-bit-platforms/73130, I went for just using the same basic layout in 16 bit as 32 bit but with 16 bit pointers/ints... the conversation is ongoing, I think something more efficient is possible but at least this compiles and will probably work (inefficiently)

Unicode
- the huge arrays of unicode stuff in UnicodeStubs would not compile, so I skipped it for AVR for now.

Synchronization
- disabled building the Synchronization library on AVR for now. It's arguable if it adds value on this platform anyway.
2024-07-16 12:28:27 +01:00
Alex Hoppen
1ebe7ef6a2 Copy files from SwiftSyntax’s gyb_syntax_support that are relevant to the compiler to this repo
This allows us to evolve e.g. token kinds and how attributes are modelled independently between SwiftSyntax and the compiler. It also makes it easier to e.g. add an attribute because you don’t need to create PRs for two repositories.
2022-12-15 16:40:28 +01:00
Rintaro Ishizaki
d05f45b7f0 [CMake] Don't add unnecessary gyb support .py files
'add_gyb_target' can accept 'DEPENDS'. Utilize it.
2022-12-08 14:49:08 -08:00
Robert Widmann
269dfb4c3b Adapt to the Removal of SerializationCodes.py
See https://github.com/apple/swift-syntax/pull/1089
2022-11-28 16:16:51 -07:00
Doug Gregor
fe05b47c69 Add missing file dependency for gyb'd attribute generation. 2022-09-23 05:59:48 -07:00
Alex Hoppen
3bb4d4d65d Move gyb_syntax_support in swift-syntax from Sources/generate-swift-syntax-builder to Code-Generation 2022-09-23 11:04:27 +02:00
Robert Widmann
f9cff13604 Move All the Gyb Support for Syntax out of Swift
Make libSyntax depend on swift-syntax: the new home for all
of this infrastructure. This greatly simplifies the addition and
amending of syntax nodes as only the swift-syntax paired with a
swift checkout will need to be changed. This is in contrast to
the existing build flow where a paired PR to both repos must be
made to change anything here.

Note that a paired PR may still be required if the legacy parser
needs to be adjusted in response to syntax nodes changing, but I
anticipate this to be a much more infrequent event now that
the C++ end of libSyntax is deprecated.
2022-08-31 13:10:24 -07:00
Argyrios Kyrtzidis
00d3f7d2d4 [CMake] Add some missing dependencies of the gyb custom command invocations 2021-08-16 15:24:02 -07:00
Argyrios Kyrtzidis
35f0744b1c [CMake] Declare the precise dependencies of the gyb custom command invocations 2021-08-10 13:51:54 -07:00
Saleem Abdulrasool
10d15b8bad build: switch gyb to Python3
Change the build system to invoke gyb with python3 instead of python2.
2020-06-19 11:03:31 -07:00
Saleem Abdulrasool
202ee5b020 build: help pave the road for a mixed Python build
LLDB requires python3, however, gyb is a python2 tool.  Use the fact
that we have a newer CMake at our disposal and use the `Python2` package
in CMake to locate a viable python interpreter.  This allows us to have
references to both versions of python simultaneously.
2020-02-12 19:07:01 -08:00
Rintaro Ishizaki
60341baf62 [SyntaxParse] Refactor generic requirement syntax structure
Re-apply a part of 0569cbfb28 after
reverting ASTGen changes. This is still an improvement.
2019-10-21 15:16:56 -07:00
Rintaro Ishizaki
8768832f24 Revert "Merge pull request #27281 from rintaro/reapply-syntaxparse-genericparam"
This reverts commit 5d3e8d6c83, reversing
changes made to 27e881d97e.
2019-10-14 12:46:31 -07:00
Rintaro Ishizaki
bf5aa0a5a1 Revert "Merge pull request #27325 from rintaro/syntaxparse-cctype"
This reverts commit 439b9111b7, reversing
changes made to 4e476ff243.
2019-10-14 12:20:57 -07:00
Rintaro Ishizaki
1a9b6d0dbf [SyntaxParse] Introduce CodeCompletionTypeSyntax
To represent a type with code completion.

  type? '.'? <code-completion-token>

This is "parser only" node which is not exposed to SwiftSyntax.
Using this, defer to set the parsed type to code-completion callbacks.
2019-09-24 10:21:38 -07:00
Rintaro Ishizaki
0569cbfb28 Revert "Revert "[SyntaxParse] Parse generic parameter clause and generic where clause""
This reverts commit 1584e87aa7.
2019-09-20 15:26:04 -07:00
Rintaro Ishizaki
1584e87aa7 Revert "[SyntaxParse] Parse generic parameter clause and generic where clause" 2019-09-20 14:02:53 -07:00
Rintaro Ishizaki
f919b2ddd8 [SyntaxParse] Parse generic parameter clause and generic where clause 2019-09-19 23:09:58 -07:00
Saleem Abdulrasool
8ed5c1a4bc build: introduce and switch to GYB_SOURCES
This avoids us having to pattern match every source file which should
help speed up the CMake generation.  A secondary optimization is
possible with CMake 3.14 which has the ability to remove the last
extension component without having to resort to regular expressions.  It
also helps easily identify the GYB'ed sources.
2019-03-11 13:48:54 -07:00
Alex Hoppen
3e9ae802c2 [libSyntax] Make parsing of attribute arguments more structured
This also fixes several issues where attribute arguments could not be
parsed as a TokenList since some of its arguments already had structure
and were not tokens
2018-04-24 13:18:15 -07:00
Michael Ilseman
c4614a9208 [test] De-gyb stdlib unittest.
StdlibUnittest uses gyb to avoid duplicating many source-context
arguments. However, this means that any test that wishes to add new
expect helpers has to also be gybbed. Given that this structure hasn't
changed in years, and we should have a real language support
eventually, de-gyb it.
2018-04-19 13:06:14 -07:00
Xi Ge
94c3f55117 libSyntax: extract meta-information of trivia kinds to syntax_gyb_support. NFC
The existing libSyntax infrastructure uses external python
dictionaries to share logic between C++ and Swift implementations.
This patch teaches trivia kinds to adapt to this infrastructure
 as well.
2018-03-06 17:45:43 -08:00
Saleem Abdulrasool
2e77e6a8b1 build: tweak gyb line directives
Make the quoted parameters more portable.  This is needed in order to
support building swift on Windows.  Simplify the declaration of the
flags and do a small formatting clean up.  This ensures that the ninja
generation gets the command line invocation correct.
2018-03-01 12:21:54 -08:00
Xi Ge
1a67b5c60e cmake: mark recently added python files as gyb dependencies. 2018-02-21 12:11:00 -08:00
Harlan
a5098e6b69 Generate libSyntax API (#10926)
* Generate libSyntax API

This patch removes the hand-rolled libSyntax API and replaces it with an
API that's entirely automatically generated. This means the API is
guaranteed to be internally stylistically and functionally consistent.
2017-07-25 18:19:58 -07:00
Doug Coleman
f8475f3d50 cmake: Teach cmake that gyb files depend on foo in `gyb.expand('foo.swift.gyb'...)`
Fixes https://bugs.swift.org/browse/SR-4366.
Fixes rdar://problem/31331437.
2017-04-02 22:30:29 -07:00
Doug Coleman
e7390d1770 Revert "utils: Add swiftenvs, which allow the overriding of compiler tools."
This reverts commit 2b923f3846.
2017-03-22 20:09:34 -07:00
Doug Coleman
2b923f3846 utils: Add swiftenvs, which allow the overriding of compiler tools. 2017-03-21 14:59:12 -07:00
Hugh Bellamy
3ad0889847 Add GYB support for Windows 2016-12-22 11:02:59 +00:00
Rintaro Ishizaki
46a6df2f67 [CMake] Remove --test option from normal gyb invocation in CMake 2016-06-10 18:56:17 +09:00
Dmitri Gribenko
fc9c1f6a61 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-26 10:20:31 -07:00
Rintaro Ishizaki
65bd53c842 [CMakeLists] Factored out cmake function that does single gyb processing
So that we can generate arbitrary output file.
2016-04-26 11:58:53 +09:00
Dmitri Gribenko
9f0d94c1b8 CMake: add dependencies on common gyb modules in 'utils/' 2016-04-18 14:00:37 -07:00
Dave Abrahams
37f9dafd5a Include gyb source in build dependencies
Otherwise you can't fix gyb bugs and see the result.  We were including
the top-level driver, but not the Python module file, gyb.py

Swift SVN r32860
2015-10-24 04:47:53 +00:00
Jordan Rose
de9212f821 [CMake] Make gyb sources show up in Xcode's Open Quickly.
Swift SVN r28820
2015-05-20 03:36:49 +00:00
John McCall
2ff77a9cd1 Only import *Ref typedefs as CF types if they have a bridging
attribute or appear in a whitelist.

The initial whitelist is based on an audit I performed of our current
public SDKs.  If there are CF types which appear only in our internal
SDKs, and somebody urgently needs to use them from Swift, they can
adopt the bridging attributes.  The goal is to eventually eliminate
the whitelist and rely solely on bridging attributes anyway.

Sadly, CoreCooling was not included in my SDK audit and must be
explicitly annotated. :(

I've left the main database organized by framework, but I wanted
a quasi-lexicographically sorted version to permit efficient lookup.
We generate that copy automatically with gyb.  I ended up having
to tweak handle_gyb_sources to allow it to drop the result in
CMAKE_CURRENT_BINARY_DIR instead of CMAKE_CURRENT_BINARY_DIR/{4,8}
if an architecture is not provided.  I think this is abstractly
reasonable for generated includes, which have independent ability
to detect the target word size.  But just between you and me,
I did it because I couldn't figure out how to add
"-I${CMAKE_CURRENT_BINARY_DIR/{4,8}" as a compile flag;
the obvious thing didn't work.  Anyway, I'd appreciate it if
someone double-checked my cmake hackery here.

Swift SVN r24850
2015-01-30 18:39:07 +00:00
Dmitri Hrybenko
df2b4bb488 CMake: more precise dependencies for gyb'ed files
Swift SVN r24730
2015-01-26 09:37:00 +00:00
Dmitri Hrybenko
cb2870c230 Update Unicode data files to 7.0.0
rdar://17561742

Swift SVN r24692
2015-01-23 22:17:45 +00:00
Dmitri Hrybenko
6670bb76ec Rewrite the CMake build system
Swift SVN r24124
2014-12-23 22:15:30 +00:00