Commit Graph

8 Commits

Author SHA1 Message Date
Rintaro Ishizaki
1fc00ae248 [ASTGen] Remove LegacyParser ping-pong mechanism
Now that ASTGen should be able to generate most Swift code. Let's
remove "legacy parser" call-in, and remove the unhealthy cyclic
dependency between lib/Parse and ASTGen.
2024-11-14 22:46:43 -08:00
Alex Hoppen
cc858ab253 Merge pull request #70008 from ahoppen/ahoppen/name-matcher-in-swift
Share implementation of local rename and related identifiers + implement `NameMatcher` in Swift
2023-11-30 09:37:53 -08:00
Alex Hoppen
8fd025625b [SourceKit] Use NameMatcher that is rewritten in Swift for syntactic rename 2023-11-17 09:30:04 -08:00
Rintaro Ishizaki
986415a4af [Parse] Remove RegexParserBridging.h
This is not used anymore
2023-11-16 14:01:41 -08:00
Rintaro Ishizaki
fb08a92f48 [ASTGen] Infrastructure to implment ASTGen Incrementally
* 'ASTGenVisitor' has a reference to a legacy C++ Parser configured for
  ASTGen.
* If 'ASTGenVisitor' encounters a AST node that hasn't been migrated,
  call parse(Decl|Stmt|Expr|Type) to parse the position using the legacy
  parser.
* The legacy parser calls ASTGen's
  'swift_ASTGen_build(Decl|Stmt|Expr|Type)' for each ASTNode "parsing"
  (unless the call is not directly from the ASTGen.)

rdar://117151886
2023-11-12 21:43:08 -08:00
Hamish Knight
6afde8a6d2 Remove CBasicBridging and CASTBridging
Merge with BasicBridging and ASTBridging
respectively. The changes here should be pretty
uncontroversial, I tried to keep it to just moving
code about.
2023-10-30 23:49:56 +00:00
Erik Eckstein
2dbd6cc56b SwiftCompilerSources: rework bridging
Introduce two modes of bridging:
* inline mode: this is basically how it worked so far. Using full C++ interop which allows bridging functions to be inlined.
* pure mode: bridging functions are not inlined but compiled in a cpp file. This allows to reduce the C++ interop requirements to a minimum. No std/llvm/swift headers are imported.

This change requires a major refactoring of bridging sources. The implementation of bridging functions go to two separate files: SILBridgingImpl.h and OptimizerBridgingImpl.h.
Depending on the mode, those files are either included in the corresponding header files (inline mode), or included in the c++ file (pure mode).

The mode can be selected with the BRIDGING_MODE cmake variable. By default it is set to the inline mode (= existing behavior). The pure mode is only selected in certain configurations to work around C++ interop issues:
* In debug builds, to workaround a problem with LLDB's `po` command (rdar://115770255).
* On windows to workaround a build problem.
2023-10-09 09:52:52 +02:00
Volodymyr Sapsai
c976dfb01e Move modulemap to header search directory. NFC intended.
In code we use `#include "swift/Lib/Header.h"` which is located in
"include/swift/Lib/Header.h", so we use "include/" as a header search
path. We should put modulemaps in the same directory and shouldn't rely
on clang to search in immediate subdirectories.

rdar://106677321
2023-05-19 15:04:55 -07:00