Commit Graph

13 Commits

Author SHA1 Message Date
Doug Gregor
a320b6cdc4 Clang importer: centralize the "suppress declaration import" logic.
The Swift name lookup tables and the complete Objective-C "container"
to Swift DeclContext mapping code used similar-but-different logic to
determine when to suppress a declaration (e.g., when suppressing the
accessors for a property). Centralize the logic so we get the same
behavior in both places.
2015-12-22 21:47:01 -08:00
Doug Gregor
f9f9d2db98 Clang importer: add a list of Objective-C categories/extensions to the Swift name lookup table.
We need to be able to query this when enumerating “all declarations”, which is coming soon.
2015-12-21 16:01:21 -08:00
Doug Gregor
f40b195a73 Clang importer: simplify Swift name lookup tables a bit.
The base name -> full name mapping really isn't interesting; index
based on the base name and filter by context instead. This makes the
lookup table dumper less interesting for testing purposes
(unfortunately), but test coverage will improve greatly once we can
turn on these lookup tables.
2015-12-08 17:34:04 -08:00
Doug Gregor
8c84a067af Clang importer: include subscripts in the Swift name lookup tables. 2015-12-03 13:54:55 -08:00
Doug Gregor
1e432568bc Clang importer: Swift 2 lowercased subsequent argument names coming from Objective-C selectors. Mimic this. 2015-12-03 11:50:43 -08:00
Doug Gregor
2ea58f93b0 Clang importer: handle CF type renaming in importFullName.
Ensures that the Swift lookup tables get transformed name for imported
CF types, including original name (which is still
available). Otherwise, this is an NFC refactoring that gets the last
of the naming tricks into importFullName.
2015-12-03 11:50:43 -08:00
Doug Gregor
2d7044c024 Clang importer: move name translation for throwing methods into importFullName.
The translation from the Objective-C NSError** convention into Swift
throwing methods alters the names of methods. Move that computation
into importFullName. This should be NFC refactoring for everything
except the Swift name lookup tables, which will now correctly reflect
this name translation.
2015-12-03 11:50:42 -08:00
Doug Gregor
13c1805b90 Clang importer: teach importFullName about dropping certain variadics.
This moves the hack used for UIActionSheet and UIAlertView's variadic
designated initializers over into importFullName().
2015-12-03 11:50:42 -08:00
Doug Gregor
fedb6a8b8a Clang importer: give importFullName a richer result type.
Capture the imported name, as well as some information about it, in
the result of importFullName. Some of the clients need this
information.
2015-12-03 11:50:41 -08:00
Doug Gregor
ec912440e1 Clang importer: teach importFullName about factory methods as initializers. 2015-12-03 11:50:41 -08:00
Doug Gregor
eedf0fc1db Clang importer: teach importFullName to map init methods to initializers.
We're only using this in the Swift lookup tables at the moment.
2015-12-03 11:50:41 -08:00
Doug Gregor
9ee502bede Clang importer: omit non-accessibility property getters/setters from lookup table.
The getters and setters for Objective-C @property declarations are
never found by name lookup, so don't introduce them into the Swift
lookup tables. Note that we exclude some of the accessibility
declarations for unrelated reasons, as we do elsewhere in the
importer.
2015-12-03 11:50:41 -08:00
Doug Gregor
2244cb4fc8 Swift lookup tables: start testing and cleaning up handling for Objective-C.
Start testing the construction of the Swift lookup tables in the Clang
importer for Objective-C entities. Fix some obvious issues, e.g.,
category and extension entries should be associated with the
corresponding class, and the categories/extensions shouldn't have
entries in the lookup table.
2015-12-03 11:50:41 -08:00