Commit Graph

1294 Commits

Author SHA1 Message Date
Dan Blackwell
161d00f803 [Sanitizers] Add support for -sanitize=memtag-stack (#85515)
This sanitizer adds MTE (memory tagging extension) checks to stack
variable accesses. Enablement simply requires setting an attribute on
function definitions, and the instrumentation is added by LLVM.

The corresponding swift-driver change is at:
https://github.com/swiftlang/swift-driver/pull/2016.

rdar://161721201
2025-12-05 08:51:42 +00:00
Henrik G. Olsson
d494a31a89 Merge pull request #84988 from ramonasuncion/test-driver-filecheck-prefix
[Test][Driver] Clean up FileCheck prefixes for internal shell
2025-11-10 04:49:32 +00:00
Ramon Asuncion
7c10009eab [Test][Driver] Keep only LINUX_LAX checks for LD_LIBRARY_PATH 2025-11-06 15:55:50 -05:00
Ramon Asuncion
34a2557369 [Test][Driver] Clean up FileCheck prefixes for internal shell 2025-10-17 13:03:17 -07:00
Henrik G. Olsson
c8fc00500f Merge pull request #84923 from ramonasuncion/test-driver-remove-bashisms-filelists
[Test][Driver] Remove bashisms from filelists test
2025-10-17 10:09:15 -07:00
Henrik G. Olsson
81f1e75b4f Merge pull request #84843 from hnrklssn/filecheck-sanitize-tmp-dir
[Utils] Sanitize %t with PathSanitizingFileCheck
2025-10-15 15:43:58 -07:00
Ramon Asuncion
df96bda8fc [Test][Driver] Use xargs instead of command substitution 2025-10-15 11:57:38 -07:00
Ramon Asuncion
29677e3881 [Test][Driver] Use -tools-directory flag in filelists test
Replace env PATH manipulation with Swift driver's -tools-directory flag
to specify location of fake linker.

This seems to work with lit's internal shell, though I'm not 100% certain
it's the right approach.
2025-10-15 11:57:38 -07:00
Ramon Asuncion
c0fc417d66 [Test][Driver] Remove subshells from filelists test
Replace (cd %t && ...) with cd %t && ...
2025-10-15 11:57:30 -07:00
Henrik G. Olsson
9e2a18d401 fix tests with TMP_DIR 2025-10-12 16:01:30 -07:00
Allan Shortlidge
7f3c8d8cfc Tests: Update tests to verify that LibraryEvolution appears in module trace files.
Follow up to https://github.com/swiftlang/swift/pull/84465.
2025-10-10 14:20:34 -07:00
Doug Gregor
90a5a0f87d Merge pull request #84410 from DougGregor/internal-import-bridging-header 2025-09-22 23:09:07 -07:00
Owen Voorhees
e6c9dceae9 Update OS versions requiring stdlib OS rpaths 2025-09-21 09:47:18 -07:00
Doug Gregor
ffa6d65f12 [Options] Make -import-bridging-header the canonical spelling instead of -import-objc-header
This command-line option hasn't been Objective-C specific ever, really.
Make the language-independent spelling the primary one to make that
more obvious.
2025-09-19 16:49:11 -07:00
Allan Shortlidge
cfe9f90347 Merge pull request #84244 from tshortli/require-swift-version-in-module-interfaces
Frontend: Require `-language-mode` option when emitting swiftinterfaces
2025-09-15 10:08:23 -07:00
Hamish Knight
46a093a100 [Frontend] Only enable request reference tracking when needed
Only enable when we have a reference dependency output, or are
validating dependencies or collecting statistics. This avoids enabling
for SourceKit.
2025-09-12 20:39:58 +01:00
Allan Shortlidge
13d61b0709 Frontend: Require -language-mode option when emitting swiftinterfaces.
If a `.swiftinterface` file does not include an explicit `-language-mode`
option (or its predecessor `swift-version`) and needs to be built as a
dependency of a client compilation, then the invocation to build the module
from interface would end up inheriting the language mode that the client code
is built with. This can result in spurious type checking diagnostics or even
mis-compilation. To ensure that a module interface is always built using the
language mode that its source code was originally built with, require an
explicit `-language-mode` option when emitting swiftinterface files.

Resolves rdar://145168219.
2025-09-12 09:10:23 -07:00
Evan Wilde
e5364fda0d FreeBSD: Disable driver/filelists.swift test
This test is flaky and creates noise. The compiler is occasionally
killed for some reason.

rdar://159456203
2025-09-03 09:43:27 -07:00
Arnold Schwaighofer
c6b7b1f6b8 Merge pull request #82110 from tobias-stadler/remarks-fix-mangled-functionnames
[SIL] RemarkStreamer: Use mangled function names
2025-06-27 09:57:15 -07:00
Artem Chikin
66b8f35a5e Merge pull request #81569 from artemcm/NoBatchForYou
[Legacy Driver] Obsolete and remove batch compilation mode from the legacy driver
2025-06-17 10:49:16 -07:00
Tobias Stadler
4b0c0001bc [SIL] RemarkStreamer: Use mangled function names
Remarks emitted by LLVM use the mangled function name. Be consistent
with LLVM when serializing SIL remarks, so external tools can properly
filter for all remarks attributed to a certain function.
2025-06-12 18:29:35 +01:00
Artem Chikin
10cd7baef0 [Legacy Driver] Obsolete and remove batch compilation mode from the legacy driver
It is a maintenance burden and having the legacy driver exist in a simplified state reduces the possibility of things going wrong and hitting old bugs.
2025-06-06 09:51:00 -07:00
Allan Shortlidge
a019419467 Frontend: Add language mode and enabled features to .SWIFT_TRACE.
To allow tooling to analyze use of language mode and experimental/upcoming
features, add that information to the `.SWIFT_TRACE` file.

Resolves rdar://152673681.
2025-06-05 13:47:24 -07:00
Anthony Latsis
0a1b8b0d50 [test] Fix misspelled FileCheck directives 2025-05-29 15:09:36 +01:00
Evan Wilde
500ddfeba4 [Driver] Don't hardcode default linker on Linux
This is the C++ driver counterpart to a change that landed in the Swift
driver a while ago to use the clang-linker to determine what the default
linker is. This is to avoid hard-coding gold, which is deprecated and
not available on some newer Linux distributions. The challenge is that
these newer Linux distributions don't already have Swift so we have to
use the old C++ driver implementation.
2025-04-02 16:32:44 -07:00
Doug Gregor
998dea25be Update module-trace tests for strictly memory-safe standard libraries 2025-02-26 14:28:20 -08:00
Saleem Abdulrasool
a04c75a43a Basic: query the target pointer width from clang
Use the `clang::TargetInfo` to query the target pointer size for the
given triple. This is meant to enable us to properly determine
`CMAKE_SIZEOF_VOID_P`.
2025-02-10 09:20:02 -08:00
Allan Shortlidge
78ecec7cf3 Merge pull request #78987 from tshortli/more-target-info
Tests: Add more `CHECK` lines to print-target-info-extended.swift
2025-01-28 18:39:57 -08:00
Allan Shortlidge
50c9158e0f Tests: Add more CHECK lines to print-target-info-extended.swift.
Resolves rdar://143327298.
2025-01-28 13:51:16 -08:00
Stefan Gränitz
76243a25db [windows][toolchain] Build sanitizers and builtins standalone for all SDKs (#78861)
Unified builds of compiler-rt together with LLVM failed for the Android SDKs. It got too complicated to redirect the way LLVM would configure the nested build-trees. Standalone builds slightly increase build time, but they turned out much simpler and we end up with less duplication of definitions.
2025-01-28 22:08:07 +01:00
Allan Shortlidge
c6ecb185fd Driver: Add missing CHECK lines to print-target-info-extended.swift. 2025-01-24 18:59:10 -08:00
Saleem Abdulrasool
011db2a3e9 Driver: extend -print-target-info with additional components
Render the platform and architecture directories that the target uses to
allow computation of paths for installation.
2025-01-17 14:07:00 -08:00
Doug Gregor
a2b20f9c5d Fix loaded module trace tests 2024-12-24 14:39:13 -08:00
Hiroshi Yamauchi
32832dd1e1 Revert "[windows][toolchain] Enable builtins and sanitizers"
Revert https://github.com/swiftlang/swift/pull/77770

To fix CI https://ci-external.swift.org/job/swift-main-windows-toolchain-arm64/785/consoleText
2024-12-06 14:22:30 -08:00
Saleem Abdulrasool
3ab2a3ee4c Merge pull request #77770 from weliveindetail/windows-toolchain-sanitizers
[windows][toolchain] Enable builtins and sanitizers
2024-12-05 15:46:46 -08:00
Saleem Abdulrasool
936309ec44 test: adjust quoting of arguments
When running the tests with a toolchain built with the "early swift
driver", we would incorrectly process the command line, losing the empty
string argument to `-sdk` which would then incorrectly process the
remainder of the command line. This allows most of the remaining tests
to pass with the early swift driver on Windows (assuming that the paths
are adjusted properly).
2024-12-03 14:44:42 -08:00
Stefan Gränitz
2f7116a36f Disable tests newly included with asan_runtime available, but not supported on Windows yet 2024-12-03 18:41:49 +01:00
Saleem Abdulrasool
8eaf6d55fc test: adjust the tests for swiftc-legacy-driver.exe
When enabling the early swift driver on Windows, these tests need to be
adjusted for the new driver name that is reported. Add an additional
spelling for the driver to accommodate that for the testsuite.
2024-12-02 11:50:57 -08:00
Allan Shortlidge
b0b7166d1e Driver: Pass -disable-upcoming-feature and -disable-experimental-feature to the frontend.
The legacy driver is still used to build the compiler on Windows, so we need it
to handle these new flags correctly in order to adopt them in the stdlib.
2024-11-18 10:27:14 -08:00
Kuba Mracek
8620a99b18 [embedded] Add QEMU-based testing configs for ARM and AVR for runtime testing 2024-10-25 14:52:49 -07:00
Nate Chandler
9718aa5b29 [Driver] Pass -emit-irgen thru to frontend.
Add a new filetype for this mode option: "Raw LLVM IR". When the mode
option is emit-irgen, the new filetype will be the output kind;
conversely when determining the mode option to use, if the output kind
is the new filetype, the mode option will be emit-irgen.
2024-10-02 08:25:30 -07:00
Ian Anderson
5bf2c937ab [CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms
The Apple SDKs have been providing the Darwin overlay since macOS 10.14.4, iOS 12.2, et al. More recently the SDK version has diverged from the Swift version making them incompatible. Stop building the overlay from Swift. Once the SDK overlays aren't being built, the clang overlays need to be built in testing.

rdar://115192929
2024-09-11 22:26:37 -07:00
Artem Chikin
1baff87879 Revert "[CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms" 2024-09-09 09:57:14 -07:00
Doug Gregor
08e339b7b4 Merge pull request #74466 from DmT021/wp/no-warning-as-error
[Diagnostics] Add -no-warning-as-error to except a specific warning from being treated as an error
2024-09-09 09:35:05 -07:00
Dmitrii Galimzianov
070c77ebcf fixup! [Diagnostics] Add -[no-]warning-as-error flags for precise control over warning behavior 2024-09-07 07:55:27 +02:00
Ian Anderson
8959dd97fe [CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms
The Apple SDKs have been providing the Darwin overlay since macOS 10.14.4, iOS 12.2, et al. More recently the SDK version has diverged from the Swift version making them incompatible. Stop building the overlay from Swift. Once the SDK overlays aren't being built, the clang overlays need to be built in testing.

%target-swift-emit-pcm doesn't use the sdk, but %target-swift-frontend does, which will cause them to have a mismatch with "builtin headers belong to system modules, and _Builtin_ modules are ignored for cstdlib headers" aka LANGOPT(BuiltinHeadersInSystemModules) aka -fbuiltin-headers-in-system-modules.

rdar://115192929
2024-09-06 13:28:14 -07:00
Egor Zhdan
5490c5045f Merge pull request #76280 from swiftlang/egorzhdan/remove-cxx-stdlib-flag
[cxx-interop] Remove `-experimental-cxx-stdlib` flag
2024-09-06 13:40:48 +01:00
Pavel Yaskevich
d53b1c48ec Merge pull request #75564 from dempseyatgithub/0441-language-mode-flag
SE-0441: Add language-mode option with alias to swift-version
2024-09-06 00:23:49 -07:00
Egor Zhdan
2df1b6fee4 [cxx-interop] Remove -experimental-cxx-stdlib flag
This flag was added back in 2020, but it didn't function properly, since a lot of other code in the compiler assumed the platform-default C++ stdlib until recently (https://github.com/swiftlang/swift/pull/75589).

The recommended way to use a non-default C++ stdlib in Swift now is to pass `-Xcc -stdlib=xyz` argument to the compiler.

This change removes the `-experimental-cxx-stdlib` flag.
2024-09-05 15:19:19 +01:00
James Dempsey
5fd2eeead5 Add tests for -language-mode flag 2024-08-19 12:15:15 -07:00