Commit Graph

2311 Commits

Author SHA1 Message Date
Slava Pestov
abbc37e41d IDE: Replace a couple of getTypeOfMember() calls 2024-09-19 12:54:27 -04:00
Doug Gregor
5b2520e379 Remove IfConfigDecl from the AST
The swift-syntax tree retains information about the parsed #if
regions. Drop it from the semantic AST.
2024-09-18 20:51:54 -07:00
swift-ci
5039a2d86c Merge remote-tracking branch 'origin/main' into rebranch 2024-09-18 10:55:29 -07:00
Doug Gregor
49aa0e966f Ensure that SourceFiles always have a backing buffer in the SourceManager
The "buffer ID" in a SourceFile, which is used to find the source file's
contents in the SourceManager, has always been optional. However, the
effectively every SourceFile actually does have a buffer ID, and the
vast majority of accesses to this information dereference the optional
without checking.

Update the handful of call sites that provided `nullopt` as the buffer
ID to provide a proper buffer instead. These were mostly unit tests
and testing programs, with a few places that passed a never-empty
optional through to the SourceFile constructor.

Then, remove optionality from the representation and accessors. It is
now the case that every SourceFile has a buffer ID, simplying a bunch
of code.
2024-09-16 21:46:42 -07:00
Ben Barham
a7b50f357f Merge remote-tracking branch 'origin/main' into manual-main-merge
Conflicts:
  - `lib/Driver/ToolChains.cpp` conflicting with the `addAllArgs` rename
    for multiple options
2024-09-16 13:53:18 -07:00
Doug Gregor
8b91a922cb Only consider the active clauses of IfConfigDecls in placeholder expansion
This is another step toward the removal of IfConfigDecl
2024-09-07 23:31:13 -07:00
swift-ci
763c61f92f Merge remote-tracking branch 'origin/main' into rebranch 2024-08-30 18:13:35 -07:00
Jim M. R. Teichgräber
f2e57d8c76 [SourceKit] Add optional declarations array to interface gen request (#75802)
Introduces the new DeclarationsArrayBuilder and adds it to the
EditorConsumer. Declaration info always includes a kind, offset, and
length, and includes a USR where applicable.
As the USR is already available for editor.open.interface type requests,
this doesn't compute any new information, it just exposes more of what's
there already.
2024-08-30 18:04:12 -07:00
swift-ci
f624072420 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-29 03:33:30 -07:00
Hamish Knight
1cb0f8fdd5 [AST] Rename isPrivateStdlibDecl -> isPrivateSystemDecl
This better reflects what we're actually checking
here.
2024-08-28 18:31:51 +01:00
swift-ci
88e671860c Merge remote-tracking branch 'origin/main' into rebranch 2024-08-12 23:33:59 -07:00
Kuba (Brecka) Mracek
2941f24da3 Merge pull request #75308 from kubamracek/embedded-indexing-non-wmo
[embedded] Don't produce PerfDiags when in non-WMO mode (e.g. when building during indexing)
2024-08-12 23:29:30 -07:00
swift-ci
30a2b71979 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-12 16:14:01 -07:00
Alex Hoppen
01f3be2c6b Merge pull request #75842 from ahoppen/ast-consumer-failed-pure-virtual
[SourceKit] Make `SwiftASTConsumer::failed` pure virtual
2024-08-12 16:13:19 -07:00
Alex Hoppen
84c0d13b30 [SourceKit] Make SwiftASTConsumer::failed pure virtual
Previously, if a semantic tokens request or diagnostic request failed, we wouldn’t return any response.
2024-08-12 12:46:11 -07:00
Kuba Mracek
a2644683d7 [SourceKit] Add missing failed() override in computeDiagnostics, fix missing propagation of errors 2024-08-12 12:44:35 -07:00
Kuba Mracek
80056c15cd [embedded] Explicitly disable PerfDiags from SourceKit instead of always disabling when WMO is off 2024-08-10 14:50:22 -07:00
Ben Barham
467e528200 Merge remote-tracking branch 'origin/main' into manual-rebranch-merge
Conflicts:
  - `lib/Serialization/ModuleFormat.h` bumped version to account for
    differences between main and rebranch.
2024-08-09 15:22:39 -07:00
Slava Pestov
375363a473 AST: Move global conformance lookup entry points to ConformanceLookup.h 2024-08-08 23:35:58 -04:00
swift-ci
21712d92b7 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-31 10:34:44 -07:00
Alex Hoppen
27fd76da9c [SourceKit] Run interface generation request on a deep stack
Building the generated interface for WinSDK can overflow the stack.
Treat it as a semantic request to run it on a large stack.

Fixes swiftlang/sourcekit-lsp#1115
rdar://123944504
2024-07-30 18:03:37 -07:00
swift-ci
1df4bb130e Merge remote-tracking branch 'origin/main' into rebranch 2024-07-29 15:54:29 -07:00
Alex Hoppen
c5e201dd07 Merge pull request #75490 from ahoppen/swiftparser-on-deep-stack
[SourceKit] Run SwiftParser on a deep stack for the related identifiers request
2024-07-29 15:52:43 -07:00
Alex Hoppen
3bffa7970d [SourceKit] Run SwiftParser on a deep stack for the related identifiers request
We ran SwiftParser in `handlePrimaryAST` for related identifiers. That function is called on a dispatch queue with reduced stack size and could cause the parser to stack overflow if the program is very nested.

Run `handlePrimaryAST` on a deep stack for this request to fix the issue.

rdar://129960285
2024-07-25 16:57:08 -07:00
swift-ci
deb4d86f60 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-11 16:35:36 -07:00
Alexander Cyon
4a2942bb4e Fix typos in: cmake, tools, utils, unittests, validation-test
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
2024-07-12 02:34:00 +03:00
swift-ci
b7921a8232 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-06 14:34:09 -07:00
Slava Pestov
fae01d9776 AST: Remove ModuleDecl parameter from more places 2024-07-06 12:05:46 -04:00
Ben Barham
aa7a3a8268 Cleanup std includes
Remove `deque` from files it isn't actually used in. Add it and `stack`
to files that it is - presumably they were previously transitively found
through other includes.
2024-07-02 16:13:49 -07:00
Ben Barham
226ba82525 [ClangImporter] Add various const
`getSelector` now takes a `const clang::IdentifierInfo *` `ArrayRef`.
Sprinkle a bunch of `const`s in.
2024-07-02 16:13:49 -07:00
Ben Barham
b7954411ec Merge remote-tracking branch 'origin/main' into manually-merge-main-to-rebranch
Conflicts:
  - `include/swift/AST/PluginRegistry.h`
2024-06-27 14:56:11 -07:00
Rintaro Ishizaki
5ebd715a2a Merge pull request #73725 from rintaro/macros-inproc-plugin
[Macros] In-process plugin server
2024-06-26 06:33:38 -07:00
swift-ci
af298765fe Merge remote-tracking branch 'origin/main' into rebranch 2024-06-18 13:14:10 -07:00
Rintaro Ishizaki
2f7aa428db [Macros] In-process plugin server
Separate swift-syntax libs for the compiler and for the library plugins.
Compiler communicates with library plugins using serialized messages
just like executable plugins.

* `lib/swift/host/compiler/lib_Compiler*.dylib`(`lib/CompilerSwiftSyntax`):
  swift-syntax libraries for compiler. Library evolution is disabled.
* Compiler (`ASTGen` and `swiftIDEUtilsBridging`) only depends on
  `lib/swift/host/compiler` libraries.
* `SwiftInProcPluginServer`: In-process plugin server shared library.
  This has one `swift_inproc_plugins_handle_message` entry point that
  receives a message and return the response.
* In the compiler
  * Add `-in-process-plugin-server-path` front-end option, which specifies
    the `SwiftInProcPluginServer` shared library path.
  * Remove `LoadedLibraryPlugin`, because all library plugins are managed
    by `SwiftInProcPluginServer`
  * Introduce abstract `CompilerPlugin` class that has 2 subclasses:
    * `LoadedExecutablePlugin` existing class that represents an
      executable plugin
    * `InProcessPlugins` wraps `dlopen`ed `SwiftInProcPluginServer`
  * Unified the code path in `TypeCheckMacros.cpp` and `ASTGen`, the
    difference between executable plugins and library plugins are now
    abstracted by `CompilerPlugin`
2024-06-17 11:36:52 -07:00
Hamish Knight
af0062725e [Completion] Complete ownership specifiers in parameters
Complete ownership specifiers such as `consuming`,
`borrowing`, and `inout` in parameter type
position. While here, also complete `isolated`.

rdar://127261573
2024-06-12 13:36:07 +01:00
swift-ci
8158d75fe4 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-10 17:35:42 -07:00
Holly Borla
5da7ac6cbd [NFC] Use DeclAttributes::isDeprecated in a few more places. 2024-06-10 07:16:44 -07:00
swift-ci
ac43224e86 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-20 13:24:24 -07:00
Rintaro Ishizaki
39d633f5a8 [CodeCompletion] Remove unused 'isAsync' flag from CodeCompletionResult 2024-05-15 13:43:19 -07:00
swift-ci
caf307833c Merge remote-tracking branch 'origin/main' into rebranch 2024-05-04 01:34:28 -07:00
Alastair Houghton
6afdcd311f Merge pull request #72061 from al45tair/eng/PR-123504095
[Linux][Runtime][IRGen] Mark metadata sections as retained and support section GC.
2024-05-04 09:23:06 +01:00
swift-ci
f28f34bb81 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-03 10:15:11 -07:00
Rintaro Ishizaki
6264792d19 [SourceKit] Don't use SourceEntitityWalker for placeholder expansion
Placeholder expansion should be a syntactic operation, but
`SourceEntityWalker` can invoke type checking operations, which causes
unexpected bahaviors including crashes.

rdar://121360941`
2024-05-02 11:52:13 -07:00
swift-ci
7b5298cd01 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-02 03:15:34 -07:00
Hamish Knight
9f7262e3d7 Merge pull request #73361 from hamishknight/uncache
[SourceKit] Remove cached AST by default on close
2024-05-02 11:14:53 +01:00
swift-ci
c8d364261c Merge remote-tracking branch 'origin/main' into rebranch 2024-05-01 16:55:47 -07:00
Slava Pestov
fda93680df Merge pull request #73363 from slavapestov/pack-expansion-closures-part-2
Extract common code for building opened existential and element signatures
2024-05-01 19:44:05 -04:00
Slava Pestov
3b2a6d8c1a SourceKit: Use getNextDepth()/getMaxDepth() 2024-05-01 12:09:01 -04:00
Hamish Knight
e710b50255 [SourceKit] Remove cached AST by default on close
This isn't actually used for anything currently,
future requests will always have mismatching
stamps. As such, remove for now.

rdar://127353509
2024-05-01 12:24:13 +01:00
swift-ci
22d81cbbd2 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-01 04:14:10 -07:00