Commit Graph

1688 Commits

Author SHA1 Message Date
Robert Widmann
0f94164d3b Replace Hand-Rolled MAX/MIN with std::max/std::min
We're using C++ 14+ at least now across the project so these should not be necessary. It's also kind of wild that the definitions we had across different subsystems had different definitions.
2025-01-22 11:18:35 -07: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
Alex Hoppen
aeac681bae [SourceKit] Make the SourceKit plugin infrastructure buildable on Linux and Windows 2025-01-06 13:57:57 +01:00
Alex Hoppen
40b91aa97a Share logic to load dynamic libraries between SourceKit plugins and macro plugins 2025-01-03 16:23:16 +01:00
Doug Gregor
528d642fc5 Make the Fix-It JSON writer produce proper JSON
While here, also sort and deduplicate output entries, and stop having
the Python script try to

The Python script is still messing up the files in some cases, but
I haven't tracked it down. Instead, I have a small Swift program
that does the same thing more easily.
2024-12-14 21:49:57 -08:00
Kuba (Brecka) Mracek
f1611f18f6 Merge pull request #77923 from kubamracek/embedded-mangling3
[embedded] Start using a new mangling prefix for Embedded Swift: $e
2024-12-12 14:56:20 -08:00
Xu Feng
9ddbacea50 fix bit value comma 2024-12-09 10:06:29 +08:00
Ben Langmuir
e7c37655e4 [CAS] Cache symbol graph outputs
The symbol graph output from a module can contain an arbitrary number of
files, depending on what extensions it contains, so cache a list of
symbol graph files with their base name and contents so that they can be
replayed.

rdar://140286819
2024-12-03 13:11:19 -08:00
Kuba Mracek
a3eefa8025 [embedded] Start using a new mangling prefix for Embedded Swift: $e 2024-12-03 09:10:38 -08:00
Kuba Mracek
576616307f [Mangling] Temporarily stage out (#ifdef out) the ASTMangler API changes and Embedded Swift prefix 2024-12-02 15:01:24 -08:00
Kuba Mracek
9c77074cac [Mangling] Establish a new mangling prefix for Embedded Swift: $e 2024-12-02 15:01:24 -08:00
Xi Ge
4a5d041932 FineModuleTrace: reposition the currently ObjC message specific trace files to be a more general purposed file for tracing fine-grained dependencies. NFC 2024-11-20 12:41:21 -08:00
Xi Ge
51a68ecdd1 ModuleObjCTrace/CAS: compute objc trace file paths via the canoical supplementary output paths computation
CAS support in compiler relies on supplementary paths to decide the mapping between input and output files. Therefore, we
have to compute the paths of the module ObjC trace files in this canonical place to have CAS support for
this newly added ObjC message trace files.
2024-11-20 08:52:15 -08:00
Pavel Yaskevich
a44f42ed07 Revert "[Basic] Limit version::getCompilerversion to major + minor only"
This reverts commit 17af078378.
2024-11-18 15:11:47 -08:00
Pavel Yaskevich
dbf388c0a5 Merge pull request #77660 from xedin/fix-getCompilerVersion-to-return-major-minor-only
[Basic] Limit `version::getCompilerversion` to major + minor only
2024-11-16 10:01:09 -08:00
Pavel Yaskevich
17af078378 [Basic] Limit version::getCompilerversion to major + minor only
At the moment the only user of this method is `-interface-compiler-version`
and it's checked against major + minor only, so this is not going
to affect functionality.

In the future we should switch from `llvm::VersionTuple` to `swift::Version`
because swift tags have five components.

Resolves: rdar://140006577
2024-11-15 16:32:44 -08:00
Doug Gregor
24a12ebc34 Renable GeneratedSourceInfo::Attribute to GeneratedSourceInfo::AttributeFromClang 2024-11-15 09:02:49 -08:00
Doug Gregor
aa4c548c0f Clang importer: switch swift_attr attribute text cache over to be module-sensitive
We need different buffers for each imported module that has swift_attr attributes,
so cache them appropriately.
2024-11-13 21:19:39 -08:00
Doug Gregor
989c73d014 Ensure that buffers containing Clang swift_attr attributes are parsed as attributes
Previously, they were being parsed as top-level code, which would cause
errors because there are no definitions. Introduce a new
GeneratedSourceInfo kind to mark the purpose of these buffers so the
parser can handle them appropriately.
2024-11-13 21:19:37 -08:00
Michael Gottesman
4763251427 [sil] Add the ability for the frontend to dump LoweredSIL before IRGen.
This is something that I have wanted to add for a while and have never had the
need to. I need it now to fix a bug in the bots where I am forced to use IRGen
output to test ThunkLowering which causes platform level differences to show up
in the FileCheck output. With this, I can just emit the actual lowered SIL
output and just test it at that level. There are other cases like this where we
are unable to test lowered SIL so we use IRGen creating this brittleness.
Hopefully this stops this problem from showing up in the future.

rdar://138845396
2024-11-01 03:16:55 -07:00
Pavel Yaskevich
6cb4b59489 Merge pull request #77216 from xedin/add-swift-compiler-version
[Frontend/AST] Add `-interface-compiler-version` option to frontend/modules
2024-10-28 21:06:47 -07:00
Ben Barham
f59b2f19e6 Merge branch 'main' into 2024-rebranch-to-main 2024-10-28 13:03:35 -07:00
Erik Eckstein
ed67e36ce5 bridging: reduce #ifdef USED_IN_CPP_SOURCE in bridging headers
Especially avoid any constructors in `#ifdef USED_IN_CPP_SOURCE` blocks, because this breaks Windows ARM64.
2024-10-25 09:47:56 +02:00
Pavel Yaskevich
3bd4853626 [Frontend] Add -swift-compiler-version option to frontend, module interfaces
This option is going to be used to indicate what compiler was used
to build swift interface/module which is required for SE-0438.
2024-10-24 17:06:14 -07:00
swift-ci
0ca210816f Merge remote-tracking branch 'origin/main' into rebranch 2024-10-21 09:34:10 -07:00
Erik Eckstein
ef6cedcdb7 Mangler: enable mangling verification also in non-assert compiler builds
Not verifying mangled names can result in crashes later in the optimizer in case of mangling errors.

Related to rdar://137298914
2024-10-21 12:31:43 +02:00
swift-ci
7e7788993b Merge remote-tracking branch 'origin/main' into rebranch 2024-10-16 14:36:52 -07:00
Ryan Mansfield
1001f9eb41 Add -print-zero-stats option and use it in ensure_no_astgen.swift
to verify ExportedSourceFileRequest == 0.

In release mode only non-zero stats are printed by default now.

Fix diagnostic when compiler is built without statistics support.
2024-10-15 23:11:15 -04:00
swift-ci
8dd2a14145 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-08 09:22:59 -07:00
Steven Wu
057c8bb4b1 [BlockList] Don't share the SourceManager in BlockListStore
BlockListStore doesn't need to keep the buffer after the block-list is
parsed. Don't share the same source manager as the compilation so it
doesn't need to make sure the buffer is valid during the entire duration
of the compilation.

rdar://137448231
2024-10-07 14:07:03 -07:00
swift-ci
32d286280a Merge remote-tracking branch 'origin/main' into rebranch 2024-10-02 20:36:43 -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
swift-ci
a655fe5edc Merge remote-tracking branch 'origin/main' into rebranch 2024-09-27 09:56:29 -07:00
Steven Wu
82c9fdf68b [Blocklist] Make sure blocklist config is read through VFS
Make sure block-list file is read through VFS so CASFS can be used to
read the configuration to ensure sound caching, and also the path of the
blocklist can be canonicalized via path remapping.
2024-09-26 17:02:10 -07:00
Ben Barham
c15bc19946 Merge remote-tracking branch 'origin/main' into main-to-rebranch
Conflicts:
  - `lib/Serialization/ModuleFileSharedCore.cpp` new headers on main
2024-09-26 16:01:56 -07:00
Slava Pestov
aee5852b29 Basic: Fix statistics output in noassert build
Fixes rdar://136679357
2024-09-26 13:17:15 -04:00
swift-ci
753b917274 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-25 05:36:07 -07:00
Slava Pestov
5025964c2e Basic: Don't print zero counters 2024-09-23 18:04:25 -04:00
Slava Pestov
c77fae3a2d Basic: Add -fine-grained-timers flag
By default, -stats-output-dir does not collect per-request timers and
counters, because of overhead.
2024-09-23 18:04:25 -04:00
swift-ci
6964118e7e Merge remote-tracking branch 'origin/main' into rebranch 2024-09-18 13:17:04 -07:00
Doug Gregor
6f88c228df Maintain a buffer ID -> source file(s) mapping in the source manager
Now that every source file has a buffer ID, introduce the reverse mapping
so clients can find the source file(s) in their module that reference
that buffer ID.
2024-09-17 14:01:58 -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
Rintaro Ishizaki
d7303d141c [Basic] Remove llvm::JSON C bridging
This was used for plugin message serialization, but it's migrated to
SwiftCompilerPluginMessageHandling JSON.
2024-09-12 12:04:28 -07:00
swift-ci
994d51fb18 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-26 20:55:09 -07:00
Tim Kientzle
e5376439c3 Correctly obey NDEBUG for CONDITIONAL_ASSERT
It looks like a piece of an old experiment never got removed, which
broke the intended behavior here.
2024-08-26 15:52:34 -07:00
swift-ci
5e0151b209 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-19 14:34:39 -07:00
Allan Shortlidge
47454e3f03 Basic: Add support for -swift-version 7 to asserts mode compilers.
Begin accepting `-swift-version 7` in asserts compilers so that we can begin to
test source-breaking changes intended for the next language version mode, such
as diagnostics that need to be staged in without breaking existing code. There
are no announced plans yet for a language mode after Swift 6, so 7 serves as a
placeholder for some future language mode.

Tests that wish to use `-swift-version 7` currently must be marked with
`REQUIRES: swift7` or they will fail in no-asserts bots. The simplest pattern
is probably to duplicate part or all of the pre-Swift 7 test to check that will
behave as intended in Swift 7.
2024-08-18 23:01:25 -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
87cda6a02d Merge remote-tracking branch 'origin/main' into rebranch 2024-07-30 09:18:46 -07:00