Commit Graph

4590 Commits

Author SHA1 Message Date
Steven Wu
7ed9a52633 [PrefixMap] Remap clang cc1 args when building swift interfaces
Fix a bug that swift clang importer is not setup correctly when prefix
map is used. There are two separate issues:
* CC1 args used to setup clang import when building swift (interface and
  sources) are not correctly remapped.
* When loading SDKInfo from SDK path, the SDKSettings.json is not
  loading from VFS, thus the file cannot be loaded from remapped path.

rdar://134458611
2024-08-23 10:32:20 -07:00
swift-ci
89a948c0ba Merge remote-tracking branch 'origin/main' into rebranch 2024-08-22 10:56:50 -07:00
Steven Wu
5e2df2b41b Merge pull request #75964 from cachemeifyoucan/eng/PR-134090397-no-wrong-cc1
[Caching] Do not embed extra ClangTarget in swiftmodule
2024-08-22 10:50:28 -07:00
swift-ci
3eaf0a59aa Merge remote-tracking branch 'origin/main' into rebranch 2024-08-22 08:37:37 -07:00
Allan Shortlidge
ad1acd7f4a Frontend: Allow -enable-experimental-feature to specify upcoming features.
During the lifecycle of a feature, it may start as an experimental feature and
then graduate to become an upcoming feature. To preserve compatibility with
projects that adopted the feature when it was experimental,
`-enable-experimental-feature` ought to be able to enable upcoming features,
too.

Since projects may use `-enable-experimental-feature` for compatibility with an
older toolchain that does not have the feature as an upcoming feature, there is
no warning when the flag is used to enable an upcoming feature.

Note that if the semantics of a feature change when it graduates from
experimental to upcoming, then the feature must be renamed so that projects
using the experimental feature have an opportunity opt-in to the new semantics
of the upcoming feature.

Resolves rdar://134276783.
2024-08-20 07:49:33 -07:00
Steven Wu
6c97736577 [Caching] Do not embed extra ClangTarget in swiftmodule
When direct cc1 mode is used, the cc1 arguments are generated from extra
clang targets so there is no need to add this extra argument.
Furthermore, the `--target=` is a clang driver argument and is not valid
under cc1 mode.

Needed for: rdar://134090397
2024-08-19 12:31:04 -07:00
swift-ci
c19582ba53 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-16 21:34:46 -07:00
Alex Hoppen
577727ad55 Remove DiagnosticsEditorMode
Migrate the last diagnostic to be independent of `DiagnosticEditorMode` and remove that option.

rdar://133111163
2024-08-14 11:24:31 -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
Kavon Farvardin
9d69f2bceb Merge pull request #75382 from kavon/static-branch-prediction
Throws Prediction + HotColdSplitting
2024-08-09 15:24:22 -04:00
Kavon Farvardin
11e8bb8759 IRGen: -enable-split-cold-code frontend feature 2024-08-09 12:09:29 -04:00
Egor Zhdan
bfe72b4be9 Merge pull request #75589 from swiftlang/egorzhdan/linux-libcxx-interop
[cxx-interop] Allow compiling with libc++ on Linux
2024-08-09 13:42:29 +01:00
swift-ci
1d19e19a73 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-09 01:42:10 -07:00
Alastair Houghton
f8e0980efe Merge pull request #75773 from al45tair/eng/PR-132598892
[Frontend][Win32] Fix runtime path to point at runtime libs.
2024-08-09 09:23:09 +01:00
Egor Zhdan
059f0f97d1 [cxx-interop] Allow compiling with libc++ on Linux
This makes sure that Swift respects `-Xcc -stdlib=libc++` flags.

Clang already has existing logic to discover the system-wide libc++ installation on Linux. We rely on that logic here.

Importing a Swift module that was built with a different C++ stdlib is not supported and emits an error.

The Cxx module can be imported when compiling with any C++ stdlib. The synthesized conformances, e.g. to CxxRandomAccessCollection also work. However, CxxStdlib currently cannot be imported when compiling with libc++, since on Linux it refers to symbols from libstdc++ which have different mangled names in libc++.

rdar://118357548 / https://github.com/swiftlang/swift/issues/69825
2024-08-08 16:24:58 +01:00
Kavon Farvardin
d373f6f604 NFC: throws prediction frontend flag 2024-08-08 11:18:22 -04:00
Alastair Houghton
dfeee81dfb [Frontend][Win32] Fix runtime path to point at runtime libs.
The code that generates the runtime path is not right for Windows;
fix it to point at the correct place.

This makes simple use of `swift test.swift` work.

rdar://132598892
2024-08-08 12:54:32 +01:00
swift-ci
4d726b37a8 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-06 19:55:44 -07:00
Xi Ge
98f4ad840a DependenciesScanner: report user module version for textual Swift interfaces 2024-08-06 15:45:45 -07:00
Ben Barham
7bdf1e117e Merge remote-tracking branch 'origin/main' into manually-merge-main-to-rebranch
Conflicts:
  - `lib/PrintAsClang/PrintSwiftToClangCoreScaffold.cpp` not positive
    what the cause here was, just took main.
2024-08-06 13:44:27 -07:00
Allan Shortlidge
d4339198dc Merge pull request #75694 from tshortli/member-import-visibility-import-access-level
Sema: Add an access level to the fix-its for missing imports when appropriate
2024-08-05 14:40:36 -07:00
Alexis Laferrière
eea22c2f09 Merge pull request #75659 from xymus/shadow-dont-warn-with-alias-workaround
ModuleInterface: Don't warn on name conflict when the alias workaround is enabled
2024-08-05 12:38:00 -07:00
Allan Shortlidge
fff4bebc44 AST: Clarify SourceFile's existing missing imports record.
In anticipation of adding a new kind of missing import record to `SourceFile`,
clarify the purpose of the existing "missing imports" record with more specific
naming and documentation.
2024-08-05 11:28:26 -07:00
Alexis Laferrière
b4fb5720b2 ModuleInterface: Don't warn on name conflict when the alias workaround is enabled
This warning is designed to be an early report of name conflicts in
swiftinterfaces caused by a type having the same name as a module.
Make sure we silence this warning when the workaround
-alias-module-names-in-module-interface is enabled. This is what we
already do for -module-interface-preserve-types-as-written.

rdar://132990400
2024-08-02 14:48:29 -07:00
Artem Chikin
e7a76653aa [Dependency Scanning] Enable parallel dependency scanning by-default 2024-08-01 14:26:05 -07:00
swift-ci
68536b641d Merge remote-tracking branch 'origin/main' into rebranch 2024-08-01 09:54:16 -07:00
Saleem Abdulrasool
8d9c5e178c Merge pull request #75406 from z2oh/fix-sourcekitd-file-locks-windows
Fix sourcekitd persistent file-locks on Windows
2024-08-01 09:51:17 -07:00
swift-ci
09d9972801 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-31 09:16:05 -07:00
Artem Chikin
bd4827f7a3 Merge pull request #75556 from artemcm/DisableScannerValidationNonCachingBuild
[Dependency Scanning] Disable validation of Swift dependency modules' existing pre-built candidate binary module files in the scanner, on a non-caching build.
2024-07-31 08:55:51 -07:00
swift-ci
8465f54190 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-30 16:56:50 -07:00
Steven Wu
61e725f57e [Caching] Use swift-frontend as executable name in replays
Don't try to figure out the executable names during replay from
libSwiftScan.dylib. The actual executable path for the process actually
doesn't matter in this case to reconstruct the invocation and might
actually be misleading.

Just use `swift-frontend` as a placeheader executable name for
in-process cache replay.

rdar://132758308
2024-07-30 10:39:25 -07:00
Artem Chikin
a2dc674723 [Dependency Scanning] Disable validation of Swift dependency modules' existing pre-built candidate binary module files in the scanner, on a non-caching build.
As-is, this default interferes with the incremental build machinery which conservatively assumes that binary module dependencies must cause dependents to be re-built.
2024-07-29 17:16:54 -07:00
Jeremy Day
221c7039bd Add explicit OpenSourcesAsVolatile option 2024-07-26 17:02:04 -07:00
swift-ci
809f799599 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-23 15:54:50 -07:00
Allan Shortlidge
a621059f80 ModuleInterface: Avoid crashing on invalid extensions in lazy typechecking mode.
With `-experimental-lazy-typecheck` specified during module interface emission,
`collectProtocols()` may be the first piece of code to request the extended
type for a given extension and it therefore needs to ignore invalid extensions
and ensure that diagnostics are emitted.

Also, add some `PrettyStackTrace` coverage to `ModuleInterfaceSupport.cpp` to make
investigating future issues easier.

Resolves rdar://126232836.
2024-07-23 10:32:50 -07:00
Jeremy Day
a22419f1d0 Fix sourcekitd persistent file-locks on Windows 2024-07-23 09:59:41 -07:00
swift-ci
5de94d61f2 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-18 07:11:25 -07:00
Holly Borla
5e4277a08d [Macros] Narrow the carve-out for DebugDescription’s use of symbol
linkage markers.
2024-07-17 22:19:18 -07:00
swift-ci
89f5c24fef Merge remote-tracking branch 'origin/main' into rebranch 2024-07-16 14:55:17 -07:00
Owen Voorhees
5490b44772 Allow enabling embedded Swift without WMO when not generating SIL
This allows modes like -index-file to work the same way they do when not using embedded Swift
2024-07-15 17:49:47 -07:00
swift-ci
892505350e Merge remote-tracking branch 'origin/main' into rebranch 2024-07-13 13:46:10 -07:00
Allan Shortlidge
c5591947fd Frontend: Fix typos in -enable-cmo-* option definitions. 2024-07-12 09:44:57 -07:00
swift-ci
9ced1b0ed3 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-12 08:14:29 -07:00
Saleem Abdulrasool
7cc7e2bd3a Merge pull request #72352 from compnerd/sysroot
Driver: introduce `-sysroot` option for non-Darwin targets
2024-07-12 08:08:59 -07:00
swift-ci
31eba09b32 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-11 21:14:02 -07:00
Allan Shortlidge
a8a1eb2666 Merge pull request #75182 from tshortli/warn-soft-deprecated
Introduce `-warn-soft-deprecated` option
2024-07-11 21:06:30 -07:00
Allan Shortlidge
10d249b31a Frontend: Introduce a -warn-soft-deprecated option.
This option should cause references to declarations that are deprecated in
future OS versions to be diagnosed.
2024-07-11 14:03:19 -07:00
swift-ci
f3edba0452 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-11 12:15:10 -07:00
Ellie Shin
cb776089cb Merge pull request #75154 from swiftlang/elsh/drop-exp-prefix
Drop experimental prefixes from PackageCMO flags.
2024-07-11 12:12:29 -07:00
swift-ci
25be15072e Merge remote-tracking branch 'origin/main' into rebranch 2024-07-11 09:56:08 -07:00