Commit Graph

26974 Commits

Author SHA1 Message Date
Hugh Bellamy
7afa43c15b Merge pull request #7488 from hughbe/clangdecl-assert
Change ClangImporter if check to an assertion
2017-02-16 15:43:05 +07:00
swift-ci
36a60d253c Merge pull request #7519 from rudkx/dump-source-range 2017-02-16 00:35:47 -08:00
swift-ci
cca3398543 Merge pull request #7517 from gottesmm/revert_cmake_changes 2017-02-15 23:51:44 -08:00
Joe Shajrawi
9178030d92 Merge pull request #7514 from shajrawi/store_opaque_values
support stores of non-loadable types under opaque mode
2017-02-15 23:32:48 -08:00
Mark Lacey
58b14ffc2d Update -debug-constraints to dump the source range immediately.
We end up dumping information during constraint generation, and it's
nice to know which range we're dealing with at that point.
2017-02-15 23:21:52 -08:00
Michael Gottesman
8437819b5a [CMake] Revert recent changes.
These changes caused a number of issues:

1. No debug info is emitted when a release-debug info compiler is built.
2. OS X deployment target specification is broken.
3. Swift options were broken without any attempt any recreating that
functionality. The specific option in question is --force-optimized-typechecker.

Such refactorings should be done in a fashion that does not break existing
users and use cases.

This reverts commit e6ce2ff388.
This reverts commit e8645f3750.
This reverts commit 89b038ea7e.
This reverts commit 497cac64d9.
This reverts commit 953ad094da.
This reverts commit e096d1c033.

rdar://30549345
2017-02-15 22:26:06 -08:00
Rintaro Ishizaki
cb8bbf0550 Merge pull request #7382 from rintaro/parse-ifconfig-fix1
[Parse] Improve '#if' block parsing
2017-02-16 14:34:05 +09:00
Slava Pestov
010d2e814d Merge pull request #7513 from slavapestov/circular-deserialization-fix
AST: Fix excessive deserialization in GenericSignatureBuilder
2017-02-15 19:07:40 -08:00
Rintaro Ishizaki
3b42894f13 [Parse] Fix parsing three-version-components in #if
* Narrow allowance of 3+ components numeric literal to condition part of the
  directive.
* Allow 3+ components in '#if' directive in decl list position as well.
2017-02-16 11:35:51 +09:00
Rintaro Ishizaki
cfe742d1eb [Parse] Minor improvements in conditional compilation block parsing
* Don't emit duplicated 'expected #else or #endif at end of conditional
  compilation block' error.

    class Foo {
      #if true
        func foo() {}
    [EOF]

* Improve error message when seeing '}' in config block.

    class Foo {
    #if true
        func foo();
    } // error: unexpected '}' in conditional compilation block
    #else
    #endif
2017-02-16 11:35:51 +09:00
Arnold Schwaighofer
ae0b6b1e06 Merge pull request #7186 from aschwaighofer/cow_exist_silgen_support
SIL/SILGen support for copy-on-write existentials
2017-02-15 17:41:10 -08:00
Joe Shajrawi
992caba90e support stores of non-loadable types under opaque mode 2017-02-15 17:19:18 -08:00
Slava Pestov
62b650af83 AST: Fix excessive deserialization in GenericSignatureBuilder
When we're looking up all associated types with the same name in order
to find the right archetype anchor, skip extension members to avoid
circular deserialization.

Discovered while investigating <rdar://problem/30248571>.
2017-02-15 17:01:44 -08:00
Michael Gottesman
e571e2c2aa Merge pull request #7509 from gottesmm/more_borrow_propagation
More borrow stuff
2017-02-15 16:33:21 -08:00
Michael Gottesman
d4ae7a3f8a [semantic-sil] When calling emitRValueForDecl, borrow the value before deciding whether or not to copy the value.
rdar://29791263
2017-02-15 15:29:30 -08:00
Michael Gottesman
58c3959e90 [silgen] Remove ManagedBorrowedValue in favor of the usage of FormalEvaluationScopes.
rdar://29791263
2017-02-15 15:28:14 -08:00
Roman Levenstein
dc79034a6a [sil-generic-specializer] Set proper debug scope in the GenericCloner
Fixes a bug uncovered by enabling the inlining of generics, rdar://problem/30479945

The patch is written by @adrian-prantl
2017-02-15 15:21:21 -08:00
Vedant Kumar
bc063f3ef4 Merge pull request #7505 from vedantk/coverage-fixups
Coverage fixups
2017-02-15 14:53:06 -08:00
Arnold Schwaighofer
876cea81ae SIL: Add an allowed access kind to the opened value of an open_existential_addr instruction
Once we move to a copy-on-write implementation of existential value buffers we
can no longer consume or destroy values of an opened existential unless the
buffer is uniquely owned.

Therefore we need to track the allowed operation on opened values.

Add qualifiers "mutable_access" and "immutable_access" to open_existential_addr
instructions to indicate the allowed access to the opened value.

Once we move to a copy-on-write implementation, an "open_existential_addr
mutable_access" instruction will ensure unique ownership of the value buffer.
2017-02-15 14:23:12 -08:00
Arnold Schwaighofer
ec802fe9cd SILGen: Thread AccessKind to openExistential()
We will eventually create different open_existential_addr instructions depending on the kind of access to the opened value
2017-02-15 14:22:18 -08:00
Arnold Schwaighofer
91a410b992 Mark a code path that I believe is dead (see comment). 2017-02-15 14:22:18 -08:00
Vedant Kumar
757125ab10 [Coverage] Pass each prof name var to the lowering pass just once
While invoking the instrprof_increment intrinsic, we used to pass the
profile name variable by using a GEP instruction to get to the string
constant. That prevented llvm from uniquing the names. Use a constexpr
GEP to fix the issue.
2017-02-15 13:57:47 -08:00
Slava Pestov
41eba98902 Gardening: Fix some unused variable warnings in no-assert builds 2017-02-15 12:57:35 -08:00
Argyrios Kyrtzidis
c309fb2620 Merge pull request #7477 from akyrtzi/fsystem-search-path-option2
Add '-Fsystem' framework search option to indicate path for frameworks that should be treated as 'system'
2017-02-15 12:04:36 -08:00
swift-ci
843327a300 Merge pull request #7496 from eeckstein/new-manging-in-reflection 2017-02-15 11:55:20 -08:00
Jordan Rose
385da9dc19 [ClangImporter] Don't crash when an enum case alias has no name. (#7483)
Or rather, when the name importer decides that the name it /would/
have should start with a number, and gives up. We should probably
fix that separately, but meanwhile don't crash.

> Roses are red
> Prefix-stripping can create an invalid remainder
> assert(!member->NextDecl &&
> "Already added to a container")

rdar://problem/30401506
2017-02-15 10:46:57 -08:00
Slava Pestov
c717f48e4c Merge pull request #7485 from slavapestov/class-accessor-performance-regression
Fix recent class accessor performance regression
2017-02-15 10:34:44 -08:00
Erik Eckstein
2d127e4192 Reinstate ”Use the new mangling for reflection."
It also uses the new mangling for type names in meta-data (except for top-level non-generic classes).
lldb has now support for new mangled metadata type names.

This reinstates commit 21ba292943.
2017-02-15 09:47:22 -08:00
Erik Eckstein
86e7bdeed8 Demangler: Use a fixed-size array for Word substitutions.
There can be at most 26 word substitutions.
This avoids some memory allocations and is a work-around for the asan problem rdar://problem/30406870
2017-02-15 09:47:22 -08:00
practicalswift
b680cd0a88 [gardening] Fix a-vs-an typo 2017-02-15 15:59:34 +01:00
practicalswift
67041a0016 [gardening] Fix inconsistent headers 2017-02-15 15:57:12 +01:00
practicalswift
648ef2949a [gardening] Fix incorrect Swift URLs 2017-02-15 15:47:30 +01:00
practicalswift
1c23be116b Merge pull request #7458 from practicalswift/cpp-gardening-20170214
Avoid potential dereference of a null pointer. Remove redundant call to get() on smart pointer.
2017-02-15 15:30:12 +01:00
Hugh Bellamy
3b84245730 Change ClangImporter if check to an assertion 2017-02-15 17:19:44 +07:00
practicalswift
45c3111d19 Avoid potential dereference of a null pointer 2017-02-15 09:27:20 +01:00
Argyrios Kyrtzidis
32e5112874 For the -Fsystem option, address feedback by Jordan. 2017-02-14 23:35:06 -08:00
Slava Pestov
32316559f8 AST: Stored property accessors on non-Objective-C derived classes can be transparent
In 74d979f0ac, the policy was changed
so that only value type accessors are ever marked transparent, and
not class accessors.

This was intended to fix a bug where inlining an accessor of an
Objective-C-derived class across module boundaries caused a linker
failure because the accessor referenced a field offset variable,
which has hidden visibility.

However, this also caused a performance regression for Swift native
classes. Bring back the old behavior for Swift native classes in
non-resilient modules.

Fixes <rdar://problem/29884727>.
2017-02-14 22:35:27 -08:00
Slava Pestov
c2d07bc210 AST: Cache the result of ClassDecl::checkObjCAncestry() 2017-02-14 22:35:27 -08:00
Mark Lacey
713e5a2135 Merge pull request #7481 from rudkx/fix-rdar30376186
Cache expression types in failure diagnosis.
2017-02-14 21:31:54 -08:00
Mark Lacey
f1f9e88360 Cache expression types in failure diagnosis.
After we call into typeCheckExpression() we need to cache the
resulting types in the constraint system type map because we later
call into code that reads the types out of the type map.

Fixes rdar://problem/30376186 as well as a couple crashers.
2017-02-14 19:22:41 -08:00
Slava Pestov
13d6b183c0 Merge pull request #7370 from llvm-beanz/simplify-add_swift_library
[CMake] Simplify add_swift_library
2017-02-14 19:16:59 -08:00
Hugh Bellamy
45979e8acd Merge pull request #7422 from hughbe/putenv-simplify
Simplify Windows implementation of Compilation::performSimpleCommand
2017-02-15 10:10:58 +07:00
Xi Ge
143c5a5d82 Address @jrose-apple's code review comments (#7474) 2017-02-14 18:41:21 -08:00
Hugh Bellamy
fdf261327a Return an error result if we can't set the environment variables in performSingleCommand 2017-02-15 09:30:24 +07:00
Argyrios Kyrtzidis
ca906d1e99 Add '-Fsystem' framework search option to indicate path for frameworks that should be treated as 'system'
This has the effect of propagating the search path to the clang importer as '-iframework'.
It doesn't affect whether a swift module is treated as system or not, this can be done as follow-up enhancement.
2017-02-14 16:13:25 -08:00
Slava Pestov
fd40597d90 Sema: Extend prohibition of @_inlineable designated initializers to classes
This check only applied to struct and enum initializers previously,
but that was an oversight.
2017-02-14 15:48:26 -08:00
Slava Pestov
50b5d01dd7 Sema: Tighten up rules for @_inlineable
- Don't allow @_inlineable on stored properties; this generates
  invalid SIL since clients can't know about stored properties of
  resilient types. Accessors for stored properties of non-resilient
  types are already @_inlineable anyway.

- Don't allow @_inlineable on declarations that are not public or
  @_versioned, since it's simply redundant.
2017-02-14 15:48:26 -08:00
Arnold Schwaighofer
ff4b055935 Merge pull request #7237 from aschwaighofer/switch_to_swift_calling_conv
Switch to swift calling conv
2017-02-14 15:20:23 -08:00
Doug Gregor
2869ddcce6 Merge pull request #7473 from DougGregor/early-protocol-self
[Serialization] Wire up the generic parameter of a protocol early.
2017-02-14 14:53:02 -08:00
Joe Shajrawi
2b8dfaf064 Merge pull request #7470 from shajrawi/var_args_SpecialDest_opaque_mode
Support for address based array initialization under opaque values mode
2017-02-14 14:39:05 -08:00