Commit Graph

20516 Commits

Author SHA1 Message Date
Xi Ge
7b445c3c98 api-digester: keep track of the introduced platforms and language versions for all APIs
These fields will be used to diagnose the missing of available
attributes for newly added APIs.

rdar://51089418
2019-05-23 17:23:30 -07:00
Joe Groff
eff6c5ae31 Merge pull request #25019 from jckarter/dont-export-equalContexts
Runtime: Don't export equalContexts.
2019-05-23 15:08:03 -07:00
Joe Groff
bfc9ba98f8 Runtime: Don't export equalContexts.
This should be an internal-only helper.
2019-05-23 10:44:55 -07:00
Slava Pestov
b26ba2dce9 AST: Add utilities to ASTContext for looking up builtin initializers 2019-05-23 10:40:34 -04:00
Andrew Trick
bdf7b2ade6 Merge pull request #24947 from atrick/fix-dynamic-exclusivity
Fix exclusivity diagnostics to be aware of [dynamically_replaceable].
2019-05-22 10:36:01 -07:00
Joe Groff
33410bced6 Merge pull request #24857 from linux-on-ibm-z/gather-scatter
[IRGen] Remove SetBitEnumerator from ClusteredBitVector
2019-05-21 16:16:57 -07:00
Doug Gregor
22c0995046 Allow non-@objc ‘dynamic’ in all language modes.
Non-‘@objc’ ‘dynamic’ has been allowed since Swift 5, but there’s no
reason to tie it to the language mode (Swift >= 5).

Fixes rdar://problem/50348013.
2019-05-21 13:40:04 -07:00
swift-ci
b170ad72a8 Merge pull request #24953 from gottesmm/pr-71990c28f613fe44d9bf454eeb0b89a4356c8f91 2019-05-21 10:40:51 -07:00
Michael Gottesman
748bf88bbe [ownership] Convert SILOptimizer/cast_folding.swift to work with ownership and fix all issues exposed. 2019-05-21 09:07:13 -07:00
Arnold Schwaighofer
528fe42bfb Merge pull request #24923 from aschwaighofer/dynamically_replaceable_closure_fixes
Fix capture promotion and closure scope analysis' handling of dynamically_replaceable functions
2019-05-21 05:56:41 -07:00
Harlan Haskins
ca5b94f7d9 [Frontend] Re-add FrontendObserver methods (#24917)
These observer methods were used by external clients. Since we no longer
have the granularity between diagnostics and optimization, they're
rolled into a new observer callback, `performedSILProcessing`.

This (effectively) reverts commit 7b43e1d04d.
2019-05-20 21:33:33 -07:00
Andrew Trick
a3de97bb87 Add SILParser support for [dynamically_replaceable]. 2019-05-20 21:33:01 -07:00
Arnold Schwaighofer
6c0baaee85 Fix closurescope analysis
rdar://50949761
2019-05-20 13:20:23 -07:00
David Ungar
6cf09fa9bb Merge pull request #24905 from davidungar/interpolated-string-literal-trailing-quote-loc
[NameLookup: ASTScope] Add trailing quote location to interpolated string literal.
2019-05-20 12:57:44 -07:00
Jordan Rose
7963529da1 Merge pull request #24819 from jrose-apple/when-everyone-is-super-no-one-will-be
[Serialization] Drop a class if the superclass can't be found
2019-05-20 11:30:08 -07:00
Jordan Rose
e0658a3726 Merge pull request #24774 from theblixguy/fix/duplicate-tuple-labels
[Typechecker] Ban tuples with duplicate labels
2019-05-20 11:28:46 -07:00
David Ungar
e64ebadf04 Add explanation. 2019-05-20 11:22:30 -07:00
David Ungar
7a8b3c8383 Add trailing quote location to interpolated string literal. 2019-05-19 15:26:34 -07:00
Pavel Yaskevich
54672320ce Merge pull request #24873 from xedin/diag-missing-contextual-conformances-fixed
[ConstraintSystem] Use `missing conformance` fix to diagnose contextual failures
2019-05-17 17:52:09 -07:00
Pavel Yaskevich
e76ae9c343 [ConstraintSystem] Use missing protocol fix for sequence element mismatches related to protocols 2019-05-17 14:32:04 -07:00
Jordan Rose
96e8d56878 [Serialization] Add recovery for structs with non-loadable constraints
That is, if a struct's generic requirements can't be deserialized,
drop the struct. This is the same logic that's already in play for
enums and (as of the previous commit) classes, so it should be pretty
well tested by now. (Hence the sole test I'm adding here, snuck into
superclass.swift because it's a superclass /constraint/ being tested.)

I don't know of any outstanding issues caused by this, but it was
weird to have it for enums and classes but not structs, so here we
are.
2019-05-17 10:25:01 -07:00
Jordan Rose
ff7c6f6702 [Serialization] Drop a class if the superclass can't be found
...instead of crashing. Also drop the class if its generic
requirements depend on a type that can't be loaded (instead of
crashing).

rdar://problem/50125674
2019-05-17 10:25:01 -07:00
Michael Munday
d3262ec10d [IRGen] Remove SetBitEnumerator from ClusteredBitVector
The change replaces 'set bit enumeration' with arithmetic
and bitwise operations. For example, the formula
'(((x & -x) + x) & x) ^ x' can be used to find the rightmost
contiguous bit mask. This is essentially the operation that
SetBitEnumerator.findNext() performed.

Removing this functionality reduces the complexity of the
ClusteredBitVector (a.k.a. SpareBitVector) implementation and,
more importantly, API which will make it easier to modify
the implementation of spare bit masks going forward. My end
goal being to make spare bit operations work more reliably on
big endian systems.

Side note:

This change modifies the emit gather/scatter functions so that
they work with an APInt, rather than a SpareBitVector, which
makes these functions a bit more generic. These functions emit
instructions that are essentially equivalent to the parallel bit
extract/deposit (PEXT and PDEP) instructions in BMI2 on x86_64
(although we don't emit those directly currently). They also map
well to bitwise manipulation instructions on other platforms (e.g.
RISBG on IBM Z). So we might find uses for them outside spare bit
manipulation in the future.
2019-05-17 11:55:06 +01:00
Saleem Abdulrasool
7514adf66a Driver: introduce new -libc option for Windows
On Windows, there are multiple variants of the C runtime that must be
explicitly specified and consistently used from the runtime to the
application.  The new `-libc` option allows us to control the linking
phase by correctly embedding the requested library to be linked.  It is
made into a required parameter on Windows and will add in the
appropriate flags for the imported C headers as well.  This ensures that
the C library is not incorrectly linked.
2019-05-16 21:01:47 -07:00
Jordan Rose
3b4bb1960d @_implementationOnly: fix over-eager checking for vars in extensions (#24629)
The logic I had here checked whether an extension used an
implementation-only type whenever there was a declaration within that
extension that needed checking...but unfortunately that included not
just PatternBindingDecls (whose access is filtered at a later step)
but things like IfConfigDecls (#if). Change this to only check
signatures of extensions with ABI-public members, something that is
tested once when visiting an ExtensionDecl.

Additionally, skip AccessorDecls entirely, since they'll be tested
as part of the corresponding subscript or var. This saves a duplicate
diagnostic.

rdar://problem/50541589
2019-05-16 13:13:48 -07:00
Andrew Trick
868156c069 Merge pull request #24773 from atrick/fix-accessopt-slow
Add AccessEnforcementOpts fast paths.
2019-05-16 10:59:02 -07:00
Jordan Rose
9647483aee Warn when using '@_implementationOnly' inconsistently in a module (#24800)
I thought it would be useful to allow some uses of a module to be
'@_implementationOnly' and others to not be in case someone wanted to
change from one to the other gradually, but it turns out that if
you're trying to /make/ an import implementation-only, you want to
know everywhere you used it.

rdar://problem/50748157
2019-05-16 09:13:34 -07:00
Jordan Rose
5191b036f2 Merge pull request #24008 from allevato/batch-mode-response-files
Fix response file support for batch jobs.
2019-05-16 08:18:18 -07:00
Joe Groff
d22a405e38 Merge pull request #24822 from jckarter/opaque-type-runtime-weak-link
IRGen: Weak-link opaque type entry points.
2019-05-16 07:06:36 -07:00
Pavel Yaskevich
30be693913 Merge pull request #24808 from xedin/cleaner-foreach
[TypeChecker] Simplify for ... in ... type checking
2019-05-16 00:16:46 -07:00
Joe Groff
2ade303387 IRGen: Weak-link opaque type entry points.
When backward deploying to an OS that may not have these entry points, weak-link them so that they
can be used conditionally in availability contexts that check for them.

rdar://problem/50731151
2019-05-15 20:40:54 -07:00
Rintaro Ishizaki
1e711850bb Merge pull request #24805 from rintaro/ide-completion-unresolvedarg-rdar50696432
[CodeCompletion] Call argument completion for implicit member expression
2019-05-15 18:49:14 -07:00
Joe Groff
0be95f56bd Merge pull request #24798 from jckarter/opaque-type-check-availability
Opaque types require a newer Swift runtime.
2019-05-15 18:05:40 -07:00
Rintaro Ishizaki
5b5d342995 [CodeCompletion] Enable call signature completion for unresolved member
rdar://problem/50696432
2019-05-15 17:31:19 -07:00
Jordan Rose
6caedcde57 Merge pull request #24788 from apple/command-p
Don't print extensions to conform to protocols that aren't printed

rdar://problem/50748072
2019-05-15 17:20:11 -07:00
Doug Gregor
165133e3dd Merge pull request #24799 from DougGregor/disfavored-overload-attr
Add @_disfavoredOverload attribute to affect overload resolution.
2019-05-15 16:03:28 -07:00
Suyash Srijan
935128cd3b Merge branch 'master' into fix/duplicate-tuple-labels 2019-05-15 22:38:52 +01:00
Pavel Yaskevich
1cc6f774a1 [ConstraintSystem] Improve contextual mismatch diagnostics for for ... in <expr> loop 2019-05-15 14:34:24 -07:00
swift-ci
aa6827a46d Merge pull request #24796 from ravikandhadai/oslog-optimization 2019-05-15 13:01:37 -07:00
Joe Groff
cec9e9e33a Opaque types require a newer Swift runtime.
Check the availability of decls that declare an opaque return type to ensure they deploy to a
runtime that supports opaque types.

rdar://problem/50731151
2019-05-15 11:39:53 -07:00
Xi Ge
60ee9527bb Merge pull request #24776 from nkcsgexi/digester-fix
Several swift-api-digester fixes
2019-05-15 10:55:14 -07:00
Doug Gregor
5aea1315cd Add @_disfavoredOverload attribute to affect overload resolution.
Introduce an attribute @_disfavoredOverload that can be used to state
that a particular declaration should be avoided if there is a
successful type-check for a non-@_disfavoredOverload. It's a way to
nudge overload resolution away from particular solutions.
2019-05-14 23:07:26 -07:00
Slava Pestov
c141c4807d Merge pull request #24797 from slavapestov/more-type-checked-accessors
More type checked accessors
2019-05-15 00:49:15 -04:00
Slava Pestov
86f9ca7245 AST: Add ProtocolConformanceRef::getWitnessByName() 2019-05-14 21:18:06 -04:00
Ravi Kandhadai
9be4fef53a [SIL Optimization] Add a mandatory optimization pass for optimizing
the new os log APIs based on string interpolation.
2019-05-14 18:08:59 -07:00
Brent Royal-Gordon
82928fd821 Merge pull request #24464 from brentdax/charmed-interpolations
[Parse][Sema] Improve interpolation parsing and construction
2019-05-14 17:49:46 -07:00
swift-ci
7ef557e7c8 Merge pull request #24780 from ravikandhadai/constexpr-refactoring 2019-05-14 16:34:48 -07:00
Slava Pestov
6e3609dc22 AST: ProtocolConformanceRef::getTypeWitnessByName() should be an instance method 2019-05-14 19:28:55 -04:00
Jordan Rose
c622f6b8dd Simplify swift::getInheritedForPrinting to take a PrintOptions
This lets us make some more assumptions in the next commit, but I
think it's also just a nice cleanup to /not/ allow random predicates
here.

There were three callers of this API:

- PrintAST, which was using PrintOptions::shouldPrint but /also/
  incorrectly notifying listeners that a declaration would be skipped.

- (IDE) Interface generation, which uses PrintOptions::shouldPrint to
  count how many "inherits" there will be.

- SwiftDocSupport's reportRelated, which does no filtering at all.
  Creating a PrintOptions here is a little more expensive, but still.

No intended functionality change.
2019-05-14 16:16:28 -07:00
Xi Ge
ae16a74af9 api-digester: diagnose adding conformances to existing protocols. rdar://48131686 2019-05-14 15:40:04 -07:00