Commit Graph

1073 Commits

Author SHA1 Message Date
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
swift-ci
47c9a48531 Merge remote-tracking branch 'origin/master' into master-next 2019-08-15 16:11:06 -07:00
swift-ci
6675d10fee Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-15 16:04:25 -07:00
Adrian Prantl
787b6cb8a4 Move ClangImporter::loadModuleClang() into ClangImporter::Implementation
so it forms an obvious contrast with loadModuleDWARF(). Also document
the difference between the two calls.
2019-08-15 15:17:08 -07:00
Adrian Prantl
c76c810c9d Move the ownership of DWARFImporterDelegate away from ClangImporter (NFC). 2019-08-15 13:31:29 -07:00
Jonas Devlieghere
b4d268e9e1 Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances in the swift repo.
2019-08-15 11:32:39 -07:00
swift-ci
032def3316 Merge remote-tracking branch 'origin/master' into master-next 2019-08-14 11:50:24 -07:00
swift-ci
7245d76875 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-14 11:44:30 -07:00
Adrian Prantl
c08a62764a Move DWARFImporterDelegate into ClangImporter and remove DWARFImporter.
This refactors DWARFImporter to become a part of ClangImporter, since
it needs access to many of its implementation details anyway. The
DWARFImporterDelegate is just another mechanism for deserializing
Clang ASTs and once we have a Clang AST, the processing is effectively
the same.
2019-08-14 10:28:50 -07:00
swift-ci
8da0826cb0 Merge remote-tracking branch 'origin/master' into master-next 2019-08-13 16:50:42 -07:00
swift-ci
9461dcdc00 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-13 16:44:31 -07:00
Adrian Prantl
931f60f279 Add back the kind parameter of ClangImporter::lookupRelatedEntity().
This addresses post-commit feedback for 206994c.
2019-08-13 13:05:47 -07:00
Adrian Prantl
8ef36588d1 Move getClangTypeKindForNodeKind() back into ASTDemangler.cpp
This addresses post-commit feedback for 206994c.
2019-08-13 13:05:39 -07:00
Brent Royal-Gordon
fb20b503ba Merge branch 'master' into master-rebranch
# Conflicts:
#	lib/ClangImporter/ClangImporter.cpp
#	test/IRGen/builtins.swift
#	test/IRGen/enum.sil
#	tools/driver/autolink_extract_main.cpp
#	utils/build-presets.ini
2019-08-08 17:07:59 -07:00
Jonas Devlieghere
2b5d641a81 Merge remote-tracking branch 'origin/master' into master-next
Conflicts:
	lib/ClangImporter/ClangImporter.cpp
2019-08-07 10:39:10 -07:00
Adrian Prantl
9b045d555b Introduce a DWARFImporter delegate that can look up clang::Decls by name.
Traditionally a serialized binary Swift module (as used in debug info)
can only be imported if all of its Clang dependencies can be imported
*from source*.

- Swift's ClangImporter imports Clang modules by converting Clang AST
  types into Swift AST types.

- LLDB knows how to find Clang types in DWARF or other debug info and
  can synthesize a Clang AST from that information.

This patch introduces a DWARFImporter delegate that is implemented by
LLDB to connect these two components. With this, a Clang type can be
found (by name) in the debug info and handed over to ClangImporter to
create a Swift type from it.  This path has lower fidelity than
importing the Clang modules from source, since it is missing out on
Swiftication annotations and other metadata that is not serialized in
DWARF, but it's invaluable as a fallback mechanism for the debugger
when source code for the Clang modules isn't available or the modules
are otherwise not buildable.

rdar://problem/49233932
2019-08-06 18:05:46 -07:00
Jonas Devlieghere
63127c2fd0 Update Swift for r367864 2019-08-05 10:18:04 -07:00
Jonas Devlieghere
be2c260523 Merge pull request #26464 from JDevlieghere/error-or
Update Swift for the FileManager API change
2019-08-02 10:29:10 -07:00
Jonas Devlieghere
257dbcd49d 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.
2019-08-02 10:20:40 -07:00
Pavel Yaskevich
3d01a3d723 Merge remote-tracking branch 'origin/master' into master-next 2019-08-02 09:57:06 -07:00
pschuh
2a2ed0f843 [C++ Interop] Implement lookup within namespace. (#26439)
Known problems:
- The same namespace in multiple c++ modules will be subtly confused when doing
  lookup.
2019-08-01 18:21:08 -07:00
swift-ci
b872b17b78 Merge remote-tracking branch 'origin/master' into master-next 2019-07-31 13:31:03 -07:00
Alexis Laferrière
6aa0b06dda ClangImporter: silence error on outdated PCH files
Notify clang that we handle outdate PCH files on the client side so
there's no need to display the misleading "fatal error: file '...'
has been modified since the precompiled header '...' was built".

rdar://problem/35036656
2019-07-31 11:27:47 -07:00
Jonas Devlieghere
87577a6ee3 Merge pull request #26400 from JDevlieghere/gotta-collect-em-all
[Reproducers] Add FileCollector support to DependencyTracker
2019-07-30 13:44:15 -07:00