Commit Graph

16106 Commits

Author SHA1 Message Date
practicalswift
65f1901480 Merge pull request #7501 from practicalswift/python3-fixes
Improve Python 3 compatibility
2017-02-16 09:21:09 +01: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
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
swift-ci
70db9a5c47 Merge pull request #7511 from eeckstein/disable-asan-reflection-tests 2017-02-15 16:44:52 -08:00
Vedant Kumar
c724ddbbca Merge pull request #7507 from vedantk/coverage-fixups
[Coverage] Tighten up test case (NFC)
2017-02-15 16:33:55 -08:00
Erik Eckstein
14ca57299e Disable some reflection tests on the asan bots.
They fail because we are building the swift-reflection-dump utility and the reflection library with two different compilers.
2017-02-15 16:16:06 -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
Vedant Kumar
75af7cbad0 [Coverage] Tighten up test case (NFC) 2017-02-15 14:59:47 -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
Vedant Kumar
9c205c1728 [Coverage] Prepare for an upcoming llvm fix (NFC)
Temporarily loosen this test so I can cherry-pick an llvm fix that
throws away dead profile name variables. I will tighten it up again when
the llvm change lands.
2017-02-15 14:16:04 -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
Arnold Schwaighofer
84ae387253 Make sure we don't bail in the LLVM thread/address sanitizer pass 2017-02-15 13:22:30 -08:00
practicalswift
0cdc22157c Use the py2+py3 compatible replacement for execfile(...) 2017-02-15 21:42:56 +01: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
Vedant Kumar
36f909114c Re-enable coverage smoke test (NFC)
There isn't a reason for it to be disabled.

It was disabled by this merge commit. I'll follow-up to see how we can
avoid this in the future.

commit 78b28243ff

    Merge remote-tracking branch 'origin/master' into master-next
2017-02-15 11:04:28 -08:00
Philippe Hausler
525ffcc605 Merge pull request #7155 from phausler/Data_as_own_SubSequence
[Foundation] Convert Data’s SubSequence type to be Data
2017-02-15 11:02:27 -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
Kuba (Brecka) Mracek
2b5e3b534a Merge pull request #7478 from kubamracek/fix-flaky-swift-tsan-test
Fix flaky test/Sanitizers/tsan.swift test
2017-02-15 08:53:17 -08:00
practicalswift
67041a0016 [gardening] Fix inconsistent headers 2017-02-15 15:57:12 +01:00
practicalswift
87332ab0b4 [gardening] Fix recently introduced \t:s 2017-02-15 15:48:49 +01:00
practicalswift
648ef2949a [gardening] Fix incorrect Swift URLs 2017-02-15 15:47:30 +01: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
Xi Ge
143c5a5d82 Address @jrose-apple's code review comments (#7474) 2017-02-14 18:41:21 -08:00
Kuba Mracek
4722c35b93 Fix flaky test/Sanitizers/tsan.swift test. 2017-02-14 16:43:52 -08: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
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
Xi Ge
055da1fbfb [SourceKit] Teach name translation request to translate Swift names to ObjC ones (by using PrintAsObjC). (#7449) 2017-02-14 14:25:52 -08:00
Joe Shajrawi
03d55cd023 Support for address based array initialization under opaque values mode 2017-02-14 13:47:04 -08:00
Arnold Schwaighofer
39fa2f0228 Use the swift calling convention for swift functions
Use the generic type lowering algorithm described in
"docs/CallingConvention.rst#physical-lowering" to map from IRGen's explosion
type to the type expected by the ABI.

Change IRGen to use the swift calling convention (swiftcc) for native swift
functions.

Use the 'swiftself' attribute on self parameters and for closures contexts.

Use the 'swifterror' parameter for swift error parameters.

Change functions in the runtime that are called as native swift functions to use
the swift calling convention.

rdar://19978563
2017-02-14 12:17:57 -08:00
practicalswift
8af31961b2 Merge pull request #7464 from practicalswift/gardening-20170214b
[gardening] Fix recently introduced typos
2017-02-14 21:10:52 +01:00
swift-ci
89caa91bcd Merge pull request #7467 from akyrtzi/index-extension-usr 2017-02-14 12:03:17 -08:00
swift-ci
a68170c728 Merge pull request #7465 from gottesmm/teach_ownership_verifier_how_to_handle_cond_br 2017-02-14 11:58:04 -08:00
Argyrios Kyrtzidis
560bb99c02 [index] Provide distinct USRs for extension symbols
For indexing purposes we need to be able to treat extensions as distinct symbols.
rdar://30512293
2017-02-14 11:15:45 -08:00
swift-ci
619d2d19f3 Merge pull request #7462 from akyrtzi/index-invalid-crash 2017-02-14 11:09:30 -08:00
practicalswift
65b0219f7b [gardening] Fix typos 2017-02-14 20:04:08 +01:00
Michael Gottesman
9a136cfc1e [ownership-verifier] Teach the ownership verifier how to handle control dependent ownership from cond_br.
Rememebering that the verifier ensures that any edge that propagates ownership
along a cond_br can not be critical, we do this by sinking the use by the
cond_br into the destination blocks.

rdar://29791263
2017-02-14 11:03:29 -08:00
Argyrios Kyrtzidis
bf80cff4d0 [index] Fix assertion hit during USR generation, when encountering an erroneous computed var. 2017-02-14 10:19:04 -08:00