Commit Graph

1584 Commits

Author SHA1 Message Date
Slava Pestov
a09382ce2b AST: Completely remove NominalTypeDecl::LookupDirectFlags::IgnoreNewExtensions 2019-09-03 22:53:52 -04:00
Slava Pestov
89d5725c63 ClangImporter: Delay building imported conformances until we ask for them 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
220bc64064 ClangImporter: Directly track constructors imported into a nominal type
This avoids a re-entrant lookup while doing lazy member loading,
and eliminates a usage of LookupDirectFlags::IgnoreNewExtensions,
and the last usage of NominalTypeDecl::makeMemberVisible().
2019-09-03 22:39:36 -04:00
Slava Pestov
c87e1a23db Sema: Try harder not to page in all members of imported classes 2019-09-03 22:39:35 -04:00
Slava Pestov
75f4625bee AST: Peel off ClangModuleLoader.h from ASTContext.h 2019-09-03 22:39:35 -04:00
swift-ci
b08854787c Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-29 16:43:42 -07:00
Jordan Rose
6e25fd9ca4 Stop hiding '@frozen' from code completion (#26942)
And print it explicitly on imported NS_CLOSED_ENUMs.
2019-08-29 16:42:18 -07:00
swift-ci
5c025a7b77 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-27 11:23:51 -07:00
Robert Widmann
8d22702a22 Use Integrated Caching
Replumb the TypeLoc for the extended type as a TypeRepr instead. Fixup
the myriad callsites this touches in the process.
2019-08-26 11:48:29 -07:00
swift-ci
abb9f9b8ab Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-26 11:05:16 -07:00
Doug Gregor
f277280093 [Clang importer] Swift over to the abstract generic signature request. 2019-08-26 09:54:20 -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
swift-ci
3869e829fa Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-20 14:43:57 -07:00
Slava Pestov
62f18a52c0 Sema: Move attribute checking to typeCheckDecl() 2019-08-20 14:47:52 -04:00
swift-ci
d28622d4ac Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-19 21:43:25 -07:00
Slava Pestov
ccae884b2d ClangImporter: Try harder not to add accessors to their parent context
Unfortunately I don't have a test case for this one.
2019-08-19 23:00:57 -04:00
swift-ci
c7422c297d Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-19 10:24:02 -07:00
pschuh
971fb0a005 Refactor away importGlobalAsMethod. (#26683) 2019-08-19 10:14:27 -07:00
swift-ci
b6e97a229e Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-15 19:24:21 -07:00
Slava Pestov
1c3ac86796 AST: Banish OptionalTypeKind to ClangImporter.h
The only place this was used in Decl.h was the failability kind of a
constructor.

I decided to replace this with a boolean isFailable() bit. Now that
we have isImplicitlyUnwrappedOptional(), it seems to make more sense
to not have ConstructorDecl represent redundant information which
might not be internally consistent.

Most callers of getFailability() actually only care if the result is
failable or not; the few callers that care about it being IUO can
check isImplicitlyUnwrappedOptional() as well.
2019-08-15 18:41:42 -04:00
Slava Pestov
19d283d9dc AST: Replace ImplicitlyUnwrappedOptionalAttr with Decl::{is,set}ImplicitlyUnwrappedOptional() 2019-08-15 18:41:41 -04:00
swift-ci
4b43e8c608 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-09 18:44:21 -07:00
Thomas Roughton
1c1a6f2164 Import UsingShadowDecls (#26425) 2019-08-09 18:26:01 -07:00
swift-ci
380670fd01 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-09 17:44:26 -07:00
Slava Pestov
0063f158be AST: Request-ify synthesis of the implicit destructor 2019-08-09 19:08:47 -04: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
Slava Pestov
0c5d52d860 AST: Introduce AbstractStorageDecl::get{Parsed,Opaque}Accessor()
Also, change visitOpaqueAccessors() to call getOpaqueAccessor() instead of
asserting if the expected accessor does not exist.
2019-08-02 19:34:43 -04:00
Slava Pestov
7a9abe4c2d Merge pull request #26456 from slavapestov/remove-accessor-methods
AST: Remove a few utility methods from AbstractStorageDecl
2019-08-01 21:34:29 -04: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
Slava Pestov
64c32c695b AST: Remove a few utility methods from AbstractStorageDecl
Since the return value of getAccessor() depends on mutable state, it
does not make sense in the request evaluator world. Let's begin by
removing some utility methods derived from getAccessor(), replacing
calls to them with calls to getAccessor().
2019-08-01 18:31:58 -04:00
John McCall
765d3383f8 Merge pull request #26047 from pschuh/cpp-2
Add importing cxx function decls and the basic requisite AbstractionPattern support.
2019-08-01 13:30:59 -04:00
Slava Pestov
d3f65e7b4b AST: Remove SubscriptDecl::isSettable() 2019-07-31 21:26:02 -04:00
Slava Pestov
9f319e5d33 ClangImporter: Don't synthesize a getter for unbridged rawValue
The getter would just load from the stored property. We don't need a
getter for this.
2019-07-31 14:54:57 -04:00
Slava Pestov
e41760e44f Sema: Add request to compute if an AccessorDecl is transparent
Implicit accessors are sometimes transparent for performance reasons.
Previously this was done in Sema by maybeMarkTransparent(), which would
add a TransparentAttr. Replace this with a request.
2019-07-31 14:54:57 -04:00
Parker Schuh
4a5dae5ed4 Add importing cxx function decls and the basic requisite AbstractionPattern support. 2019-07-30 15:46:47 -07:00
Slava Pestov
d9fd3d3ec2 Merge pull request #26356 from slavapestov/accessors-are-not-members
Stop adding accessors to their parent DeclContext
2019-07-30 18:42:12 -04:00
pschuh
74803f0ab4 Import namespaces as EnumDecl. (#26339) 2019-07-30 15:17:08 -07:00
Slava Pestov
1ee2db4520 AST: Accessors no longer appear as members of their parent DeclContext
Accessors logically belong to their storage and can be synthesized
on the fly, so removing them from the members list eliminates one
source of mutability (but doesn't eliminate it; there are also
witnesses for derived conformances, and implicit constructors).

Since a few ASTWalker implementations break in non-trivial ways when
the traversal is changed to visit accessors as children of the storage
rather than peers, I hacked up the ASTWalker to optionally preserve
the old traversal order for now. This is ugly and needs to be cleaned up,
but I want to avoid breaking _too_ much with this commit.
2019-07-30 15:56:00 -04:00
Holly Borla
709efbc52c Sema: implement getInitKind using a request evaluator.
Add the request `InitKind` to lazily compute the kind of an initializer
declaration.
2019-07-26 15:55:09 -07:00
Slava Pestov
4eec522578 Sema: Fix inheritance of @requires_stored_property_inits
Previously we would copy this attribute from a superclass to the
subclass when validating a subclass. However, this is only correct
if the superclass is always guaranteed to have been validated
before the subclass.

Indeed, it appears this assumption is no longer true, so we would
sometimes lose track of the attribute, which would result in SILGen
failing to emit the ivar initializer entry point.

Instead, check for the attribute as part of the superclass walk
in checkAncestry(), ensuring the result is always up to date, correct,
and cached.

As a follow-up, we should also convert checkAncestry() into a
request, but I'm not doing that here to keep the fix short.

Fixes <rdar://problem/50845438>.
2019-07-23 12:23:27 -04:00
Slava Pestov
454281b226 AST: Split off StorageImplInfo from AbstractStorageDecl::AccessorRecord
We want to compute the former independently of the latter.
It's only 16 bits so storing it inside the Decl is fine;
it also allows us to eliminate the 'compact' representation
where an AbstractStorageDecl without an accessor record is
assumed to be stored.
2019-07-22 20:19:09 -04:00
Slava Pestov
a532a325e1 AST: Move a few methods from VarDecl down to ParamDecl 2019-07-22 20:19:09 -04:00
Varun Gandhi
009d0e5481 Use name mangler to generate identifiers for fields of anonymous types.
Fixes issue SR-10571 and corresponding rdar://problem/50337188.
2019-07-19 10:43:05 -07:00
Doug Gregor
f0513aef00 [Clang importer] Lazily synthesize error domain getter body 2019-07-11 23:10:25 -07:00
Doug Gregor
55f619ba81 [Clang importer] Lazily synthesize raw value bridging initializer. 2019-07-11 23:03:20 -07:00
Doug Gregor
4d4059e202 [Clang importer] Lazily synthesize value constructors. 2019-07-11 22:55:32 -07:00
Doug Gregor
9c17bb1ffe [Clang importer] Lazily synthesize struct default initializers. 2019-07-11 22:27:08 -07:00
Doug Gregor
d01e80f820 [Clang importer] Always synthesize bitfield Clang getter/setter.
We don't have an effective lazy-synthesis mechanism for
Clang function bodies, and we were doing it eagerly already,
so at least be honest about it.
2019-07-11 22:21:14 -07:00