Commit Graph

215 Commits

Author SHA1 Message Date
Michael Ilseman
3911907ef6 [Import Name] Force explicit options
Prevent easy and common errors by dropping default import options. In
the future, these options wont be used, as we want to be able to
calculate all potentially relevant names up front.
2016-09-29 09:02:54 -07:00
Michael Ilseman
ead13d40ff [Import Name] Introduce contextual class Name Importer
Name Importer wraps references to the Swift context and other needed
encapsulation. The eventual goal is to allow name lookup tables to
live separately from the Impl, and do better Clang-instance-based
caching in the future, as well as general separation of concerns.

NFC
2016-09-28 22:37:24 -07:00
practicalswift
9185c052a9 [gardening] Fix inconsistent headers 2016-09-14 20:48:28 +02:00
Michael Ilseman
618b8224af [Clang Importer] Refactor out ClangEffectiveContext determination 2016-09-13 21:05:24 -07:00
Michael Ilseman
5cd26e9ee7 [ClangImporter] Refactor out conflict name detection 2016-09-13 20:29:58 -07:00
Michael Ilseman
eaf45c51b9 [Clang Importer] Refactor out SwiftPrivate logic 2016-09-13 20:20:32 -07:00
Michael Ilseman
01ae90341e [ClangImporter] factor out scratch, so we can reuse it in the future 2016-09-13 20:20:03 -07:00
Michael Ilseman
8895a3b5c5 [ClangImporter] importFullName refactored out
Finally separates out importFullName from the Impl, and it now only
relies on relevant Swift and Clang information, but no importer
state. Convenience functionality, better APIs, and more clean up
coming soon.
2016-09-12 21:05:37 -07:00
Michael Ilseman
1cbfdc9e58 [ClangImporter] Refactor omitNeedlessWordsInFunctionName
Pull omitNeedlessWordsInFunctionName off of the Impl, and into a
static function local to ImportName.cpp. Separate it out from the Impl
entirely. Though this adds a couple of extra ugly parameters, it's one
of the last bits of tie-in between importFullName and the Impl.
2016-09-12 21:05:36 -07:00
Michael Ilseman
15af7f224d [ClangImporter] Refactor Clang reasoning into new files.
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.
2016-09-12 21:02:09 -07:00
Michael Ilseman
b51e0f61f7 [ClangImporter] Refactor off CF reasoning helpers
Move helper methods off of the Impl and into CFTypeInfo.h, where we
have the other CF type reasoning logic.

NFC
2016-09-10 18:41:06 -07:00
Michael Ilseman
ffadf0524b [ClangImporter] Refactor off class methods
Many of the Impl's methods are relevant to only one file or task. Make
more of them static, and when possible, move them off of the Impl
class.

NFC
2016-09-10 18:40:04 -07:00
Michael Ilseman
12fc7c83ff [ClangImporter] cleanup
Delete some dead code related to module prefixes. Make many methods
static on ClangImporter::Implementation when possible.
2016-09-09 14:23:38 -07:00
Michael Ilseman
d625ed288e [ClangImporter] remove antiquated swift_newtype options 2016-09-09 13:55:20 -07:00
Michael Ilseman
7f179448ef [ClangImporter] Move code to ImportName.cpp
Refactors much of the import name determination from ClangImporter.cpp
into ImportName.cpp.

This is not a perfect separation, but it's a step in the right
direction. Long term, we'd like to get as much functionality off of
the ClangImporter::Implementation class and onto more specialized and
seperable (and stateless!) components.
2016-09-09 11:05:59 -07:00