Commit Graph

2477 Commits

Author SHA1 Message Date
swift-ci
5a79a6fcd3 Merge remote-tracking branch 'origin/master' into master-next 2017-11-04 05:09:07 -07:00
Graydon Hoare
7e363ff97a [AST] Add implicit dtors outside typechecking, rdar://35198678 2017-11-04 02:59:52 -07:00
swift-ci
2ee6c0bdcb Merge remote-tracking branch 'origin/master' into master-next 2017-11-02 17:29:31 -07:00
Jordan Rose
e0beba5514 Revert "[Clang importer] Fix bridging of the underlying types of typedefs."
This reverts commit 687d753448, now that
the underlying problem is worked out (no pun intended).
2017-11-02 15:16:36 -07:00
Jordan Rose
8ea0796a1e [ClangImporter] Don't import C function pointer typedefs as bridged
We don't get to bridge C functions usually, so the typedef is more
useful in its unbridged form. Undoes a change by John in 0e89efa.
2017-11-02 15:16:22 -07:00
Jordan Rose
3555e32954 [ClangImporter] Drop logic to look through block typedefs
John does this in a more sound way in f4f8349, which works in
non-top-level positions too.
2017-11-02 14:40:42 -07:00
Jordan Rose
85ccbb4990 [ClangImporter] Bridging can happen even without full bridgeability
Partially reverts f4f8349 (from July!) which caused us to start
importing global blocks with unbridged parameters, breaking source
compatibility. I'm still investigating whether there's an actual hole
in the logic; see next few commits.

rdar://problem/34913634
2017-11-02 14:40:39 -07:00
swift-ci
9fd6ab58f6 Merge remote-tracking branch 'origin/master' into master-next 2017-11-01 22:29:00 -07:00
Graydon Hoare
ed0b43cbce [NamedLazyMemberLoading] Move SerialID to IDC, get extensions working. 2017-11-01 17:35:46 -07:00
Graydon Hoare
0cab561a7f [NamedLazyMemberLoading] Enable all clang::ObjCContainerDecl types. 2017-11-01 17:34:56 -07:00
swift-ci
a819927559 Merge remote-tracking branch 'origin/master' into master-next 2017-10-31 14:49:29 -07:00
Nathan Hawes
3006fb9b44 Add missing DEPENDS swift-syntax-generated-headers to ensure SyntaxKind.h is generated before it's used 2017-10-31 12:57:42 -07:00
swift-ci
535e196c49 Merge remote-tracking branch 'origin/master' into master-next 2017-10-30 21:29:27 -07:00
Doug Gregor
687d753448 [Clang importer] Fix bridging of the underlying types of typedefs.
Typedefs tend to be imported without bridging the underlying
type. However, when a typedef is used within a bridging context, we
should bridge based on the underlying type. That wasn't being done
consistently, causing us to import various typedefs without bridging
at all. Update the logic to use the bridged underlying type whenever
the (often unbridged) typedef type itself doesn't line up.

Fixes rdar://problem/34913507.
2017-10-30 15:55:14 -07:00
swift-ci
9b151cf5b3 Merge remote-tracking branch 'origin/master' into master-next 2017-10-24 14:29:54 -07:00
Graydon Hoare
30b6fdce83 Merge pull request #12429 from graydon/named-lazy-member-loading
Named lazy member loading 1/N
2017-10-24 14:27:04 -07:00
swift-ci
7ea0326eaf Merge remote-tracking branch 'origin/master' into master-next 2017-10-24 11:49:21 -07:00
Jordan Rose
d09669b0df Merge pull request #12169 from jrose-apple/dance-dance-deduplication
[ClangImporter] Don't add duplicate search paths
2017-10-24 11:43:13 -07:00
swift-ci
0d58a678d0 Merge remote-tracking branch 'origin/master' into master-next 2017-10-23 19:29:50 -07:00
Slava Pestov
ea5aa0b992 ClangImporter: Remove redundant calls to ValueDecl::setValidationStarted()
createDeclWithClangNode() was already doing this.
2017-10-23 18:50:15 -07:00
swift-ci
6e8c02f790 Merge remote-tracking branch 'origin/master' into master-next 2017-10-23 00:28:57 -07:00
Slava Pestov
2834dcbc7c ClangImporter: Call setValidationStarted() on synthesized declarations
This avoids doing unnecessary work in validateDecl().
2017-10-22 20:05:00 -07:00
Graydon Hoare
cb1c8526c8 [NamedLazyMemberLoading] Address further review comments. 2017-10-20 22:48:45 -07:00
Graydon Hoare
ca3101c2af [NamedLazyMemberLoading] Sketch implementation of named protocol-member loading. 2017-10-20 22:48:43 -07:00
Graydon Hoare
e30b580ba1 [NamedLazyMemberLoading] Add loadNamedMembers method and stub implementations. 2017-10-20 22:48:42 -07:00
swift-ci
0f6dd05633 Merge remote-tracking branch 'origin/master' into master-next 2017-10-16 10:29:17 -07:00
Jordan Rose
2f932ff3ea [ClangImporter] Handle property with getter that returns instancetype (#12414)
We just import this as a property, and Swift doesn't support
properties with dynamic Self type, even if they are read-only. Don't
mark the getter as returning dynamic Self in this case.

(This was only a problem in builds with the AST verifier turned on.)

https://bugs.swift.org/browse/SR-5684
2017-10-16 10:18:14 -07:00
swift-ci
984e00cb36 Merge remote-tracking branch 'origin/master' into master-next 2017-10-13 15:09:24 -07:00
Jordan Rose
b53967fd19 [ClangImporter] Handle macros that are undefined and then redefined (#12413)
This includes 'LONG_MAX' in the Darwin module, which is defined by the
system and then immediately redefined by Clang's copy of limits.h.

The general strategy here is that if two definitions of a macro in the
same module are in separate explicit submodules, we need to keep track
of both of them, but if they're in the same explicit submodule then
one is probably deliberately redefining the other. This isn't fully
correct because one explicit submodule could include another explicit
submodule, but it's a good first approximation, which we can refine if
we come across problem cases in practice.

Swift /also/ has the ability to distinguish between ModuleA.MACRO and
ModuleB.MACRO if you've imported both modules, although there's an
issue that the two of them end up getting the same mangled name if you
try to use both in the same compilation unit. (Filed
rdar://problem/34968281.) That ability is preserved with this change.

All of this will likely change if/when we switch to Clang's "local
submodule visibility" mode, which is needed for the C++ Modules TS but
is also incompatible with Apple's SDKs at the moment. In that case,
macros in two separate explicit submodules will no longer have an
'override' relationship just because they're mentioned sequentially in
the module map.

rdar://problem/34413934
2017-10-13 15:08:51 -07:00
swift-ci
19aeeb2275 Merge remote-tracking branch 'origin/master' into master-next 2017-10-10 11:29:35 -07:00
Doug Gregor
936a701b15 [AST] Stop uniquing canonical GSBs based on the module.
Now that the GenericSignatureBuilder is no longer sensitive to the input
module, stop uniquing the canonical GSBs based on that module. The main
win here is when deserializing a generic environment: we would end up 
creating a canonical GSB in the module we deserialized and another
canonical GSB in the module in which it is used.
2017-10-10 09:41:23 -07:00
Doug Gregor
ef542ffd8a [GSB] Eliminate the stored LookupConformanceFn to the GSB.
Implement a module-agnostic conformance lookup operation within the GSB
itself, so it does not need to be supplied by the code constructing the
generic signature builder. This makes the generic signature builder
(closer to) being module-agnostic.
2017-10-10 09:41:23 -07:00
swift-ci
4dfdb63d08 Merge remote-tracking branch 'origin/master' into master-next 2017-10-06 18:29:55 -07:00
Jordan Rose
3717fe600c [ClangImporter] Fix use-after-free in macro importing (#12316)
This has been showing up as nondeterministic failures on our Linux
bots in the clang_builtins.swift test, because that test used to
trigger typo correction! Which pulled in macros, which happened to
include some redefinitions, which resulted in this.

rdar://problem/34266952
2017-10-06 18:20:40 -07:00
swift-ci
def3044fd1 Merge remote-tracking branch 'origin/master' into master-next 2017-09-29 21:49:19 -07:00
Doug Gregor
a846724a60 [Clang importer] Replace a use of getMembers() with a lookup(). 2017-09-29 16:52:39 -07:00
Jordan Rose
d78d1dcacb [ClangImporter] Only suppress specific diags in synthetic buffers
We don't want to show "included from <bridging-header>" to the user--
that's just not helpful--but we /do/ want to see any unexpected
diagnostics that happen to be reported in the importer's synthetic
buffers. This would have helped us track down rdar://problem/34664596
much sooner.
2017-09-29 10:00:02 -07:00
Jordan Rose
f331060ba7 [ClangImporter] Don't add duplicate search paths
Besides saving some calls to stat(), this also causes problems when
the user specifies a search path that Clang already adds by default,
like $SDKROOT/Library/Frameworks/. Why? Because Swift adds its search
paths after Clang has already configured its defaults, but Clang
reconfigures its search paths from scratch when compiling a module to
a PCM file to cache. This led to system search paths being found
sooner in the primary Clang instance than in the PCM files, which in
turn resulted in the PCM files being considered out of date.

This isn't likely to affect people much in practice, but it's better
to get right. (We ran into this during Doug's experiments in making
/System/Library/PrivateFrameworks a default search path in Clang
r313317; turns out that's problematic for other reasons as well.)

rdar://problem/34664596
2017-09-29 10:00:02 -07:00
swift-ci
c416535022 Merge remote-tracking branch 'origin/master' into master-next 2017-09-28 17:09:16 -07:00
Doug Gregor
d93bed5ed1 [GSB] Move a well-formed GenericSignatureBuilder to be the canonical builder.
Once we compute a generic signature from a generic signature builder,
all queries involving that generic signature will go through a separate
(canonicalized) builder, and the original builder can no longer be used.
The canonicalization process then creates a new, effectively identical
generic signature builder. How silly.

Once we’ve computed the signature of a generic signature builder, “register”
it with the ASTContext, allowing us to move the existing generic signature
builder into place as the canonical generic signature builder. The builder
requires minimal patching but is otherwise fully usable.

Thanks to Slava Pestov for the idea!
2017-09-28 16:19:08 -07:00
swift-ci
4e9fa0d9c1 Merge remote-tracking branch 'origin/master' into master-next 2017-09-28 15:49:25 -07:00
Doug Gregor
0a1583fb87 [GSB] Tighten up interfaces for computing a generic signature.
Funnel all places where we create a generic signature builder to compute
the generic signature through a single entry point in the GSB
(`computeGenericSignature()`), and make `finalize` and `getGenericSignature`
private so no new uses crop up.

Tighten up the signature of `computeGenericSignature()` so it only works on
GSB rvalues, and ensure that all clients consider the GSB dead after that
point by clearing out the internal representation of the GSB.
2017-09-28 14:27:15 -07:00
swift-ci
025f3a5039 Merge remote-tracking branch 'origin/master' into master-next 2017-09-27 11:49:27 -07:00
David Ungar
443ab7d950 git-clang-format 2017-09-26 18:02:35 -07:00
David Ungar
90b456b116 Use if (auto for getting Stats 2017-09-26 17:32:38 -07:00
David Ungar
a41a3c9fa5 compiles using movable guards 2017-09-26 17:22:58 -07:00
David Ungar
2af86f5cac First compiling run, WIP 2017-09-26 16:07:07 -07:00
swift-ci
9d2bebfb97 Merge remote-tracking branch 'origin/master' into master-next 2017-09-25 19:09:29 -07:00
Doug Gregor
8f5d8aa7f9 Revert "[GSB] Centralize, clean up, and cache nested type name lookup" 2017-09-25 13:43:10 -07:00
swift-ci
2cadac7f25 Merge remote-tracking branch 'origin/master' into master-next 2017-09-25 12:49:41 -07:00