Introduces new files ClangAdapter.h/cpp, which will serve as a
convenient place to put code reasoning about Clang details. Refactors
out most Clang-related is*, has*, and get* methods from the
ImporterImpl. In the future, an adapter class could help serve to
seperate the concerns of the importer from the details of how to
correctly use Clang APIs.
In the code that makes sure to pair up getters/setters only from the
same top level module, we were accidentally skipping the final
validity checks (e.g. do the number of parameters line up). This fixes
that.
While inferring get/set, we paired them up even when one of them was
available through a custom objc header (e.g. a private
header). Instead, fail to pair them up. Test case added.
Read through attributed types when determing effective Clang decl
context, use lower level CF type information, and const-ify
EffectiveClangContext.
This puts an end to known disappearing imported members.
Adds incremental de-sugaring to any non-CF typedefs we find in our
types when trying to determine the effective DC. Additionally, cleans
up some logic and allows us to fail earlier on types we cannot
possibly extend.
This hooks up omitNeedlessWords to import as member.
Unfortunately, we are now left straddling different approaches to
handling our strings, I'll be refactoring that soon.
For function that we are importing as init, if there's dangling words
after the "Create" or "Make", we move them onto the first argument
label. This introduces the creation of an empty tuple parameter when
that init has no arguments.
Introduces validToImportAsProperty, which has to perform extra
checking the make sure that a get/set pair are compatible with import
as a property. This includes matching up 'self' parameters, matching
get's return type with the set's argument type, etc. Includes more
extensive tests.
Expands support for inference of computed properties, whether instance
or static, to include get-only. Adds test cases for both inference and
manual annotation for static computed properties.
Introduces import-as-member (IAM) inferene system, to automatically
infer details that would otherwise have to be manually specified with
the swift_name attribute.
Basic functionality present, though there are some issues with
properties at the moment. No hooks, options, or tests yet, stay tuned.