Commit Graph

22 Commits

Author SHA1 Message Date
Erik Eckstein
2d478ec94c SwiftCompilerSources: add the AST module
Now the SwiftCompilerSources is buildable again with swiftpm.
2024-10-10 07:41:56 +02:00
Rintaro Ishizaki
57ff50d786 [Package.swift] Bump macOS deployment target version to 13.0
Compiler's minimum deployment target version is now 13.0
2024-09-13 10:15:40 -07:00
Rintaro Ishizaki
47f18d492e [ASTGen] Move regex literal parsing from SwiftCompilerSources to ASTGen
ASTGen always builds with the host Swift compiler, without requiring
bootstrapping, and is enabled in more places. Move the regex literal
parsing logic there so it is enabled in more host environments, and
makes use of CMake's Swift support. Enable all of the regex literal
tests when ASTGen is built, to ensure everything is working.

Remove the "AST" and "Parse" Swift modules from SwiftCompilerSources,
because they are no longer needed.
2023-11-16 10:59:23 -08:00
Hamish Knight
3cb74e911b Address review feedback 2023-10-30 23:50:01 +00:00
Hamish Knight
26bfe10456 [SwiftCompilerSources] NFC: Allow building Package.swift
Tweak the compiler flags such that it can be
built from within Xcode. This is only useful when
editing, but I find it very handy.
2023-10-30 23:49:51 +00:00
Saleem Abdulrasool
295eef0cd9 SwiftCompilerSources: force the -static flag
These libraries are built statically for static linking.  SPM currently
does not support libraries, and this will ensure that we properly build
the library target for consumption into the compiler.
2023-08-24 11:17:33 -07:00
Saleem Abdulrasool
b6783f8811 SwiftCompilerSources: use unsafeFlags for header searches
As the headers are not part of the Swift package, the safe header search
option cannot be used.  The use of the unsafe flags enables building the
package on Windows.
2023-08-18 12:46:30 -07:00
Saleem Abdulrasool
d1714631ce SwiftCompilerSources: modernise and inline default flags
Use the `cxxSettings` to pass along header search paths.  With those
removed, we are simply adding the interoperability mode and unsafe
flags, which we can inline.  This simplifies the package definition a
bit.
2023-08-09 08:09:14 -07:00
Saleem Abdulrasool
425dd58661 SwiftCompilerSources: remove extraneous flags
Remove the flags that are now implicitly setup by SPM.  Addresses
feedback from @hyp.
2023-08-09 08:09:14 -07:00
Saleem Abdulrasool
61a2b2e97e SwiftCompilerSources: mark the required C++ interoperability
Mark the Swift flags for interoperability mode rather than using the old
spelling for enabling C++ interoperability.  This is important as it
allows the `cxxLanguageStandard` to flow through to the clang importer
which is required to enable the use of the C++ headers.
2023-08-09 08:09:14 -07:00
Saleem Abdulrasool
8260934afa SwiftCompilerSources: set the C++ language to C++17
LLVM, clang, and Swift use C++17.  Explicitly specify the C++ language
standard to use.
2023-08-09 08:09:14 -07:00
Egor Zhdan
e515db9c48 [cxx-interop][SwiftCompilerSources] Include Clang headers
This will allow using Swift headers that include Clang headers from SwiftCompilerSources.

For example, some headers in `swift/Basic` include headers from `clang/Basic`. Currently adding those Swift headers to the modulemap causes a build error.
2022-09-06 14:37:12 +01:00
Egor Zhdan
b8e2f2eacc Merge pull request #58699 from apple/egorzhdan/libswift-sourceloc
[cxx-interop][SwiftCompilerSources] Use `swift::SourceLoc` instead of `BridgedSourceLoc`
2022-06-22 10:54:59 +01:00
zoecarver
57f721a2f1 [cxx-interop] Remove "enable-cxx-interop" flag again. 2022-06-16 18:02:24 -07:00
Egor Zhdan
5768aebeee [cxx-interop][SwiftCompilerSources] Add LLVM headers to the include paths
This allows the Swift compiler to find headers like `llvm/Support/Compiler.h` that are used by Swift headers.
2022-06-11 00:13:39 +01:00
Rintaro Ishizaki
a9ac0130c0 [SwiftCompilerSources] Make Package.swift static
`Package.swift` in the build directory and symlinking Sources directory
wasn't great for source control and break points. Since C modules doesn't
need the generated headers at this point, make `Package.swift` static
again with a symlink to the string processing source directory.
2022-05-09 10:00:00 -07:00
Rintaro Ishizaki
d292a95296 [SwiftCompiler/Regex] Use bridged DiagnosticEngine for error reporting
This fixes:
 * An issue where the diagnostic messages were leaked
 * Diagnose at correct position inside the regex literal

To do this:
 * Introduce 'Parse' SwiftCompiler module that is a bridging layer
   between '_CompilerRegexParser' and C++ libParse
 * Move libswiftParseRegexLiteral and libswiftLexRegexLiteral to 'Parse'

Also this change makes 'SwiftCompilerSources/Package.swift' be configured
by CMake so it can actually be built with 'swift-build'.

rdar://92187284
2022-04-22 22:53:46 -07:00
Richard Wei
6022128f47 Rename compiler _RegexParser module to _CompilerRegexParser.
Work around a build failure due to this module having the same name as the runtime _RegexParser module.
2022-04-09 20:45:25 -07:00
Richard Wei
065ac52c0d Add frontend flag -disable-implicit-string-processing-module-import.
We add a new flag to disable the implicit import of `_StringProcessing`, similar to `-disable-implicit-concurrency-module-import`. We need this to build `_RegexParser` when `-enable-experimental-string-processing` is enabled by default, because `_StringProcessing` currently imports `_RegexParser` publicly (non-implementation-only).
2022-04-04 13:55:47 -07:00
Richard Wei
dd7610f2d2 Rename _MatchingEngine module to _RegexParser (#42081)
As the _MatchingEngine module no longer contains the matching engine, this patch renames this module to describe its role more accurately. Because this module primarily contains the AST and the regex parsing logic, I propose we rename it to "_RegexParser".

Also renames the ExperimentalRegex module in SwiftCompilerSources to _RegexParser for consistency. This would prevent errors if sources in _RegexParser used qualified lookup with the module name.
2022-03-31 11:13:18 -07:00
Erik Eckstein
3540c01125 rename initializeLibSwift -> InitializeSwiftModules
and some updates in comments.
2021-12-22 11:31:52 +01:00
Erik Eckstein
4beb94c2f9 Rename the libswift directory to SwiftCompilerSources 2021-12-22 09:46:25 +01:00