Commit Graph

10 Commits

Author SHA1 Message Date
Becca Royal-Gordon
9db14c36ad Require @objc to be used with @implementation
…for extensions. This change also removes @implementation(CategoryName); you should attach the category name to the @objc attribute instead. And there are small changes to how much checking the compiler will do on an @objc @implementation after the decl checker has discovered a problem with it.
2024-05-17 14:57:32 -07:00
Becca Royal-Gordon
f9a1c4d2bf Fix class extension visibility bug
New code introduced for objcImp class extension support failed to check whether a class extension would be visible to Swift before importing it. This caused Swift to import extensions declared in private headers that ought not to be visible. Add the needed visibility check to the loop.

Fixes rdar://123543707.
2024-03-29 14:21:15 -07:00
Doug Gregor
69ab4fc56c Use LLVM diagnostic style for a number of Clang importer tests
These tests are checking the printed outpout of the diagnostic formatter
in ways that change with the Swift formatter, but are not consequential.
2024-02-19 02:48:36 -10:00
Brent Royal-Gordon
aaa4e45fa8 [ClangImporter] Update umbrella header diagnostic handling
In apple/llvm-project#1860, the diagnostic for a missing import in an umbrella header was improved by moving it to the end of the file and including a fix-it suggesting the import that would be needed. This breaks two things on the Swift side:

• One Swift test assumes the old source location will be used.
• The `ClangSourceBufferImporter` doesn’t work correctly when a diagnostic is emitted at EOF. It tries to create a virtual file covering EOF..<EOF, but it’s not actually valid to start a virtual file at EOF—it would always be empty.

This commit corrects these issues, which should unblock the automerger.

Fixes rdar://69707827.
2020-09-28 16:27:41 -07:00
David Ungar
d7f2291a38 Fixed test to reflect specificity of “could not build Objective-C module” error. 2018-09-12 14:39:00 -07:00
David Ungar
45f503e83b Applied Jordan’s patches to tests. 2018-09-11 17:49:24 -07:00
Saleem Abdulrasool
7606e2b5c5 ClangImporter: improve ObjC-interop and enable tests
This enables additional tests for the ClangImporter.  This found a
missing piece in the `-enable-objc-interop` work that was done
previously.  Address that and enable the tests.  There are now the
following failing tests on Linux:

  * sdk - depends on Foundation (not hermetic, see SR-7572)
  * mixed-nsuinteger - depends on Foundation (not hermetic, see SR-7572)
  * import-mixed-with-header-twice - requires apple/swift PR#16022
  * can_import_objc_idempotent - requires apple/swift PR#16022
  * objc_protocol_renaming - requires apple/swift PR#16022
2018-05-01 18:39:42 -07:00
Jordan Rose
c3fc74e10c [ClangImporter] Honor -Xcc -W* flags for en/disabling Clang warnings (#15771)
Previously we set up the diagnostic options too early for these flags
to be honored, in order to diagnose problems in parsing the arguments
being passed to Clang. The solution is to decide that that diagnostic
engine is a temporary one and to create a proper one later. (And if
this sounds like a lousy solution, I don't disagree, but it's what
Clang does too.)

rdar://problem/39197895 and possibly something older but I can't find it
2018-04-05 14:08:03 -07:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00
Jordan Rose
61798ff6ec [test] Rename test/ClangModules to test/ClangImporter. (#5618)
...to match the component in include/ and lib/. No content change.
2016-11-02 18:00:53 -07:00