Commit Graph

1896 Commits

Author SHA1 Message Date
Mishal Shah
6b33f225eb Merge branch 'master' into master-next 2019-10-01 13:10:07 -07:00
swift-ci
4e19aef732 Merge remote-tracking branch 'origin/master' into master-next 2019-09-25 15:50:14 -07:00
swift-ci
2dbc10e7aa Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-25 15:43:41 -07:00
Jordan Rose
caa5be84d5 [ClangImporter] Use external_source_symbol to identify Swift decls (#27355)
...rather than replacing particular macros with an 'annotate'
attribute and then looking for that. This isn't /really/ any
particular win except maybe ever-so-slightly faster module imports
(with one fewer attribute being added to each declaration in a
mixed-source header).

This doesn't remove the SWIFT_CLASS_EXTRA, SWIFT_PROTOCOL_EXTRA, or
SWIFT_ENUM_EXTRA macros from PrintAsObjC (note that
SWIFT_EXTENSION_EXTRA was never used). They're not exactly needed
anymore, but they're not doing any harm if someone else is using them.
2019-09-25 15:30:03 -07:00
swift-ci
8ce5b01307 Merge remote-tracking branch 'origin/master' into master-next 2019-09-18 15:09:47 -07:00
swift-ci
463b04648e Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-18 15:03:46 -07:00
Robert Widmann
5e34169aca Separate computing interface types and underlying types
Computing the interface type of a typealias used to push validation forward and recompute the interface type on the fly.  This was fragile and inconsistent with the way interface types are computed in the rest of the decls.  Separate these two notions, and plumb through explicit interface type computations with the same "computeType" idiom.  This will better allow us to identify the places where we have to force an interface type computation.

Also remove access to the underlying type loc.  It's now just a cache location the underlying type request will use.  Push a type repr accessor to the places that need it, and push the underlying type accessor for everywhere else.  Getting the structural type is still preferred for pre-validated computations.

This required the resetting of a number of places where we were - in many cases tacitly - asking the question "does the interface type exist".  This enables the removal of validateDeclForNameLookup
2019-09-17 08:20:55 -07:00
Nathan Lanza
57bf724b1e [ClangImporter] Update an DirectoryEntry usage to DirectoryEntryRef
A DirectoryEntryRef was added to wrap DirectoryEntrys and numerous
APIs were changed to use it in clang. Change one usage here to account
for the difference.
2019-09-11 19:01:42 -07:00
swift-ci
94d35be2ae Merge remote-tracking branch 'origin/master' into master-next 2019-09-10 09:29:47 -07:00
swift-ci
d4521dc7a1 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-10 09:24:32 -07:00
Jordan Rose
d4ac04d25e Move access-path filtering into ModuleNameLookup (out of lookupValue) (#27097)
Removes duplicated logic from the implementations of
FileUnit::lookupValue, and simplifies the interface to
ModuleDecl::lookupValue, where everyone was passing an empty
(non-filtering) access path anyway /except/ during actual lookup from
source code. No functionality change.
2019-09-10 09:13:20 -07:00
swift-ci
449b08ea36 Merge remote-tracking branch 'origin/master' into master-next 2019-09-06 14:29:08 -07:00
swift-ci
9bf6d8689d Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-06 14:23:36 -07:00
Slava Pestov
99ea1bb980 ClangImporter: Sink getEffectiveClangNode() down from IDE to the importer and clean up related code 2019-09-06 16:03:51 -04:00
swift-ci
9a58a12c25 Merge remote-tracking branch 'origin/master' into master-next 2019-09-05 17:09:50 -07:00
swift-ci
9b22737062 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-05 17:03:42 -07:00
Jordan Rose
e42dd5ac08 [ClangImporter] Protect against re-entrant bridging header loading (#27045)
If, while loading a bridging header, we pick up a Clang module that
claims to have an overlay Swift module, and that Swift module turns
out to have a bridging header, we can end up reallocating the array
of modules to process while we're looping over it. Be defensive
against this occurrence.

This just fixes a crash; it does not at all solve the problem of this
being broken in several ways:

- Accidentally naming your module the same as a system module shadows
  the latter (if the system module is a Swift module) or *makes your
  module into an overlay* (if the system module is a Clang module).

- Bridging headers are only officially supported on executable targets
  and unit tests, but this isn't really enforced.

- Implicit inclusion of a bridging header *when you import a Swift
  module* is a hack to begin with, and a hack that worsens when the
  main module also has a bridging header. (All the bridging headers
  get folded together into the "same" module, which leads to more
  visibility than desired as well as cycles in the import graph.)

- Combining all of these can result in some pretty bizarre behavior.

rdar://problem/54581756
2019-09-05 17:00:14 -07:00
Saleem Abdulrasool
285368d261 Merge pull request #27002 from lanza/ref
[ClangImporter] Update an DirectoryEntry usage to DirectoryEntryRef
2019-09-05 10:23:50 -07:00
swift-ci
29220ca204 Merge remote-tracking branch 'origin/master' into master-next 2019-09-04 15:29:49 -07:00
swift-ci
eb52f0c448 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-04 15:23:47 -07:00
Slava Pestov
06a2d8bf85 ClangImporter: Faster globals-as-members check in the lazy member loading path 2019-09-03 22:53:52 -04:00
Slava Pestov
be84556b9e ClangImporter: Record the error wrapper's struct 'Code' member enum in a side table 2019-09-03 22:53:52 -04:00
Slava Pestov
75f4625bee AST: Peel off ClangModuleLoader.h from ASTContext.h 2019-09-03 22:39:35 -04:00
Nathan Lanza
44cc1bd861 [ClangImporter] Update an DirectoryEntry usage to DirectoryEntryRef
A DirectoryEntryRef was added to wrap DirectoryEntrys and numerous
APIs were changed to use it in clang. Change one usage here to account
for the difference.
2019-09-03 13:24:03 -07:00
swift-ci
d77d68f1ad Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-29 17:04:28 -07:00
swift-ci
af96552a20 Merge remote-tracking branch 'origin/master' into master-next 2019-08-29 16:50:55 -07:00
Slava Pestov
2256b1fcc2 AST: Introduce namelookup::getAllImports() to replace forAllVisibleModules() 2019-08-29 15:57:38 -04:00
Arnold Schwaighofer
339f086f5c Merge remote-tracking branch 'upstream/master' into master-next 2019-08-27 08:10:59 -07:00
swift-ci
7b2068a677 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-26 21:04:28 -07:00
Saleem Abdulrasool
1c2b8ba548 Merge pull request #26694 from linux-on-ibm-z/swift-master-s390x-082019-test-objcsimd
Fix objc_simd test failure on s390x
2019-08-26 20:46:43 -07:00
Arnold Schwaighofer
20efacf2d6 Merge remote-tracking branch 'upstream/master' into master-next 2019-08-26 13:30:41 -07:00
swift-ci
274826165b Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-26 11:24:29 -07:00
Jordan Rose
c50113185f Merge pull request #26816 from jrose-apple/cant-stand-the-rain
Fix a pair of leaks related to FileUnit destructors not being run
2019-08-26 11:06:54 -07:00
Arnold Schwaighofer
2b41f8d8d5 Merge remote-tracking branch 'origin/master' into master-next 2019-08-26 08:57:42 -07:00
swift-ci
fbe8e56e8b Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-24 10:03:05 -07:00
Slava Pestov
2ff39d227c AST: Remove some unused LazyResolver usages 2019-08-23 22:13:34 -04:00
Jordan Rose
5c785d42b3 Enforce that FileUnit + LoadedFile have trivial destructors
We already do this for other ASTContext-allocated types (see
Decl.cpp). This will prevent the sort of mistakes in the previous two
commits.

Note that if any particular subclass of FileUnit wants to have its
destructor run, it can opt into that manually using
ASTContext::addDestructorCleanup. SourceFile and BuiltinUnit both do
this. But we generally don't /want/ to do this if we can avoid it
because it adds to compiler teardown time.
2019-08-23 17:40:46 -07:00
swift-ci
d28622d4ac Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-19 21:43:25 -07:00
swift-ci
c97950d7da Merge remote-tracking branch 'origin/master' into master-next 2019-08-19 21:30:00 -07:00
Slava Pestov
393f376156 ClangImporter: Cache getImportedModulesForLookup() even if empty 2019-08-19 23:00:57 -04:00
Jonas Devlieghere
be3bed2fb4 [ClangImporter] Add comment to the ClangImporterDependencyCollector
Add a comment to the ClangImporterDependencyCollector explaining that
the FileCollector is used by LLDB to generate reproducers and is not
involved in dependency collection in Swift.

(cherry picked from commit 0a9149f357)
2019-08-19 16:53:03 -07:00
Jonas Devlieghere
c0feea1da3 [Reproducers] Add FileCollector support to DependencyTracker
For reproducers in LLDB, we need to collect module dependency
information coming from the clang importer. However, we cannot override
the dependency collector, like we do in LLDB, because its interface is
completely hidden in the clang importer. The solution is to pass the
FileCollector through the DependencyTracker.

(cherry picked from commit c624a87bd5)
2019-08-19 16:53:03 -07:00
Jonas Devlieghere
5c5041235b Merge Swift & Clang VFS in the ClangImporter
The clang importer has to deal with two virtual file systems, one coming
from clang, and one coming from swift. Currently, if both are set, we
emit a diagnostic that we'll pick the swift one.

This commit changes that, by merging the two virtual file systems. The
motivation for this change is the reproducer infrastructure in LLDB,
which adds a third virtual file system to the mix.

(cherry picked from commit 94ef5431ff)
2019-08-19 16:53:03 -07:00
Jonas Devlieghere
f85022dbff Update Swift for r367864
(cherry picked from commit 63127c2fd0)
2019-08-19 16:53:03 -07:00
Jonas Devlieghere
970eb2f439 Update Swift for the FileManager API change
Change Swift to work with the new FileManager API. It now returns and
ErrorOr<FileEntry*> instead of just the raw pointer.

(cherry picked from commit 257dbcd49d)
2019-08-19 16:53:03 -07:00
Lei Zhang
81ece42b18 Fix objc_simd test failure on s390x 2019-08-16 11:22:35 -07:00
Jonas Devlieghere
a06a91006c Merge pull request #26667 from JDevlieghere/make_unique
Migrate llvm::make_unique to std::make_unique
2019-08-16 10:18:30 -07:00
swift-ci
ef8a0d15a5 Merge remote-tracking branch 'origin/master' into master-next 2019-08-16 08:50:45 -07:00
swift-ci
4aefbcf447 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-16 08:43:42 -07:00
adrian-prantl
2d86f23988 Merge pull request #26682 from adrian-prantl/loadmodule
Move ClangImporter::loadModuleClang() into ClangImporter::Implementation
2019-08-16 08:42:53 -07:00