Commit Graph

71 Commits

Author SHA1 Message Date
Doug Gregor
52d513af6b Build swift-syntax as shared libraries instead of static libraries.
This allows the various binaries (swift-frontend, SourceKit, etc.) to
share the same code, as well as allowing plugins to link against these
shared libraries.
2022-11-30 15:31:57 -08:00
Doug Gregor
20013181e1 [CMake] Link to swift-syntax libriares from lib/swift/host. 2022-11-30 13:54:03 -08:00
Ben Barham
fa43760766 [CMake] Temporarily workaround CMake dependencies bug
Workaround a CMake bug in order to make sure that ASTGen is rebuilt when
the swift-syntax dependencies change.
2022-11-16 16:16:44 -08:00
Doug Gregor
c0d53c4a47 [CMake] Fixup build for compiler plugin support library 2022-11-15 19:32:20 -08:00
Doug Gregor
85e42435f6 [ASTGen] Disable implicit import of _StringProcessing in ASTGen.
Reduce dependencies for rdar://101819413 .
2022-11-02 15:25:01 -07:00
Robert Widmann
032e8d5e1d Start Lowering Generic ASTs
Lower generic argument lists and generic parameter lists, then expand the lowering for identifiers to take generic arguments into account.
2022-10-27 11:11:11 -07:00
Robert Widmann
f4f7f7f2ce Finish Off ASTGen Implementation for Types
Complete the lowering for the type ASTs present in SwiftSyntax to C++ TypeReprs
2022-10-27 11:11:11 -07:00
Alex Hoppen
0738413fb7 [CMake] Link swiftParse and swiftAST against SwiftParserDiagnostics 2022-10-23 23:34:13 +02:00
Doug Gregor
636e6d1524 [Macros] "Expand" builtin macros for magic literals.
Introduce an experimental option `BuiltinMacros` that takes the magic
literals (`#file`, `#line`, `#function`, etc.) after type checking and
processes the original source for the expression using the build
syntactic macro system in the swift-syntax library. At present, the
result of expansion is printed to standard output, but it's enough to
verify that we're able to find the corresponding syntax node based on
the C++ AST.
2022-10-21 06:41:05 -07:00
Doug Gregor
9c528c6fe2 [ASTGen] Link in syntactic macros 2022-10-21 06:39:53 -07:00
Doug Gregor
2b741ad376 Move ASTGen source-file handling to its own (Swift) file 2022-10-21 06:39:53 -07:00
Doug Gregor
e35e82e7fd Add more missing dependencies 2022-10-10 14:33:38 -07:00
Doug Gregor
aed4f74f3f [ASTGen] Set the target triple for swiftASTGen.
Builds of Swift sources via CMake are not getting a target triple set,
so they pick up the host triple. This leads to spurious warnings about
linking in code built for a newer OS version (e.g., the one you're on)
into libraries with an older deployment target. It also breaks
building a cross-compiler. Always set the target triple.
2022-10-07 21:49:34 -07:00
Doug Gregor
7fd7e4fba5 [CMake Export swiftASTGen so the LLDB target can use it 2022-10-07 16:01:44 -07:00
Doug Gregor
54bcb33ee9 [CMake] Make sure swiftASTGen links swiftAST. 2022-10-07 10:19:06 -07:00
Doug Gregor
39f54bc1b4 Use add_library for Swift ASTGen library 2022-10-07 10:19:06 -07:00
Doug Gregor
4da85ea091 Clean up build logic for ASTGen library.
Only introduce it and its dependency when the new Swift parser is being
built, and rely more on existing logic to make sure we get the right
build/link flags.
2022-10-07 10:19:05 -07:00
zoecarver
94f890d6c7 [nfc] Split ASTGen into files + extensions.
(cherry picked from commit 629fb688f0)
2022-10-07 10:19:05 -07:00
zoecarver
bed2742ba8 Make ASTGen a swift package
(cherry picked from commit 4e9e5fe6a8)
2022-10-07 10:19:05 -07:00
zoecarver
73a7c0ecc6 Apply Doug's review comments
(cherry picked from commit ddede209c7)
2022-10-07 10:18:40 -07:00
zoecarver
129fd386f9 Move ASTGen into Swift from swift-syntax.
(cherry picked from commit 2df25fc6e0)
2022-10-07 10:18:40 -07:00