Commit Graph

4590 Commits

Author SHA1 Message Date
Doug Gregor
db60d60eb7 Merge pull request #63318 from DougGregor/emit-macro-expansion-buffers-for-diags
[Macros] Emit macro expansion buffers for diagnostics.
2023-01-31 11:40:44 -08:00
Doug Gregor
8871129896 [Macros] Add frontend flag to dump macro expansions for diagnostics.
Add frontend flag `-emit-macro-expansion-files diagnostics` to emit any
macro expansion buffers referenced by diagnostics into files in a
temporary directory. This makes debugging type-checking failures in
macro expansions far easier, because you can see them after the
compiler process has exited.
2023-01-30 18:05:53 -08:00
swift-ci
0db0a3e7a5 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-27 21:35:06 -08:00
Alexis Laferrière
39fb1c5f55 [ModuleInterface] Intro export-as for Swift modules
Introduce a new flag `-export-as` to specify a name used to identify the
target module in swiftinterfaces. This provides an analoguous feature
for Swift module as Clang's `export_as` feature.

In practice it should be used when a lower level module `MyKitCore` is
desired to be shown publicly as a downstream module `MyKit`. This should
be used in conjunction with `@_exported import MyKitCore` from `MyKit`
that allows clients to refer to all services as being part of `MyKit`,
while the new `-export-as MyKit` from `MyKitCore` will ensure that the
clients swiftinterfaces also use the `MyKit` name for all services.

In the current implementation, the export-as name is used in the
module's clients and not in the declarer's swiftinterface (e.g.
`MyKitCore`'s swiftinterface still uses the `MyKitCore` module name).
This way the module swiftinterface can be verified. In the future, we
may want a similar behavior for other modules in between `MyKitCore` and
`MyKit` as verifying a swiftinterface referencing `MyKit` without it
being imported would fail.

rdar://103888618
2023-01-26 14:27:31 -08:00
swift-ci
6e6d419476 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-26 13:34:34 -08:00
Tony Allevato
ba26a1f10d Merge pull request #63178 from allevato/clang-modules-in-explicit-map
Allow Clang modules to be listed in the explicit module map.
2023-01-26 13:26:17 -08:00
swift-ci
6ce37b35d3 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-26 01:34:10 -08:00
swift-ci
def44c55b7 Merge pull request #63223 from DougGregor/colorize-swift-syntax-diagnostics
Colorize swift syntax diagnostics
2023-01-26 01:16:31 -08:00
swift-ci
df75f6ee09 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-25 22:33:52 -08:00
swift-ci
281088eb73 Merge pull request #63204 from meg-gupta/ptrauthcodegenpr
Initial support for ptrauth qualified function pointers in C
2023-01-25 22:19:34 -08:00
Doug Gregor
c7b7c4a8d4 Colorize swift-syntax diagnnostics when requested 2023-01-25 21:29:23 -08:00
Tony Allevato
dda1cda4df Allow Clang modules to be listed in the explicit module map.
This lets users of `-explicit-swift-module-map-file` use a single mapping
for all module dependencies, regardless of whether they're Swift or Clang
modules, instead of manually splitting them among this file and command
line flags.
2023-01-25 16:38:34 -08:00
swift-ci
e0b16dbdf4 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-25 16:07:15 -08:00
Meghana Gupta
a515e0db8e Add EnableImportPtrauthFieldFunctionPointers flag 2023-01-25 12:37:57 -08:00
Alexis Laferrière
595654492b Merge pull request #63176 from xymus/ambiguous-fixes
[ModuleInterface] Don't alias the stdlib or builtin modules in alias module names mode
2023-01-24 08:27:34 -08:00
Erik Eckstein
87ed8b4dc3 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-24 08:58:16 +01:00
Alexis Laferrière
c8ca517e56 [ModuleInterface] Don't alias the stdlib or builtin module
Not aliasing the stdlib should allows it to be used in inlinable code.
Since builtin isn't imported explicitly, references to it shouldn't use
the alias.

rdar://104582241
2023-01-23 17:52:37 -08:00
Alexis Laferrière
32d4edad22 [ModuleInterface] Don't alias @_spiOnly imports in public swiftinterfaces 2023-01-23 17:41:11 -08:00
Alexis Laferrière
0609dfc100 [ModuleInterface] Don't alias the import if it was skipped 2023-01-23 17:41:10 -08:00
Doug Gregor
fa845d8eb2 Merge pull request #63153 from DougGregor/swift-syntax-diagnostic-style
[Diagnostics] Add a swift-syntax diagnostic style
2023-01-22 13:44:14 -08:00
Doug Gregor
39c622ff84 [Diagnostics] Make sure the code builds without the new Swift parser 2023-01-22 09:41:15 -08:00
Doug Gregor
bdf1183757 [Diagnostics] Add a swift-syntax diagnostic style
The SwiftDiagnostics module within swift-syntax has a diagnostic
pretty-printer that does a nice rendering of the source code with
diagnostics placed inside gaps between the code lines.
Introduce another `-diagnostic-style` argument, `swift-syntax`,
to bridge from the pretty-printed C++ diagnostics over to the
swift-syntax diagnostics engine.
2023-01-21 23:09:56 -08:00
Doug Gregor
d192bfc7e5 Merge pull request #63125 from DougGregor/debug-info-dump-macro-expansion-buffers 2023-01-21 07:43:45 -08:00
Doug Gregor
3e8f0b2bd6 [Diagnostics] Fix a crash in the "swift" diagnostic printing style.
When there are no excerpts, we should assume indentation of zero.
2023-01-20 21:35:29 -08:00
swift-ci
5388055f12 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-19 09:14:10 -08:00
Arnold Schwaighofer
65bbe7f541 Merge pull request #63094 from aschwaighofer/irgen_relative_pwt
IRGen: Initial support for relative protocol witness table emission
2023-01-19 08:55:30 -08:00
swift-ci
c6deb21e23 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-18 15:05:39 -08:00
Arnold Schwaighofer
8a38738abf IRGen: Initial support for relative protocol witness table emission 2023-01-18 13:43:25 -08:00
Artem Chikin
6fd013aa67 Add an implicit dependency on the '_SwiftConcurrencyShims' library
Whenever concurrency mode is enabled in compilation. This avoids instead ad-hoc requests to load this module in SILGen.
2023-01-13 11:20:35 -08:00
swift-ci
fc62bd2042 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-09 09:16:36 -08:00
Artem Chikin
e01ece1087 Merge pull request #62896 from artemcm/BetterPropagationOfApplicationExtension
[Module Interface Loader] Propagate '-application-extension' by configuring the generic sub-invocation
2023-01-09 09:00:32 -08:00
Erik Eckstein
712fd7922b Merge remote-tracking branch 'origin/main' into rebranch 2023-01-09 08:48:47 +01:00
Alexis Laferrière
4e69160b92 Merge pull request #62886 from xymus/deser-safety-infra
[Serialization] Prepare the infrastructure for the deserialization safety feature
2023-01-06 21:08:24 -08:00
Artem Chikin
c677c5533c [Module Interface Loader] Propagate '-application-extension' by configuring the generic sub-invocation 2023-01-06 14:31:05 -08:00
Alexis Laferrière
d1343c86fb [Frontend] Intro flags to control deserialization safety
Deserialization safety remains off by default at the moment.
2023-01-06 12:02:47 -08:00
Doug Gregor
973b0ce882 Merge pull request #62861 from DougGregor/serialized-diag-source-file-buffers
[Diagnostics] Emit generated code buffers into diagnostic files.
2023-01-06 10:03:02 -08:00
Doug Gregor
8510115a4d Don't request a display name for an invalid location 2023-01-05 22:55:23 -08:00
Doug Gregor
7dbe04939b [Serialized diagnostics] Use a 5-bit VBR encoding for file IDs.
File IDs have been expressed using a 10-bit fixed field. This limits us
to 1023 different files in which we can emit diagnostics, where
overflowing would simply crash. With the introduction of macros and
their generated source buffers, we're much more likely to overflow.

Switch to a 5-bit VBR field, which is slightly smaller for the common
case where there are few files involving diagnositcs, and which also
allows us to have up to 2^32-1 file IDs.
2023-01-05 13:04:47 -08:00
Doug Gregor
15fe681374 [Serialized diagnostics] Eliminate some undefined behavior.
When emitting generated source file buffers, we could end up
reallocating the DenseMap that tracks file IDs while still holding a
reference to it. Hilarity ensues. Stop that hilarity by taking a copy.

Additionally, make sure we don't emit an invalid source range, and
instead put in empty source locations.
2023-01-05 11:46:39 -08:00
Doug Gregor
c4312216b5 [Diagnostics] Emit generated code buffers into diagnostic files.
Extend the serialized diagnostics file format to also support providing
the contents of source files, which can include a reference to the
"original source range" whose text is conceptually replaced with the
contents of the serialized diagnostics file, e.g., due to macro
expansion.
2023-01-04 21:28:09 -08:00
Ellie Shin
3c5ea2eaf3 Merge branch 'main' into es-pkg-err 2022-12-21 18:26:05 -08:00
Ellie Shin
ecc2042b3f Add error checks for input package name
Resolves rdar://103531208
2022-12-21 18:25:02 -08:00
swift-ci
50fff10c87 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-19 23:54:19 -08:00
Ellie Shin
72ee150982 Add -package-name flag
De/serialize package name in module binary
Resoles rdar://103531218, rdar://103531208
2022-12-19 14:33:44 -08:00
swift-ci
dcfb01cfb3 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-13 09:16:29 -08:00
Alexis Laferrière
276281ded8 Merge pull request #62476 from xymus/module-interface-export-as
[ModuleInterface] Ignore export_as in private swiftinterface
2022-12-13 09:12:44 -08:00
swift-ci
446f63fdc1 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-13 07:53:58 -08:00
Alex Hoppen
58aaa4f111 Merge pull request #62522 from ahoppen/ahoppen/rename-completion
[IDE] Rename CodeCompletion to IDEInspection in cases where the code path no longer exclusively applies to code completion
2022-12-13 16:40:28 +01:00
Alex Hoppen
fe2ae72ad2 [IDE] Rename CodeCompletion to IDEInspection in cases where the code path no longer exclusively applies to code completion
The code completio infrastructure is also being used for cursor info now, so it should no longer be called code completion.

rdar://103251187
2022-12-13 11:41:05 +01:00
swift-ci
8a755200bc Merge remote-tracking branch 'origin/main' into rebranch 2022-12-12 21:53:14 -08:00