Commit Graph

25 Commits

Author SHA1 Message Date
Alexis Laferrière
eca1cf99af Sema: Don't warn on @_export public imports not used in API
An `@_export public import` is meaningful on it's own as it declares a
relationship between two modules and how clients see them. As such that
import doesn't have to be referenced from API to be appropriate. Let's
not warn on any public import with an `@_export` attribute.

rdar://122032960
2024-02-08 17:29:25 -08:00
Alexis Laferrière
8b098ab487 [Tests] Remove the flag AccessLevelOnImport from all tests but one 2023-10-10 09:09:22 -07:00
Alexis Laferrière
a0b848ea96 [Sema] Report imports marked as public that are not used in API 2023-09-28 13:00:04 -07:00
Alexis Laferrière
2b196f75ff [Frontend] Accept the compiler arg -library-level= 2023-03-29 16:41:33 -07:00
Alexis Laferrière
adda34bd20 [Sema] Report public imports of private modules with access levels
Take into account access-level on imports to raise an error only on
public imports, non-public imports of a private module are safe.
2023-02-27 19:31:52 -08:00
Alexis Laferrière
a926b0555b [Sema] Accept and store the IPI library-level
Prepare to accept the `ipi` argument to the `-library-level` flag. IPI
stands for Internal Programming Interface and would describe a module
that's not to be distributed outside of its project.

In the future, the compiler could use that information to report when a
distributed module (api or spi) imports publicly a module that's not
distributed.

rdar://102435183
2022-11-16 16:29:56 -08:00
Alexis Laferrière
1a6a8a7368 [Sema] Don't error on public imports of private modules in a swiftinterface 2022-09-13 15:57:10 -07:00
Alexis Laferrière
2fd51783bb [Sema|NFC] Update the style of the test ioi-suggestion 2022-09-13 14:59:27 -07:00
Alexis Laferrière
ebc2162d4b [Sema] @_spiOnly isn't a public import that triggers the diagnostic 2022-09-09 09:50:56 -07:00
Alexis Laferrière
91001f0257 [Sema] Consider modules imported from more paths as private
Consider both frameworks and free floating modules imported from more
private path as SPI. This will make the compiler raise errors on public
imports of more private modules.

rdar://91904154
2022-04-18 14:37:48 -07:00
Alexis Laferrière
6cc2399ddb [Sema] delete superfluous test about errors on imports of public modules 2022-04-18 14:37:48 -07:00
Alexis Laferrière
bf12625e9c [Sema] Downgrade to a warning public imports of an underlying private module
Diagnostics of public imports of private modules are more likely to be
wrong about imports of the underlying module from a Swift overlay due to
project configuration/installation, or the fact that private overlays
are installed in the same folder as public ones. Let's always downgrade
these diagnostics to warnings to help landing the rest of the
diagnostics as errors.

rdar://87262431
2022-01-07 14:35:36 -08:00
Alexis Laferrière
5f2ce693cc [Tests] Mark impl-only-import-suggestion.swift as requiring an assert compiler 2021-12-02 08:49:48 -08:00
Alexis Laferrière
b7353c9f51 [Sema] Force reporting public imports of private module as error with asserts
When running in assert mode make it an error for a public module to
publicly import a private module.
2021-12-01 18:29:27 -08:00
Alexis Laferrière
c226fdbe43 [Serialization] Fix missing target in driver invocation 2021-09-14 09:14:53 -07:00
Doug Gregor
5d2c887b97 Limit test to macOS 2021-08-30 20:36:14 -07:00
Alexis Laferrière
9cb3702b0a [Driver] Make -library-level a driver argument and pass it to the frontend
rdar://82458987
2021-08-30 10:06:53 -07:00
Alexis Laferrière
26a9442d0c [Tests] Reenable implementation-only-import-suggestion
rdar://76004923
2021-03-31 12:24:46 -07:00
Alexis Laferrière
eaa27092dc Merge pull request #36639 from xymus/fix-ioi-suggestion
[Test] Fix implementation-only-import-suggestion for Apple Silicon
2021-03-31 12:17:35 -07:00
Mishal Shah
64d6ccd6cc Update the unsupported OS to iOS 2021-03-30 17:07:30 -07:00
Alexis Laferrière
b31571bd40 [Test] Fix implementation-only-import-suggestion for Apple Silicon 2021-03-30 11:48:42 -07:00
Arnold Schwaighofer
72d09552f7 Disable test on tvos/watchos
rdar://76004923
2021-03-30 09:17:04 -07:00
Arnold Schwaighofer
41d1de434a Disable test on ios
rdar://76004923
2021-03-30 08:51:22 -07:00
Alexis Laferrière
6bbb9f04da [Sema] Only look for PrivateFrameworks on Darwin 2021-03-26 16:33:09 -07:00
Alexis Laferrière
cf58bb7eb4 [Sema] Report public imports of private modules
Intro the concept of library access or distribution level to identify
layers of libraries and report public imports of private libraries from
public ones.

rdar://62934005
2021-03-26 16:30:15 -07:00