Commit Graph

1896 Commits

Author SHA1 Message Date
swift-ci
fe2b1bbd3a Merge remote-tracking branch 'origin/master' into master-next 2018-07-31 19:29:10 -07:00
swift-ci
ae0b5a0d8f Merge pull request #18328 from CodaFi/virtual-insanity 2018-07-31 19:21:40 -07:00
Robert Widmann
61203921f5 Diagnose clobbering clang's VFS with our own
There are three modes of concern here:

1) User provides -vfsoverlay but not -Xcc -ivfsoverlay

Recommended behavior.

2) User provides -Xcc -ivfsoverlay but not -vfsoverlay

Legacy behavior.  Clang will handle setup for the VFS.

3) User provides both -vfsoverlay and -Xcc -ivfsoverlay

Unsupported.  We will ignore the clang VFS overlays and substitute our
own.  We will also pop a warning about this.
2018-07-31 15:11:52 -07:00
swift-ci
5830e237ff Merge remote-tracking branch 'origin/master' into master-next 2018-07-31 13:29:50 -07:00
Robert Widmann
0e58b7fd14 Plumbing for a Virtual File System
Adds the -vfsoverlay frontend option that enables the user to pass
VFS overlay YAML files to Swift. These files define a (potentially
many-layered) virtual mapping on which we predicate a VFS.

Switch all input-based memory buffer reads in the Frontend to the new
FileSystem-based approach.
2018-07-31 13:16:14 -07:00
Doug Gregor
792d934e3e [Clang importer] Avoid recursion through isObjC more directly.
Also address some review comments related to the name lookup requests.
2018-07-31 10:20:15 -07:00
Doug Gregor
d07fa5ab69 Switch many callers of ClassDecl::getSuperclass() to ClassDecl::getSuperclassDecl().
ClassDecl::getSuperclass() produces a complete interface type describing the
superclass of a class, including any generic arguments (for a generic type).
Most callers only need the referenced ClassDecl, which is (now) cheaper
to compute: switch those callers over to ClassDecl::getSuperclassDecl().

Fixes an existing test for SR-5993.
2018-07-31 10:14:44 -07:00
swift-ci
9711455ad8 Merge remote-tracking branch 'origin/master' into master-next 2018-07-26 14:49:10 -07:00
Jordan Rose
97b152d71e Consistently get extensions from swift/Basic/FileTypes.h (part 2)
Remove the last few literal extension strings from Strings.h in favor
of the file_types APIs, and use those APIs in a few more places.
2018-07-25 22:23:01 -07:00
Jordan Rose
75052e8a0c [ClangImporter] Update for changes in module map searching in r337430 (#18062)
Patch by Bruno Lopes

rdar://problem/42128087
2018-07-23 10:45:14 -07:00
swift-ci
817e5e80e7 Merge remote-tracking branch 'origin/master' into master-next 2018-07-19 16:49:18 -07:00
Robert Widmann
79b38ba6f3 Merge pull request #18083 from CodaFi/system-of-a-down
Add -track-system-dependencies Flag
2018-07-19 16:29:50 -07:00
Robert Widmann
d845112695 Add -track-system-dependencies Flag
Add a flag to configure the behavior of the Clang Importer's dependency tracker with respect to system dependencies.
2018-07-19 13:03:30 -07:00
swift-ci
e2acff2bbc Merge remote-tracking branch 'origin/master' into master-next 2018-07-18 23:08:57 -07:00
Doug Gregor
b70466dc63 [Type Checker] Add a request kind for computing 'ValueDecl::isObjC()'.
Still a WIP
2018-07-18 14:50:39 -07:00
swift-ci
0f48bbe8d6 Merge remote-tracking branch 'origin/master' into master-next 2018-07-16 15:29:08 -07:00
Mark Lacey
f94d653530 Guard for null result from ClangModuleUnit::getClangModule().
The documentation for this method states that this can return null if
the module unit represents [the] imported headers.

We have a crash report on dereferencing the result of this function
farther down, and I suspect it's hitting exactly that
case. Unfortunately we only have a back trace and no test case.

Fixes: rdar://problem/41888568
2018-07-16 13:22:49 -07:00
swift-ci
504aa0a25a Merge remote-tracking branch 'origin/master' into master-next 2018-06-13 20:29:10 -07:00
Kuba (Brecka) Mracek
6c33cfa2b2 When loading Obj-C methods via a selector and the method is an accessor, import the property as well. (#17150) 2018-06-13 20:19:14 -07:00
swift-ci
ce158d0650 Merge remote-tracking branch 'origin/master' into master-next 2018-06-06 13:29:09 -07:00
Doug Gregor
bc0445d1f7 Narrow a few LazyResolver::resolveDeclSignature() calls to what they really need.
Specifically, introduce entrypoints for "resolve overridden decl" and "is @objc". These can
be computed cheaply in many more cases.
2018-06-04 18:15:39 -07:00
Doug Gregor
1b7c4917ba [Clang importer] Fix weird indentation 2018-06-04 17:36:24 -07:00
Doug Gregor
e1ce0a9f56 [AST/ClangImporter] Eliminate layering violation with isInOverlayModuleForImportedModule.
https://github.com/apple/swift/pull/16951 introduced a layering violation between the
AST and ClangImporter libraries; break the layering violation by moving the function
isInOverlayModuleForImportedModule() to ClangModuleLoader.
2018-06-04 16:40:45 -07:00
swift-ci
7fff7b3ddf Merge remote-tracking branch 'origin/master' into master-next 2018-05-21 21:49:25 -07:00
Rintaro Ishizaki
b3453c17fe [ClangImporter] Take isCompatibilityAlias() into account in interface printing (#16625)
If the Clang declrations are *types*, canonical declaration in Swift is
imported for newest version of Swift. In interface generation, if the
declaration is versioned and it's imported as a member in either or both
version of Swift, we have to take compatibility typealias into account.

* Fixed 'ClangModuleUnit::getTopLevelDecls' to take isCompatibilityAlias() into account
* Fixed bugs in ClangImporter where member-to-member versioned types aren't properly imported.
  * Fixed 'SwiftDeclConverter::importFullName' to check equality of getEffectiveContext()
  * Fixed 'importer::addEntryToLookupTable' to check equality of getEffectiveContext()
    (moved 'ClangImporter::Implementation::forEachDistinctName' to 'NameImporter')
2018-05-22 13:38:45 +09:00
Bob Wilson
5ec7778375 [master-next] Update InclusionDirective overrides to match Clang r332021
Add the new "SrcMgr::CharacteristicKind FileType" parameter to these
virtual functions.
2018-05-11 14:48:22 -07:00
swift-ci
71d1b09374 Merge remote-tracking branch 'origin/master' into master-next 2018-05-04 17:09:05 -07:00
Saleem Abdulrasool
b6dd83dad3 Merge pull request #16381 from compnerd/note-modules
ClangImporter: remove use of `-iapinotes-modules`
2018-05-04 16:52:08 -07:00
swift-ci
289829000b Merge remote-tracking branch 'origin/master' into master-next 2018-05-04 13:09:41 -07:00
Saleem Abdulrasool
0cb0aee059 ClangImporter: remove use of -iapinotes-modules
This should no longer be needed with `-fapinotes-modules`.  We would add
all header search paths as APINotes search directories which should not
be required.
2018-05-04 10:50:17 -07:00
Jordan Rose
18162a3ed0 Revert "AST: Simplify ModuleDecl::forAllVisibleModules()"
This reverts commit 0c32c54e36.
2018-05-03 22:40:37 -06:00
Jordan Rose
4714fcd50c Revert "Merge pull request #16211 from slavapestov/fix-inlinable-vs-autolinking"
This reverts commit bb16ee049d,
reversing changes made to a8d831f5f5.
It's not sufficient to solve the problem, and the choices were to do
something more complicated, or just take a simple brute force
approach. We're going with the latter.
2018-05-03 22:40:31 -06:00
swift-ci
7056b65bf5 Merge remote-tracking branch 'origin/master' into master-next 2018-05-02 15:09:04 -07:00
Jordan Rose
df2e63d07d Diagnose modules with circular dependencies (#16075)
This can't arise from a clean build, but it can happen if you have
products lingering in a search path and then either rebuild one of
the modules in the cycle, or change the search paths.

The way this is implemented is for each module to track whether its
imports have all been resolved. If, when loading a module, one of its
dependencies hasn't resolved all of its imports yet, then we know
there's a cycle.

This doesn't produce the best diagnostics, but it's hard to get into
this state in the first place, so that's probably okay.

https://bugs.swift.org/browse/SR-7483
2018-05-02 15:01:09 -07:00
swift-ci
d258ebab71 Merge remote-tracking branch 'origin/master' into master-next 2018-05-02 13:09:38 -07:00
Saleem Abdulrasool
46df3538e6 Merge pull request #16275 from compnerd/clang-importer
ClangImporter: improve ObjC-interop and enable tests
2018-05-02 13:03:47 -07:00
swift-ci
9d46968584 Merge remote-tracking branch 'origin/master' into master-next 2018-05-01 20:48:51 -07:00
Saleem Abdulrasool
7606e2b5c5 ClangImporter: improve ObjC-interop and enable tests
This enables additional tests for the ClangImporter.  This found a
missing piece in the `-enable-objc-interop` work that was done
previously.  Address that and enable the tests.  There are now the
following failing tests on Linux:

  * sdk - depends on Foundation (not hermetic, see SR-7572)
  * mixed-nsuinteger - depends on Foundation (not hermetic, see SR-7572)
  * import-mixed-with-header-twice - requires apple/swift PR#16022
  * can_import_objc_idempotent - requires apple/swift PR#16022
  * objc_protocol_renaming - requires apple/swift PR#16022
2018-05-01 18:39:42 -07:00
Slava Pestov
cfa0ab3dbe AST: Introduce ModuleDecl::ImportFilter::ForLinking
ModuleDecl::forAllVisibleModules() now has a includeLinkOnlyModules
parameter. This is intended to be used when computing the set of
libraries to autolink.
2018-05-01 17:53:51 -07:00
swift-ci
71a7529f6b Merge remote-tracking branch 'origin/master' into master-next 2018-04-27 05:28:59 -07:00
Slava Pestov
2535867535 ClangImporter: Replace ModuleDecl::ImportFilter math with explicit switch statements 2018-04-26 23:37:17 -07:00
Slava Pestov
0c32c54e36 AST: Simplify ModuleDecl::forAllVisibleModules() 2018-04-26 23:37:16 -07:00
swift-ci
fbc70462ad Merge remote-tracking branch 'origin/master' into master-next 2018-04-18 09:09:49 -07:00
Jordan Rose
dc45a8403c [ClangImporter] Carefully reset state after doing PCH validation (#15963)
This logic reuses parts of the main clang::CompilerInstance because
it's not necessarily cheap or convenient to set up a new one, but that
leaves us open to problems where Clang doesn't expect these objects to
go away. Fix the one people were hitting most recently (thanks, ASan!).

rdar://problem/38454494
2018-04-18 08:59:45 -07:00
swift-ci
b7978cdfba Merge remote-tracking branch 'origin/master' into master-next 2018-04-17 09:29:09 -07:00
Bruno Cardoso Lopes
8cb008481c [ClangImporter] Use appropriate link name for export_as
rdar://problem/38269782
2018-04-16 16:31:05 -07:00
swift-ci
d6e4412890 Merge remote-tracking branch 'origin/master' into master-next 2018-04-09 12:09:20 -07:00
Saleem Abdulrasool
c8a8723872 build: PIC-ify the dynamic SDK overlay
The dynamic SDK overlay needs to be built with -fPIC.  Ensure that the
clang importer is marking the external globals appropriately.  This was
caught by building the swiftGlibc SDK overlay component in a dynamic
configuration.  Failure to do so will create RIP-relative references on
x86_64 which may overflow at runtime.
2018-04-09 08:48:34 -07:00
swift-ci
667a95084b Merge remote-tracking branch 'origin/master' into master-next 2018-04-05 17:29:30 -07:00
Jordan Rose
2cedf1c86a [ClangImporter] Bulk up some comments per Graydon's feedback. (#15780)
DavidU would probably say this function needs to be split up more too,
and he wouldn't be wrong, but that's a bigger change. (The original
change is getting cherry-picked.)
2018-04-05 17:09:14 -07:00