Commit Graph

16719 Commits

Author SHA1 Message Date
swift-ci
d2cb1fbee9 Merge remote-tracking branch 'origin/master' into master-next 2018-04-16 11:08:33 -07:00
swift-ci
80defe51b7 Merge pull request #15950 from gottesmm/pr-ad010a566f73a3f80c1bce1ac1d652208c260c8b 2018-04-16 10:51:52 -07:00
swift-ci
f34fcf47cd Merge remote-tracking branch 'origin/master' into master-next 2018-04-16 10:48:14 -07:00
Michael Gottesman
26a569b33c [stringref-upgrade] Change FrontendInputsAndOutputs::numberOfPrimaryInputsEndingWith to take a StringRef instead of a const char *.
This is in prepration for changing Strings.h to use StringLiteral.
2018-04-16 09:50:54 -07:00
Michael Gottesman
87d633b4cd [stringref-upgrade] Return a StringRef from suffixForPrincipalOutputFileForAction instead of a const char *.
This is in prepration for changing Strings.h to use StringLiteral.
2018-04-16 09:50:26 -07:00
swift-ci
969feefd63 Merge remote-tracking branch 'origin/master' into master-next 2018-04-15 09:26:40 -07:00
Andrew Trick
22530b922f Merge pull request #15662 from atrick/access-refactor
[NFC] Refactor access enforcement utilities into MemAccessUtils.
2018-04-15 09:25:19 -07:00
swift-ci
897fe50a83 Merge remote-tracking branch 'origin/master' into master-next 2018-04-14 19:49:16 -07:00
Andrew Trick
39de8c7aed Revert "Mandatory SIL linker pass" 2018-04-14 16:41:34 -07:00
Andrew Trick
9fdba965b1 [NFC] Create an AccessedStorage utility for use in multiple exclusivity related passes.
Added new files, MemAccessUtils.h and MemAccessUtils.cpp to house the
new utility. Three functions previously in InstructionUtils.h move
here:
- findAccessedAddressBase
- isPossibleFormalAccessBase
- visitAccessedAddress

Rather than working with SILValues, these routines now work with the
AccessedStorage abstraction. This allows enforcement logic and SIL
pattern recognition to be shared across diagnostics and
optimization. (It's very important for this to be consistent).

The new AccessedStorage utility is a superset of the class that was
local to DiagnoseStaticExclusivity. It exposes the full set of all
recognized kinds of storage. It also represents function arguments as
an index rather that a SILValue. This allows an analysis pass to
compare/merge AccessedStorage results from multiple callee functions,
or more naturally propagate from callee to caller context.
2018-04-13 23:07:20 -07:00
swift-ci
5734192793 Merge remote-tracking branch 'origin/master' into master-next 2018-04-13 19:32:37 -07:00
Huon Wilson
3124f6ad50 Merge pull request #15916 from huonw/fatalError-bodies
[IDE] Refactoring to change function bodies to "fatalError()".
2018-04-14 12:30:05 +10:00
swift-ci
5498809c7c Merge remote-tracking branch 'origin/master' into master-next 2018-04-13 17:16:09 -07:00
Slava Pestov
d520d030f5 SILOptimizer: Add 'mandatory SIL linker' pass
As a first step to getting mandatory inlining out of the business
of 'linking' (walking the function graph and deserializing all
referenced functions), add a new optimizer pass which links
everything in the mandatory pipeline.

For now this is mostly NFC, except it regresses an optimization
I made recently by linking in bodies of methods of deserialized
vtables eagerly. This will be addressed in upcoming patches.
2018-04-13 14:18:53 -07:00
swift-ci
bb1b3ed3b2 Merge remote-tracking branch 'origin/master' into master-next 2018-04-13 11:58:15 -07:00
Ben Langmuir
bcec86ceb6 Merge pull request #15914 from akyrtzi/driver-index-supplemental-fix
[driver/index] Fix an issue where the -index-file invocation was not working when there are 5 or more input files
2018-04-13 11:41:12 -07:00
Ben Langmuir
bfcb710e2c Remove DoesNotAffectIncrementalBuild from -index-ignore-system-modules 2018-04-13 10:16:29 -07:00
swift-ci
645513b826 Merge remote-tracking branch 'origin/master' into master-next 2018-04-12 23:48:10 -07:00
Rintaro Ishizaki
0c44efdc4f Merge pull request #15896 from rintaro/parse-decls-named
[Parse] Hoist diagnostics for named 'subscript'/'init'
2018-04-13 15:45:26 +09:00
Huon Wilson
8056102ee5 [IDE] Refactoring to change function bodies to "fatalError()".
This is immensely useful when working on generic code, where the signatures
of (many) functions are all that is required, and removing the bodies makes
things compile faster, allows tools like creduce to work better and results in
less noise in a debugger.

Unfortunately the design of refactoring means this currently only works on a
single top-level decl, or multiple decls inside a type.
2018-04-13 15:56:56 +10:00
swift-ci
ff91175c5e Merge remote-tracking branch 'origin/master' into master-next 2018-04-12 22:15:59 -07:00
Slava Pestov
07e95de659 Merge pull request #15895 from slavapestov/sil-link-remove-worklist
Remove one of the two worklists from the SIL linker
2018-04-12 22:10:57 -07:00
Rintaro Ishizaki
e60d75e873 [Parse] Remove unused diagnostics. 2018-04-13 11:58:33 +09:00
swift-ci
5ea4848930 Merge remote-tracking branch 'origin/master' into master-next 2018-04-12 19:39:53 -07:00
Argyrios Kyrtzidis
8207212f0b [driver/index] Fix an issue where the -index-file invocation was not working when there are 5 or more input files
When the supplementary-outputs file is written for an -index-file invocation it writes out the first input file
given in arguments instead of the input file that is provided by -index-file-path option. This then causes the frontend
index invocation to fail with an error because there is a mismatch in the primary input file and the input file that is written
in the supplementary-outputs file.
2018-04-12 19:37:44 -07:00
Vedant Kumar
bb567886d8 [Coverage] Disable forced emission for unmapped decls (#15909)
Disable forced SILGen for lazy functions which are not used for code
coverage reporting.

As a drive-by, fix the forced emission logic for functions profiled for
PGO.

This helps address a compile-time issue (r://39332957).
2018-04-12 19:34:34 -07:00
swift-ci
4d13553260 Merge remote-tracking branch 'origin/master' into master-next 2018-04-12 19:25:34 -07:00
Argyrios Kyrtzidis
0682756a72 Merge pull request #15743 from nathawes/rdar38231888-sourcekit-error-when-parsing-the-compiler-arguments
[Driver] Add -driver-filelist-threshold to set the number of inputs beyond which filelists are used
2018-04-12 19:10:40 -07:00
Slava Pestov
f4b170c144 SIL: Add SILModule::loadFunction()
This is like linkFunction(), except it only deserializes the immediate
function body, without recursively walking its transitive dependencies.
2018-04-12 18:08:05 -07:00
Ben Langmuir
2ca8fe7aa1 Update option help text per review comment 2018-04-12 18:03:06 -07:00
swift-ci
0944182dff Merge remote-tracking branch 'origin/master' into master-next 2018-04-12 16:21:29 -07:00
Huon Wilson
db8b98bbc9 Merge pull request #15842 from huonw/generic-class-objc-protocol-extension
[Sema] Explicit error for "extension GenericClass : ObjcProtocol".
2018-04-13 09:11:38 +10:00
Huon Wilson
d33a5c16f2 [Sema] Explicit error for "extension GenericClass : ObjcProtocol".
If there was any requirements in the @objc protocol, the user got an error in
some form (a complaint about those requirements), but giving the direct error is
better, and handles @objc protocol with no requirements.

Also, fix a hole in that existing @objc method check: in `class Outer<T> { class
Inner {} }`, Inner should be considered generic, but the loop that was checking
for this didn't consider it.

Fixes https://bugs.swift.org/browse/SR-7370 and rdar://problem/39239512.
2018-04-13 08:09:02 +10:00
swift-ci
7345b282dc Merge remote-tracking branch 'origin/master' into master-next 2018-04-12 13:34:45 -07:00
swift-ci
07bada28ce Merge pull request #15907 from nkcsgexi/simple-string-representable 2018-04-12 13:26:50 -07:00
Xi Ge
4c4e4d2b79 migrator: handle simple attribute assignment and reference.
This patch migrates simple attribute assignment and reference when the
attribute used to be of type String and later became StringRepresentable struct.

Related: rdar://38192995
2018-04-12 11:54:28 -07:00
swift-ci
491445b075 Merge remote-tracking branch 'origin/master' into master-next 2018-04-12 11:35:46 -07:00
swift-ci
a16c423518 Merge pull request #15875 from dcci/di-member 2018-04-12 11:35:31 -07:00
swift-ci
9494376793 Merge remote-tracking branch 'origin/master' into master-next 2018-04-12 09:53:01 -07:00
Jordan Rose
ab9f62dcd8 Merge pull request #15864 from jrose-apple/get-set-stop
Diagnose unavailable getters and setters
2018-04-12 09:52:05 -07:00
Nathan Hawes
0a4204e99f [Driver] Add -driver-filelist-threshold to set the number of inputs beyond which filelists are used
When generating a compiler invocation in driver::createCompilerInvocation()
we end up using filelists if the number of inputs is > 128 (to work around
command line arg limits). We never actually write them out though, and so
fail when parsing the frontend arguments that reference them.

As this function is called frequently by SourceKit and command line limits
aren't a concern here, this patch makes the 128 threshold value configurable
via a new -driver-filelist-threshold option. This is set to its maximum value
in driver::createCompilerInvocation() to ensure filelists aren't used. This
new option makes the existing -driver-use-filelists (that forces filelists to
be used) redundant as it's now equivalent to -driver-filelist-threshold=0.

Resolves rdar://problem/38231888
2018-04-12 05:24:03 -07:00
swift-ci
115f220410 Merge remote-tracking branch 'origin/master' into master-next 2018-04-11 22:15:16 -07:00
Saleem Abdulrasool
8c4f18ee78 Merge pull request #15746 from compnerd/dependency-inversion
Basic: record layering violation for linking
2018-04-11 22:04:00 -07:00
swift-ci
aa24d5a265 Merge remote-tracking branch 'origin/master' into master-next 2018-04-11 17:19:26 -07:00
Rintaro Ishizaki
b35a02570d Merge pull request #15869 from rintaro/parse-switch-unknown
[Parse] Handle edge case of '@unknown' for switch case
2018-04-12 09:18:17 +09:00
swift-ci
9e3d5aa0c5 Merge remote-tracking branch 'origin/master' into master-next 2018-04-11 13:54:58 -07:00
eeckstein
4a500008c6 Merge pull request #15874 from eeckstein/fix-membehavior
Fix wrong usage of escape analysis in MemBehavior
2018-04-11 13:38:24 -07:00
Erik Eckstein
3adf59561f Fix wrong usage of escape analysis in MemBehavior
The EscapeAnalysis:canEscapeTo function was actually broken, because it did not detect all escapes of a reference/pointer.
I completely replaced the implementation with the correct one (canObjectOrContentEscapeTo) and removed the now obsolete canObjectOrContentEscapeTo.
Fixes a miscompile.

rdar://problem/39161309
2018-04-11 10:20:36 -07:00
Davide Italiano
b4d563802b [SILInstruction] Introduce isDebugInstruction().
This is a property of an instruction and should be a member
function of `SILInstruction` and not a free function in
`DebugUtils`. Discussed with Adrian.
2018-04-11 10:14:21 -07:00
swift-ci
4b5a4a963d Merge remote-tracking branch 'origin/master' into master-next 2018-04-11 10:08:16 -07:00