Commit Graph

4070 Commits

Author SHA1 Message Date
swift_jenkins
a812971ee5 Merge remote-tracking branch 'origin/master' into master-next 2019-12-17 15:00:16 -08:00
Xi Ge
624c2fc4a7 test: move demangle metadata for moved symbols to a separate file 2019-12-17 12:22:22 -08:00
Xi Ge
d0b4da6fc6 test: mark linker directives tests as macosx only 2019-12-13 21:56:27 -08:00
Xi Ge
f098448421 test: add a linker directive test for ios 2019-12-12 22:22:28 -08:00
Xi Ge
c31b9666a3 [test] IRGen: add a test for generating linker directive symbols $ld$hide 2019-12-12 22:22:28 -08:00
Joe Groff
fb34044408 Merge remote-tracking branch 'origin/master' into master-next 2019-12-10 12:46:41 -08:00
najacque
3ee6e7b04e updated test/IRGen/objc.swift for version bump 2019-12-06 14:44:44 -08:00
swift-ci
0dc8e06d39 Merge pull request #27275 from linux-on-ibm-z/s390x-disable-4-tests 2019-12-03 21:21:55 -08:00
Daniel Rodríguez Troitiño
f539575c50 [android] Fix original-defined-attr test for Android 32 bits.
In 32 bits, the first parameter is the pointer size, so it is different
for 32 and 64 bits. Add an additional check prefix with the pointer size
and match for both pointer sizes. Works in both 32 and 64 bits targets.
2019-12-03 13:53:45 -08:00
Xi Ge
1390576528 Merge pull request #28528 from nkcsgexi/use-alternate-module-name
ASTMangler: use specified module names from @_originalDefinedIn to mangle symbols names
2019-12-03 07:25:22 -08:00
Slava Pestov
1383a6383d Merge pull request #28527 from slavapestov/owned-block-params
Fixes for __attribute__((ns_consumed)) block parameters
2019-12-02 21:06:50 -05:00
Xi Ge
7e8ed50233 ASTMangler: use specified module names from @_originalDefinedIn to mangle symbols names
When an original module name is specified via @_originalDefinedIn attribute, we need to
use the original module name for all related runtime symbol names instead of the current
module names.

rdar://55268186
2019-12-02 16:58:31 -08:00
Slava Pestov
0e0e4efebe Merge pull request #28401 from slavapestov/fix-cast-to-self
Fix casts involving the 'Self' type
2019-12-02 19:56:51 -05:00
Slava Pestov
6d5ff209d0 IRGen: Implement support for __attribute__((ns_consumed)) block parameters
Fixes <rdar://problem/48792177>.
2019-12-02 18:41:27 -05:00
Daniel Rodríguez Troitiño
c6bc09d749 [android] Fix spelling of intrinsic in AArch64 test.
In between #19478 was written and merged, b45ca04 changed the spelling
of the intrinsics, so the old code wasn't working. This fixes the
spelling.

Broken in
https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64/2875/
2019-12-02 12:41:54 -08:00
Robert Widmann
6a52b5d403 Merge pull request #19478 from drodriguez/android-aarch64-test-fix-1
[android] Duplicate some arm64 checks for aarch64.
2019-12-02 11:07:39 -08:00
Slava Pestov
c8da1583cf IRGen: Correctly use formal type for class downcasts
Fixes <https://bugs.swift.org/browse/SR-11818>, <rdar://problem/57369535>.
2019-11-22 16:39:17 -05:00
Michael Gottesman
8247525471 [irgen] Force emission of objc class refs for non-foreign clang objc classes whose metadata we use.
Today in far more cases we are using mangled strings to look up metadata at
runtime. If we do this for an objc class but for whatever reason we do not have
any other references to the class, the static linker will fail to link in the
relevant framework. The reason why this happens is that autolinking is treated
by the static linker as a hint that a framework may be needed rather than as a
"one must link against the framework". If there aren't any undefined symbols
needed by the app from that framework, the linker just will ignore the hint. Of
course this then causes the class lookup to fail at runtime when we use our
mangled name to try to lookup the class.

I included an Interpreter test as well as IRGen tests to make sure that we do
not regress here in the future.

NOTE: The test modifications here are due to my moving the ObjCClasses framework
out of ./test/Interpreters/Inputs => test/Inputs since I am using it in the
IRGen test along side the interpreter test.

rdar://56136123
2019-11-21 16:03:54 -08:00
Atul Sowani
2e46c40853 Update clang_inline_opt.swift 2019-11-21 09:39:43 -08:00
asowani
ee7cccf585 ppc64le port. 2019-11-21 09:37:23 -08:00
Arnold Schwaighofer
75c0bf076f Merge pull request #28337 from aschwaighofer/get_type_by_mangled_name_abstract_runtime
Add swift_getTypeByMangledNameInContextInMetadataState such that we can
2019-11-21 07:37:25 -08:00
swift_jenkins
8be3f2244f Merge remote-tracking branch 'origin/master' into master-next 2019-11-20 23:40:29 -08:00
Slava Pestov
53bfc767a3 SIL: Track target formal type for casts
SIL type lowering erases DynamicSelfType, so we generate
incorrect code when casting to DynamicSelfType. Fixing this
requires a fair amount of plumbing, but most of the
changes are mechanical.

Note that the textual SIL syntax for casts has changed
slightly; the target type is now a formal type without a '$',
not a SIL type.

Also, the unconditional_checked_cast_value and
checked_cast_value_br instructions now take the _source_
formal type as well, just like the *_addr forms they are
intended to replace.
2019-11-20 21:30:28 -05:00
Arnold Schwaighofer
84bb456bba Fix test for more targets 2019-11-20 07:00:11 -08:00
Arnold Schwaighofer
44b99b789c On linux we always use the current runtime 2019-11-19 08:31:06 -08:00
Arnold Schwaighofer
0d324d223f Add swift_getTypeByMangledNameInContextInMetadataState such that we can
use getTypeByMangledName when abstract metadata state is requested

This can significantly reduce the code size of apps constructing deeply
nested types with conditional conformances.

Requires a new runtime.

rdar://57157619
2019-11-18 14:41:35 -08:00
swift_jenkins
f919e12436 Merge remote-tracking branch 'origin/master' into master-next 2019-11-17 15:40:26 -08:00
Michael Gottesman
269762eee3 [ownership] Enable ownership lowering /after/ the diagnostic passes.
I also updated the last group of straggling tests.
2019-11-17 11:34:43 -08:00
swift_jenkins
b9f998ffa4 Merge remote-tracking branch 'origin/master' into master-next 2019-11-15 15:56:48 -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
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
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
Robert Widmann
b8dc4f0a3f Use TypeCheckerOptions to simplify FunctionBodyTimer 2019-11-12 09:56:02 -08:00
Arnold Schwaighofer
4f300bbfee Update tests 2019-11-11 14:21:52 -08:00
swift-ci
73912924cc Merge remote-tracking branch 'origin/master' into master-next 2019-11-11 13:30:12 -08:00
Arnold Schwaighofer
7acabfe1cf IRGen: We need to emit metadata for types that are emitted with shared linkage
Otherwise one TU could only require the type descriptor without metadata
and another TU could require metadata and type descriptor. Whether the
metadata access function is available would then depend on the linking
order of the two TUs.

rdar://56929811
2019-11-11 10:00:17 -08:00
swift-ci
04451a3ab5 Merge remote-tracking branch 'origin/master' into master-next 2019-10-29 09:49:51 -07:00
Daniel Rodríguez Troitiño
8e41df8fa8 Merge pull request #27823 from drodriguez/windows-fix-text-ir-output
[windows] Adapt test to pass on Windows.
2019-10-29 09:49:22 -07:00
Xi Ge
64c0680686 Merge remote-tracking branch 'apple/master' into master-next 2019-10-28 10:19:36 -07:00
Michael Gottesman
7ee5ad7318 [sil] Rename {,Strong}Copy{Unowned,Unmanaged}. 2019-10-26 17:03:47 -07:00
Slava Pestov
9edf6265df Merge pull request #27873 from slavapestov/subclass-scope-final-method-fix
SIL: Final methods need a subclass scope if they override something
2019-10-25 23:31:05 -04:00
Michael Gottesman
451252d42f [sil] Add a run of ownership model eliminator in the lowering pass pipeline to ensure we eliminate ownership even if a bisecting counter has disabled the normal ome run.
I also had to fix up one test and eliminated a test that did not really make
sense in the first place to test with ossa. (Specifically,
copy_value_destroy_value is a test I added when adding copy_value,
destroy_value, it really doesn't make sense since we will just lower it to
retain, release before we hit IRGen).
2019-10-24 18:26:15 -07:00
Slava Pestov
f33a5c099d SIL: Final methods need a subclass scope if they override something
... otherwise we compute the wrong visibility in IRGen.

Fixes <rdar://problem/55559104>.
2019-10-24 20:14:28 -04:00
Daniel Rodríguez Troitiño
b801c15c8f [windows] Adapt test to pass on Windows.
The underscores weren't printed while compiling for Windows between the
symbolic and the mangled name tokens. Make the underscores optional, to
allow the test pass on Windows.
2019-10-21 16:27:07 -07:00
Arnold Schwaighofer
57f2f5140e Merge pull request #27697 from aschwaighofer/runtime_compat_version_dynamic_replacement_lib
Respect runtime-compatibility-version flag also for dynamic replacement compatibility library
2019-10-17 13:05:15 -07:00
Arnold Schwaighofer
da0099e83f Merge pull request #27666 from aschwaighofer/fix_replace_opaque_types_with_underlying
ReplaceOpaqueTypesWithUnderlyingTypes: We can't look through opaque archetypes if the underlying type contains a type not accessible from the current context
2019-10-17 12:40:06 -07:00
swift-ci
491d3c336a Merge pull request #27730 from aschwaighofer/fix_abi_v7k_test 2019-10-16 14:02:48 -07:00
Joe Groff
e3f934a9a4 Merge pull request #27724 from jckarter/hint-condfail
IRGen: Hint condfail branches.
2019-10-16 13:10:53 -07:00