Commit Graph

1761 Commits

Author SHA1 Message Date
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
Andrew Trick
22f01a956a [SwiftCompilerSources] add BridgedOStream and debugLog().
So we can trace optimizer passes using the same output stream as the
C++ passes and don't get garbled output.
2024-07-29 21:25:43 -07:00
Jeremy Day
221c7039bd Add explicit OpenSourcesAsVolatile option 2024-07-26 17:02:04 -07:00
swift-ci
b24dc98148 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-24 15:55:32 -07:00
Steven Wu
2bc4080116 [ExplicitModule] Include -Xcc -D into module hash
The decision to exclude `-Xcc -D` options from swift module hash
actually doesn't help to solve the problem. It wouldn't reduce the
module variants (or the number of swiftmodule build commands) because
the command-line also encodes all the clang PCM dependencies that do get
affected by `-Xcc` flags.

To avoid the false sharing and the nondeterministic build products,
include most of the `-Xcc` flags, except include search path, into swift
module hash.

rdar://132046247
2024-07-23 14:57:44 -07:00
Jeremy Day
a22419f1d0 Fix sourcekitd persistent file-locks on Windows 2024-07-23 09:59:41 -07:00
swift-ci
538d700717 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-17 22:45:20 -07:00
Carl Peto
3689427834 [AVR] standard library support for AVR
- when compiling embedded cross compile target standard libraries, include AVR
- add 16-bit pointer as a conditional compilation condition and get the void pointer size right for gyb sources
- attempt to fix clang importer not importing __swift_intptr_t correctly on 16 bit platforms
- changed the unit test target to avr-none-none-elf to match the cmake build

[AVR] got the standard library compiling in a somewhat restricted form:

General
- updated the Embedded Runtime
- tweaked CTypes.swift to fix clang import on 16 bit platforms

Strings
- as discussed in https://forums.swift.org/t/stringguts-stringobject-internals-how-to-layout-on-16-bit-platforms/73130, I went for just using the same basic layout in 16 bit as 32 bit but with 16 bit pointers/ints... the conversation is ongoing, I think something more efficient is possible but at least this compiles and will probably work (inefficiently)

Unicode
- the huge arrays of unicode stuff in UnicodeStubs would not compile, so I skipped it for AVR for now.

Synchronization
- disabled building the Synchronization library on AVR for now. It's arguable if it adds value on this platform anyway.
2024-07-16 12:28:27 +01:00
swift-ci
25be15072e Merge remote-tracking branch 'origin/main' into rebranch 2024-07-11 09:56:08 -07:00
Steven Wu
156b0a9b47 Merge pull request #75133 from cachemeifyoucan/eng/PR-131408266
[Modules] Avoid false swift module sharing
2024-07-11 09:36:23 -07:00
Ben Barham
2715d0e9d6 Merge branch 'main' into 20240710-main-to-rebranch
Conflicts:
  - `test/Interop/Cxx/class/method/methods-this-and-indirect-return-irgen-itanium.swift`
    previously fixed on rebranch, now fixed on main (slightly differently).
2024-07-10 20:42:09 -07:00
Steven Wu
a32dd9539b [Modules] Avoid false swift module sharing
When the swiftmodule is built with different clang importer arguments,
they can have the same module hash, causing them to be wrongly re-used even
they contains different interfaces. Add ReducedExtraArgs to the module hash to
disambiguate them.

However, some Xcc arguments, most commonly `-D` options do not affect the
swiftmodule being generated. Do not pass `-Xcc -DARGS` to swift
interface compilation to reduce the amount of module variants in the
build.

rdar://131408266
2024-07-10 14:48:12 -07:00
Tim Kientzle
55663f6791 Merge branch 'main' into tbkka-assertions-3 2024-07-10 14:20:50 -07:00
Rintaro Ishizaki
90c2975d66 [Basic] Don't rewrite source buffer copy multiple times
The on-disc buffer file name was not recorded correctly.

rdar://130478685
2024-07-09 15:09:30 -07:00
swift-ci
d57c885419 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-08 10:55:11 -07:00
Carl Peto
ee57481d7c [AVR] AVR support - Initial PR
- Add simple support for the AVR architecture, as a supported conditional compilation value, and added to the default llvm targets to build.

(Later PRs will fix support for 16-bit pointers, which is broken in places, and any fixes needed to get the standard library to build.)

(Note: AVR as a target is expected to always be compiled with -enable-experimental-feature Embedded.)
2024-07-06 18:22:10 +01:00
swift-ci
517860f681 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-25 23:55:09 -07:00
eeckstein
b68c55cd90 Merge pull request #74685 from eeckstein/assertion-improvements
Some assertion improvements
2024-06-26 08:45:50 +02:00
swift-ci
c2637adbfb Merge remote-tracking branch 'origin/main' into rebranch 2024-06-25 18:14:25 -07:00
Tim Kientzle
50b2b1bcdc Only print the last component of the filename
In particular, on Windows MSVC, the ASSERT macros
use `__FILE__` (with the full pathname) instead of
`__FILE_NAME__` (with only the last component).
2024-06-25 15:18:39 -07:00
John McCall
6a73d244c3 Implement getSwiftRuntimeCompatibilityVersionForTarget for recent releases
We were relying on this for `@isolated(any)` mangling suppression, but
it actually doesn't generate correct results for recent deployment targets.
As a result, we treated e.g. macOS 14.4 as if it were completely
unconstrained in terms of runtime availability.

I took this data from availability-macros.def; it's unfortunate that
we can't just generate the implementation directly from that.

Fixes rdar://129861211
2024-06-25 13:25:56 -04:00
Erik Eckstein
1f29622f08 Assertions: display the assertion help hint only once and after the assertion message
It's more readable if the first thing which is printed is the actual assertion message
2024-06-25 14:16:22 +02:00
Erik Eckstein
81005c18a2 SwiftCompilerSources: forward assertion and precondition failures to the assertion-handling in the C++ code base. 2024-06-25 14:14:43 +02:00
swift-ci
54c3771c92 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-22 14:34:31 -07:00
Slava Pestov
b366ae238c Basic: Use llvm streams instead of iostream in Assertions.cpp 2024-06-22 08:53:22 -04:00
swift-ci
45f211ca23 Merge remote-tracking branch 'origin/main' into rebranch 2024-06-20 16:36:43 -07:00
Tim Kientzle
174983f619 Merge pull request #74581 from tbkka/tbkka-assertions-2
Minor improvements to new ASSERT macros
2024-06-20 16:34:23 -07:00
Xi Ge
736ccef626 Merge remote-tracking branch 'apple/main' into rebranch 2024-06-20 15:16:55 -07:00