Commit Graph

6605 Commits

Author SHA1 Message Date
Robert Widmann
9ff5d88847 Remove SourceKit Support for the libSyntax Tree 2022-11-16 14:52:28 -08:00
Robert Widmann
4c162b2aeb Delete libSyntax 2022-11-16 14:52:28 -08:00
Robert Widmann
25a8655773 Delete swift-syntax-test and Syntax Unit Tests 2022-11-16 13:38:25 -08:00
Robert Widmann
91c262bcb7 Move TokenKinds.def.gyb to AST 2022-11-16 13:38:25 -08:00
swift-ci
601e353c81 Merge remote-tracking branch 'origin/main' into rebranch 2022-11-16 00:34:21 -08:00
Doug Gregor
52b64e53ae [SourceKit] Make sure we link the compiler plugin support library 2022-11-15 20:52:40 -08:00
Doug Gregor
c0d53c4a47 [CMake] Fixup build for compiler plugin support library 2022-11-15 19:32:20 -08:00
Doug Gregor
70323dd318 Link _CompilerPluginSupport into the compiler and SourceKit.
Ensure that we link `swift_CompilerPluginSupport` into the compiler and
SourceKit, and set the rpath appropriately to find the library in its
installed location.

A number of driver tests copy the driver executable into a temporary
directory to isolate it from the build tree. Also copy the plugin
support library into its appropriate place near the driver executable
to ensure these tests keep working. To help with this, add a
`swift_swift_parser` lit feature, which we can use in tests that
involve the new parser's capabilities.
2022-11-15 19:32:20 -08:00
Doug Gregor
c1e0ed6a4a Ensure that the compiler links against the plugin support library. 2022-11-15 19:32:20 -08:00
Alexis Laferrière
81c19b5107 [ASTPrinter] Move up the logic printing the module disambiguation 2022-11-15 16:20:25 -08:00
Erik Eckstein
4c65062bdf rebranch: change some uses of Optional to the new API
`getValue` -> `value`
`getValueOr` -> `value_or`
`hasValue` -> `has_value`
`map` -> `transform`

This change does not cover all uses of the old API. Other warnings are worked around in llvm by https://github.com/apple/llvm-project/pull/5618

rdar://102362022
2022-11-15 17:23:07 +01:00
swift-ci
c6a647ae06 Merge remote-tracking branch 'origin/main' into rebranch 2022-11-13 20:33:41 -08:00
Doug Gregor
51fcde7b76 Merge pull request #62086 from DougGregor/macro-decl 2022-11-13 20:25:48 -08:00
Doug Gregor
3a172fb892 [Macros] Miscellaneous build fixes for macros. 2022-11-13 17:09:12 -08:00
swift-ci
e65fa9c45d Merge remote-tracking branch 'origin/main' into rebranch 2022-11-11 22:52:44 -08:00
Erik Eckstein
ef302ce4ac SILOptimizer: enable stack protection by default
The pass to decide which functions should get stack protection was added in https://github.com/apple/swift/pull/60933, but was disabled by default.

This PR enables stack protection by default, but not the possibility to move arguments into temporaries - to keep the risk low.
Moving to temporaries can be enabled with the new frontend option `-enable-move-inout-stack-protector`.

rdar://93677524
2022-11-11 17:14:08 +01:00
swift-ci
b3d9c1efd3 Merge remote-tracking branch 'origin/main' into rebranch 2022-11-07 09:35:16 -08:00
Alexis Laferrière
e550944826 Merge pull request #61941 from xymus/module-alias-disambiguate
[ModuleInterface] Avoid ambiguities in swiftinterfaces by writing aliases for module names
2022-11-07 08:46:32 -08:00
Erik Eckstein
aaa5cfb07f IRGen: workaround a build error due to changed LTO passes
TODO: fix this

IRGen: Adjust lto/thin-lto to the new pass manager way of doing things
2022-11-04 20:44:19 +01:00
Erik Eckstein
e292d17672 llvm::array_lengthof -> std::size 2022-11-04 20:44:19 +01:00
Erik Eckstein
2653264b3c IRGen: remove the legacy pass manager 2022-11-04 20:44:18 +01:00
Alexis Laferrière
6d5e1b26fa [ASTPrinter] Pass down PrintOptions to printModuleRef 2022-11-04 12:29:55 -07:00
Robert Widmann
7944635f2e Merge pull request #61898 from CodaFi/i-write-syns-not-tragedies 2022-11-04 08:20:47 -07:00
Rintaro Ishizaki
45828af5ed [Refactoring] Separate refactoring files to its own library
IDE/Refactoring had dependencies to libswiftIndex, but libswiftIndex
also depends on libswiftIDE (SourceEntityWalker, etc.)

To break libswiftIndex <-> libswiftIDE dependency cycle, move
"refactoring" related files to a new library 'libswiftRefactoring'

rdar://101692282
2022-11-02 12:39:26 -07:00
Robert Widmann
2d07f382c5 Delete _InternalSwiftSyntaxParser And Its Build Infrastructure
This is the start of the removal of the C++ implementation of libSyntax
in favor of the new Swift Parser and Swift Syntax libraries. Now that
the Swift Parser has switched the SwiftSyntaxParser library over to
being a thin wrapper around the Swift Parser, there is no longer any
reason we need to retain any libSyntax infrastructure in the swift
compiler.

As a first step, delete the infrastructure that builds
lib_InternalSwiftSyntaxParser and convert any scripts that mention
it to instead mention the static mirror libraries. The --swiftsyntax
build-script flag has been retained and will now just execute the
SwiftSyntax and Swift Parser builds with the just-built tools.
2022-11-02 10:35:29 -07:00
Egor Zhdan
145bf5ff30 Merge pull request #61847 from apple/egorzhdan/cxx-dependency-on-sema
[cxx-interop] Avoid a ClangImporter dependency on Sema
2022-11-02 09:14:57 -07:00
Slava Pestov
8113d1f0c7 IDE: Remove bogus associated type superclass field from ModuleAPIDiff 2022-11-01 19:13:46 -04:00
Egor Zhdan
a7f00d6096 [build] Fix undefined reference linker errors on Linux 2022-11-01 14:45:18 -07:00
Allan Shortlidge
af032afb9d Serialization: Break the cycle between Serialization and SymbolGraphGen.
Push the top level logic for writing out swiftmodules and associated files into the frontend library which has access to all the necessary dependencies.
2022-10-29 21:37:09 -07:00
Allan Shortlidge
d663c11df7 IDE: Move compiler invocation utils to break cycle with Frontend.
Move compiler invocation utilities up into the IDETool library which is designed to be dependent on the Frontend and FrontendTool libraries.
2022-10-29 17:51:53 -07:00
Saleem Abdulrasool
4259325692 Merge pull request #61738 from mhjacobson/freebsd-swift-dependency-tool-avoid-redefinition
swift-dependency-tool: avoid redefinition of ScalarTraits<unsigned> on FreeBSD
2022-10-28 08:52:02 -07:00
Allan Shortlidge
58d82f03f6 IDE: Break CMake cycle involving IDE, FrontendTool, Frontend, and Migrator.
These libraries formed a strongly connected component in the CMake build graph. The weakest link I could find was from IDE to FrontendTool and Frontend, which was necessitated by the `CompileInstance` class (https://github.com/apple/swift/pull/40645). I moved a few files out of IDE into a new IDETools library to break the cycle.
2022-10-27 15:56:26 -07:00
Matt Jacobson
52ae8a3024 swift-dependency-tool: avoid redefinition of ScalarTraits<unsigned> on FreeBSD
On FreeBSD, `size_t` and `uint64_t` are both typedefs of `unsigned long`.
2022-10-26 04:31:45 -04:00
Rintaro Ishizaki
0e2e315633 Remember nominal type decls for member lookup
`lookupVisibleMemberDecls` visits nominal type decls to find visible
members of the type. Remembering what decls are visited can be useful
information for the clients.

* Add a 'VisibleDeclConsumer' callback function that is called when
  'lookupVisibleDecls' visits each nominal type decls
* Remember the decl names in 'CodeCompletionContext' for future use
2022-10-21 16:46:06 -07:00
Adrian Prantl
3cc2831608 Don't require a strict revision match in LLDB.
For release-management purposes during development, LLDB's embedded Swift
compiler's version number can sometimes be off-by-one in the last digit
compared to the Swift compiler.

This patch restores the old behavior from before 17183629e4.

rdar://101299168
2022-10-19 09:03:13 -07:00
swift-ci
0f48feb1e7 Merge pull request #61557 from adrian-prantl/refl-objc-interop
[swift-reflection-dump] Make ObjC interoperability configurable.
2022-10-14 14:46:34 -07:00
Adrian Prantl
33eb213e28 [swift-reflection-dump] Make ObjC interoperability configurable.
This addresses a FIXME in the code. This allows running swift-reflection-dump
on macOS to dump the contents of an ELF binary.
2022-10-13 17:21:39 -07:00
Adrian Prantl
75c42ed43b [swift-reflection-dump] Turn --binary-filename into a positional argument.
I mostly find it annoying to type and this makes the usage of the tool more
consistent with other similar tools like dwarfdump or otool.
2022-10-12 11:18:59 -07:00
Doug Gregor
77dfffc49e [CMake] Use an absolute path when adding Swift runtime paths.
The SourceKit version of these operations takes an absolute path, whereas
the primary one takes a relative path.

Fixes rdar://100976577
2022-10-10 11:28:20 -07:00
Doug Gregor
2f06546333 Merge pull request #61426 from DougGregor/astgen 2022-10-08 10:55:53 -07:00
Doug Gregor
7478df009d [CMake] Ensure that the SourceKit framework links Swift as needed 2022-10-07 15:47:29 -07:00
Doug Gregor
4b4751cc07 [CMake] Only add swiftCore dependency when the new Swift parser is included. 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
73a7c0ecc6 Apply Doug's review comments
(cherry picked from commit ddede209c7)
2022-10-07 10:18:40 -07:00
zoecarver
80200ec23a Add Swift-side infrastructure for ASTGen.
(cherry picked from commit 7bc67c9f12)
2022-10-07 10:18:40 -07:00
Holly Borla
38a2c8218b [Requirement] Rename RequirementKind::SameCount to SameShape. 2022-10-06 20:48:40 -07:00
Alex Hoppen
0ab44d577d Merge pull request #61246 from skrtks/SourceKit_qualified_types
[SourceKit] add qualified types in type requests
2022-10-04 12:30:59 +02:00
Pavel Yaskevich
dbb5a48ed5 Merge pull request #60941 from xedin/type-wrapper-user-defined-inits-with-inst-reuse
[Sema/SIL] Implement type wrapper support in user-defined initializers
2022-10-03 11:39:38 -07:00
Dave Lee
a6941723c8 [tools] Show helpful message when demangling '_' (#61369)
From most shells, the symbol(s) given to `swift demangle` should be quoted or escaped, otherwise the shell will perform variable expansion on the `$...` suffix of the symbol. For example:

```
% swift demangle _$sScMMa
_ ---> _
```

Instead the command should be edited to one of the following:
```
% swift demangle sScMMa
_$sScMMa ---> type metadata accessor for Swift.MainActor
% swift demangle '_$sScMMa'
_$sScMMa ---> type metadata accessor for Swift.MainActor
% swift demangle _\$sScMMa
_$sScMMa ---> type metadata accessor for Swift.MainActor
```

When variable expansion has happened, `swift demangle` will see the symbol only as "`_`". This change adds a warning that identifies the likely issue, and contains suggestions on how the user can fix and rerun the invocation.
2022-09-30 08:57:18 -07:00
Pavel Yaskevich
1b4378ec44 [SILOpt] Add a flag to enable experimental type wrappers feature 2022-09-30 00:16:33 -07:00