Commit Graph

1896 Commits

Author SHA1 Message Date
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
Jonas Devlieghere
0a9149f357 [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.
2019-07-30 13:23:42 -07:00
Jonas Devlieghere
c624a87bd5 [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.
2019-07-29 16:38:24 -07:00
swift-ci
b0628c339a Merge remote-tracking branch 'origin/master' into master-next 2019-07-29 07:30:05 -07:00
Saleem Abdulrasool
370aa9d9c5 ClangImporter: search for glbc.modulemap in the SDK
When cross-compiling with a swift built for another target or when
building with a pure toolchain without the resource directory containing
host content, the modulemap required for Linux may not be found.  In
such a case, we should also look for the content in the SDK if one is
provided.  This improves the behaviour of `swiftc` for Linux with a
standalone SDK.
2019-07-27 21:48:07 -07:00
swift-ci
7f46a4a7fb Merge remote-tracking branch 'origin/master' into master-next 2019-07-22 16:10:11 -07:00
Jordan Rose
88405bc2f3 [ModuleInterface] Honor -disable-modules-validate-system-headers
The point of this flag is to avoid re-checking the whole SDK on every
build, since under many circumstances you can assume it hasn't
changed. That worked for Clang modules, but Swift cached modules also
end up with dependencies that shouldn't be updated.

rdar://problem/53279521
2019-07-18 18:38:31 -07:00
Jonas Devlieghere
94ef5431ff 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.
2019-07-18 16:29:08 -07:00
Joe Groff
d38a72c4ad Merge branch 'master' into master-next 2019-07-18 13:14:39 -07:00
Marc Rasi
8c993a3543 fix lldb test failure 2019-07-16 21:42:57 -07:00
Marc Rasi
840f4b90d9 some cleanup 2019-07-16 10:19:24 -07:00
Marc Rasi
a6e0210b6d thread a vfs through the completion handler 2019-07-16 10:19:24 -07:00
swift-ci
9894743d4f Merge remote-tracking branch 'origin/master' into master-next 2019-07-09 11:50:28 -07:00
Parker Schuh
fa69a73ee4 Add -enable-cxx-interop flag and support for extern "C" {} 2019-07-08 11:43:35 -07:00
Ben Langmuir
c42b732e26 Merge remote-tracking branch 'origin/master' into master-next
Conflicts:
	lib/IRGen/IRGenModule.cpp
2019-06-18 09:35:57 -07:00
Jordan Rose
2397bf4489 Under -enable-library-evolution, imports need Library Evolution too (#25549)
Otherwise, there's no guarantee of binary compatibility, and whoever
turned on library evolution support shouldn't be lulled into a false
sense of security.

This is just a warning for now, but will be promoted to an error later
once clients have shaken out any places where they're doing this.
Note that the still-experimental '@_implementationOnly' opts out of
this check, because that enforces that the import doesn't make its way
into the current module's public source or binary interface.

rdar://50261171
2019-06-18 09:22:56 -07:00
swift-ci
eb40386bbb Merge remote-tracking branch 'origin/master' into master-next 2019-06-12 17:51:09 -07:00
Jordan Rose
12e01d1ef6 [ClangImporter] Fix macOS app extension deprecated-as-unavailable check (#25399)
Fixes a typo introduced in 8b14600372 where a case was omitted from
the refactored version of a switch.

rdar://51417764
2019-06-12 17:43:31 -07:00
Davide Italiano
78dedd3259 [ClangImporter] size() for MemoryBlock is now allocatedSize(). 2019-05-21 13:24:22 -07:00
swift-ci
a23e1bc053 Merge remote-tracking branch 'origin/master' into master-next 2019-05-20 08:29:20 -07:00
Ben Langmuir
2210d24b48 [clang-importer] Fix option -disable-modules-validate-system-headers
This option stopped working when clang changed its default behaviour to
-fmodules-validate-system-headers; we now need to explicitly disable it
to preserve the behaviour of our flag.

rdar://problem/50908762
2019-05-17 16:22:37 -07:00
swift-ci
06402465ea Merge remote-tracking branch 'origin/master' into master-next 2019-05-09 16:29:03 -07:00
Rintaro Ishizaki
d3d30ee246 [Serialization] Support Swift only system module
Previously 'isSystemModule()' returns true only if the module is:
- Standard library
- Clang module and that is `IsSystem`
- Swift overlay for clang `IsSystem` module

Now:
- Clang module and that is `IsSystem`; or
- Swift overlay for clang `IsSystem` module
- Swift module found in either of these directories:
  - Runtime library directoris (including stdlib)
  - Frameworks in `-Fsystem` directories
  - Frameworks in `$SDKROOT/System/Library/Frameworks/` (Darwin)
  - Frameworks in `$SDKROOT/Library/Frameworks/` (Darwin)

rdar://problem/50516314
2019-05-08 17:03:06 -07:00
swift-ci
e819dbf7ae Merge remote-tracking branch 'origin/master' into master-next 2019-05-08 14:09:14 -07:00
Rintaro Ishizaki
6956089b0b [CodeCompletion] Complete Swift only module name after 'import'
rdar://problem/39392446
2019-05-08 10:11:52 -07:00
swift-ci
33dcd2fa87 Merge remote-tracking branch 'origin/master' into master-next 2019-05-06 15:29:53 -07:00
Ben Langmuir
34da079aa6 Pass DynamicLookupInfo through VisibleDeclConsumers NFC
This commit adds a new type DynamicLookupInfo that provides information
about how a dynamic member lookup found a particular Decl. This is
needed to correctly handle KeyPath dynamic member lookups, but for now
just plumb it through everywhere.
2019-05-06 10:02:39 -07:00
swift-ci
599abafa17 Merge remote-tracking branch 'origin/master' into master-next 2019-05-03 11:30:29 -07:00