Commit Graph

11880 Commits

Author SHA1 Message Date
swift_jenkins
b9f998ffa4 Merge remote-tracking branch 'origin/master' into master-next 2019-11-15 15:56:48 -08:00
Hamish Knight
e8c30ca1b7 Remove UnqualifiedLookup
Now that we have UnqualifiedLookupRequest, this
class no longer serves much of a purpose. Inline
its constructor logic into the request.
2019-11-15 14:25:42 -08:00
Hamish Knight
3aa7158d6c Switch UnqualifiedLookup callers over to UnqualifiedLookupRequest 2019-11-15 14:25:42 -08:00
Hamish Knight
633de0241b Add UnqualifiedLookupRequest
This request performs raw unqualified lookup,
and will be used to replace the UnqualifiedLookup
type.
2019-11-15 14:25:42 -08:00
Hamish Knight
185c265ef6 NFC: Move LookupResult from Sema to Name Lookup
This will be used as the result type for the
unqualified lookup request.
2019-11-15 14:25:41 -08:00
Hamish Knight
6d6feb60de [CSDiagnostics] Support static "Type." fix-it
Check whether we found a static property, and if
so, suggest inserting "Type." instead of "self.".

Resolves SR-11788.
2019-11-15 11:12:12 -08:00
David Ungar
b5afac3c08 msgs unfmt 2019-11-15 10:30:55 -08:00
Doug Gregor
0b6ef0d4d1 Merge pull request #28276 from DougGregor/constraint-solver-expr-ctor
[Constraint solver] Remove expression from the constructor.
2019-11-14 22:48:07 -08:00
Doug Gregor
24b47b5673 [Constraint solver] Sink Expr::getPreorderIndexMap() into its client. 2019-11-14 20:33:00 -08:00
Xi Ge
2fbb0c1170 Merge pull request #28272 from nkcsgexi/let-var-is-file
ABI/API checker: don't complain about changing var to let or vice versa
2019-11-14 18:22:21 -08:00
Marc Rasi
f5677cbe42 add @nondiff to AnyFunctionType params 2019-11-14 16:49:22 -08:00
Doug Gregor
01f203a54d [Constraint system] Sink Expr::getDepthMap() into its one client.
NFC. It'll be easier to refactor this when it's not an API on Expr.
2019-11-14 15:02:58 -08:00
Hamish Knight
1be22c5d48 [Sema] Requestify default argument type checking (#27756)
[Sema] Requestify default argument type checking
2019-11-14 14:09:03 -08:00
Xi Ge
c8ce5b304c ABI/API checker: don't complain about changing var to let or vice versa
The tool diagnoses the removal of getter/setter for properties, so complaining about the keyword change can be redundant.

rdar://problem/57201030
2019-11-14 13:59:26 -08:00
Holly Borla
5bb50068ac Merge pull request #28243 from hborla/missing-generic-args-refactoring
[ConstraintSystem] Missing generic args/hole refactoring
2019-11-14 13:48:40 -08:00
Hamish Knight
3c05acac15 Address review feedback
Rename getDefaultArgumentInitContextCached,
and have it return an Optional<Initializer *>.
2019-11-14 12:51:04 -08:00
Doug Gregor
ec70b62d5e Merge pull request #28107 from allevato/emit-pcm
Add driver flag to precompile Swift-compatible explicit Clang modules.
2019-11-14 10:25:53 -08:00
Robert Widmann
3975e72706 Merge pull request #28246 from CodaFi/contextual-equivalence
Drop the TopLevelContext from the high-level type checker entrypoints
2019-11-13 19:58:57 -08:00
swift-ci
3b50749907 Merge pull request #28247 from gmittert/ShiftingBlame 2019-11-13 19:22:33 -08:00
Dan Liew
5446d333b8 Merge pull request #28126 from danliew-apple/rdar_56346688
[Sanitizers] Add Driver/Frontend option to enable sanitizer instrumentation that supports error recovery
2019-11-13 17:19:52 -08:00
Gwen Mittertreiner
5f3a6af0e5 Explicitly Specify a 64bit Shift to Fix Warning
Explicitly doing a 64bit shift silences the otherwise noisy warning:
```
[1548/1735] Building CXX object
tools\swift\lib\Sema\CMakeFiles\swiftSema.dir\NameBinding.cpp.obj

S:\toolchain\swift\include\swift/AST/IndexSubset.h(96): warning C4334:
'<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit
shift intended?)

S:\toolchain\swift\include\swift/AST/IndexSubset.h(184): warning C4334:
'<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit
shift intended?)
```
2019-11-13 15:59:27 -08:00
Holly Borla
c0312b9c0e [ConstraintSystem] Record holes in the constraint system using a new flag in
`TypeVariableOptions` rather than using a separate data structure in the
constraint system.
2019-11-13 15:46:36 -08:00
Robert Widmann
88ee618a33 Move Vending Top-Level Autoclosure discriminators into ASTContext
This bit has historically survived typechecking and parsing across source files.  Stick it where we stick the other global state.

This also means we don't have to thread TopLevelContext around anymore when invoking high-level typechecking entrypoints.
2019-11-13 15:28:23 -08:00
swift-ci
5fc1d17bf9 Merge remote-tracking branch 'origin/master' into master-next 2019-11-13 09:10:56 -08:00
Robert Widmann
d890b8ad41 Remove some save-and-restores
An awful pattern we use throughout the compiler is to save and restore global flags just for little things.  In this case, it was just to turn on some extra options in AST printing for type variables. The kicker is that the ASTDumper doesn't even respect this flag. Add this as a PrintOption and remove the offending save-and-restores.

This doesn't quite get them all: we appear to have productized this pattern in the REPL.
2019-11-13 07:37:12 -08:00
David Ungar
30429c0fa1 Ensure that files with missing supplementaries get recompiled. 2019-11-12 20:41:03 -08:00
David Ungar
69775ff850 Comments 2019-11-12 20:41:03 -08:00
David Ungar
742c3985bd Source-range-based dependencies
Frontend outputs source-as-compiled, and source-ranges file with function body ranges and ranges that were unparsed in secondaries.
Driver computes diffs for each source file. If diffs are in function bodies, only recompiles that one file. Else if diffs are in what another file did not parse, then the other file need not be rebuilt.
2019-11-12 20:41:02 -08:00
Keith Smiley
bf4aaacb02 Remove @frozen without library evolution warning
This warning is produced if you annotate an enum with `@frozen` but
build without library evolution enabled. The problem is that if you
only build with library evolution enabled for release builds, this
leaves you with a warning for all debug builds. The downside of this
change is that if you never build with library evolution, you may have
this unnecessary annotation without noticing.
2019-11-12 19:35:05 -08:00
swift-ci
9b98492953 Merge remote-tracking branch 'origin/master' into master-next 2019-11-12 17:30:10 -08:00
swift-ci
39fb55b616 Merge pull request #28156 from marcrasi/diff-fn-ty-ast-bits 2019-11-12 17:28:47 -08:00
Marc Rasi
6413f4341a [AutoDiff upstream] AST bits for @differentiable fn ty 2019-11-12 15:19:03 -08:00
swift-ci
d9223a7d16 Merge remote-tracking branch 'origin/master' into master-next 2019-11-12 13:30:45 -08:00
Doug Gregor
fb9bee7d0b Merge pull request #28173 from CodaFi/gradual-typing
[NFC] Centralize TypeChecker Flags With TypeCheckerOptions
2019-11-12 13:19:48 -08:00
swift-ci
aa57f0c92b Merge remote-tracking branch 'origin/master' into master-next 2019-11-12 12:09:57 -08:00
Arnold Schwaighofer
a30f80457d Merge pull request #28044 from aschwaighofer/sil_type_expansion_context
SIL: Use a TypeExpansionContext in SIL lowering to expand opaque type archetypes as part of lowering
2019-11-12 12:02:20 -08:00
swift-ci
804c21e3b6 Merge remote-tracking branch 'origin/master' into master-next 2019-11-12 11:50:43 -08:00
Dan Liew
63e72909b5 [Sanitizers] Add Driver/Frontend option to enable sanitizer instrumentation that supports error recovery.
The new option `-sanitize-recover=` takes a list of sanitizers that
recovery instrumentation should be enabled for. Currently we only
support it for Address Sanitizer.

If the option is not specified then the generated instrumentation does
not allow error recovery.

This option mirrors the `-fsanitize-recover=` option of Clang.

We don't enable recoverable instrumentation by default because it may
lead to code size blow up (control flow has to be resumable).

The motivation behind this change is that today, setting
`ASAN_OPTIONS=halt_on_error=0` at runtime doesn't always work. If you
compile without the `-sanitize-recover=address` option (equivalent to
the current behavior of the swift compiler) then the generated
instrumentation doesn't allow for error recovery. What this means is
that if you set `ASAN_OPTIONS=halt_on_error=0` at runtime and if an ASan
issue is caught via instrumentation then the process will always halt
regardless of how `halt_on_error` is set. However, if ASan catches an
issue via one of its interceptors (e.g. memcpy) then `the halt_on_error`
runtime option is respected.

With `-sanitize-recover=address` the generated instrumentation allows
for error recovery which means that the `halt_on_error` runtime option
is also respected when the ASan issue is caught by instrumentation.

ASan's default for `halt_on_error` is true which means this issue only
effects people who choose to not use the default behavior.

rdar://problem/56346688
2019-11-12 11:33:58 -08:00
Michael Gottesman
a02fca16e2 [ownership] Add a frontend option -disable-ossa-opts to disable ossa based opts for benchmarking purposes. 2019-11-12 10:12:45 -08:00
Robert Widmann
48805b1d44 Give ASTContext TypeCheckerOptions
Strip TypeChecker of all of this state.
2019-11-12 09:56:01 -08:00
swift-ci
06850c23dc Merge remote-tracking branch 'origin/master' into master-next 2019-11-11 21:10:01 -08:00
Harlan Haskins
2223b923cf Merge pull request #28193 from harlanhaskins/truncation-station
[TBDGen] Match TAPI's truncation behavior for dylib versions
2019-11-11 20:52:13 -08:00
Harlan Haskins
3745dcc3e4 [TBDGen] Match TAPI's truncation behavior for dylib versions
TAPI and the linker truncate individual version components to 255 if
they overflow, because the linker packs 3 version components into a
32-bit int. Make sure we use the same parsing routines as TAPI.

Fixes rdar://57043178
2019-11-11 15:11:19 -08:00
Tony Allevato
3c45041b17 Add driver modes to emit and dump Clang precompiled modules. 2019-11-11 15:00:51 -08:00
swift-ci
9f659177af Merge remote-tracking branch 'origin/master' into master-next 2019-11-11 14:50:04 -08:00
Robert Widmann
28e4f52756 Merge pull request #28192 from CodaFi/synthetic-symptotics
Remove SourceFile::SynthesizedDecls
2019-11-11 14:45:33 -08:00
Arnold Schwaighofer
8a4d61fb1d Remove FIXME in TypeExpansionAnalysis: It's cache needed to be keyed by the type expansion context 2019-11-11 14:21:52 -08:00
Arnold Schwaighofer
8ec3a77e94 Add TypeExpansionContext to AST substitution functions
Also add hasOpaqueArchetypePropertiesOrCases() this function will be
needed by SIL type lowering to determine whether types containing opaque
archetype stored properties or cases should be considered as potentially
address types.
2019-11-11 14:21:52 -08:00
Arnold Schwaighofer
f5fe7c1868 Add an API to map substitution map into a type expansion context. 2019-11-11 14:21:52 -08:00
Arnold Schwaighofer
d9a575ca4d Add TypeExpansionContext 2019-11-11 14:21:52 -08:00