Commit a4fcdef
committed
Sema: fix reporting reexporting submodules imports as unused in API
Importing a clang submodule from Swift implies importing the top-level
module too. We make sure we don't warn on the import of the top-level
module as being unused when the submodule is used by associating all
references to the top-level module instead of submodules. This change
applies the same logic for transitive imports, marking the import of the
top-level module as used instead of the submodule with the `export *`.
In the updated test, this silences the following warning:
```
public import of 'ClangReexportedSubmodulePublic' was not used in public
declarations or inlinable code
```
rdar://1394927721 parent a9d5903 commit a4fcdef
File tree
2 files changed
+38
-2
lines changed- lib/Sema
- test/Sema
2 files changed
+38
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2517 | 2517 | | |
2518 | 2518 | | |
2519 | 2519 | | |
2520 | | - | |
2521 | | - | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
2522 | 2525 | | |
2523 | 2526 | | |
2524 | 2527 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| |||
283 | 286 | | |
284 | 287 | | |
285 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
286 | 304 | | |
287 | 305 | | |
288 | 306 | | |
| |||
298 | 316 | | |
299 | 317 | | |
300 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
301 | 328 | | |
302 | 329 | | |
303 | 330 | | |
| |||
310 | 337 | | |
311 | 338 | | |
312 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
0 commit comments