Commit Graph

7 Commits

Author SHA1 Message Date
Slava Pestov
d313fa7d42 SILGen: @convention(block) bridging thunks need to copy blocks in optionals
The @objc method argument bridging did the right thing but for
func to block thunks we didn't handle optionals and IUOs.

Symptoms included memory leaks because IRGen would later try to
retain the block by calling Block_copy() and discarding the result,
or memory corruption because the on-stack block could outlive
its stack frame.

Fixes <rdar://problem/22471309>.

Swift SVN r31882
2015-09-11 03:08:03 +00:00
Slava Pestov
7cf72989b7 Re-apply "Fix linkage of 'static inline' Clang-imported definitions"
This re-applies commit r31763 with a change to the predicate we
use for determining the linkage of a definition. It turns out we
could have definitions with a Clang body that were still public,
so instead of checking for a Clang body just check if the Clang
declaration is externally visible or not.

Swift SVN r31777
2015-09-08 22:12:06 +00:00
Dave Abrahams
8269d8130b Revert "Fix linkage of 'static inline' Clang-imported definitions"
This reverts commit r31763, as it was breaking the bots:

Swift SVN r31765
2015-09-08 16:31:35 +00:00
Slava Pestov
fc0a18be3f Fix linkage of 'static inline' Clang-imported definitions
If an external SIL function has a Clang-generated body, I think this
means we have a static function, and we want to use Shared linkage,
not Public.

Add a new flag to SILFunction for this and plumb it through to
appease assertions from SILVerifier.

Swift SVN r31763
2015-09-08 06:26:35 +00:00
Doug Gregor
6bbbda2798 Make the structure of SILGen's "fake" bridging SDK look more like the real thing.
Specifically, introduce an ObjectiveC model written in Objective-C, and put the relevant, de-duplicated bits (such as NSObject) there. Use -I %S/Inputs -enable-source-import wherever we need to use this bridging SDK.

Swift SVN r17836
2014-05-10 19:50:58 +00:00
Joe Groff
fe20665b4b SIL: Handle unprototyped function types in CFunctionTypeConventions.
Fixes <rdar://problem/16355896>.

Swift SVN r15352
2014-03-21 23:47:08 +00:00
Stephen Lin
bb92973204 Reorganize test/SIL to match lib/SIL reorganization
Swift SVN r7247
2013-08-15 00:08:20 +00:00