Commit Graph

21 Commits

Author SHA1 Message Date
Arnold Schwaighofer
3b5ebaa46c Fix some tests in IRGen folder 2023-06-21 10:10:32 -07:00
Arnold Schwaighofer
c1a93e0bde Move tests over to use the %use_no_opaque_pointers option 2023-06-14 10:49:48 -07:00
Mishal Shah
e256b56545 Merge branch 'main' into rebranch 2023-03-02 18:25:09 -08:00
Arnold Schwaighofer
c1d08fb719 IRGen: Rename the colocation section for type descriptor data to __constg_swiftt
To indicate this is constant data rather then code as the `textg` would
imply.
2023-03-02 10:54:42 -08:00
Arnold Schwaighofer
1dfc30eb1f Merge remote-tracking branch 'origin/main' into rebranch 2023-02-27 09:18:56 -08:00
Arnold Schwaighofer
8a7b8dc39c IRGen: Put type descriptors in their own section to collocated them
rdar://104697150
2023-02-25 07:51:30 -08:00
Arnold Schwaighofer
d45fd3c4ac IRGen: Adjust to new AddressSanitizer's way of marking globals to be ignored
rdar://102152139
2022-11-11 09:55:16 -08:00
Kuba Mracek
4271edde6b Add an end-to-end test for ThinLTO (-lto=llvm-thin flag), fix compiler crashes, fix tests 2021-12-13 16:59:32 -08:00
Slava Pestov
2390b959e1 IRGen: Emit class stubs in more instances so that objc_copyClassList() can find them
We would like it if objc_copyClassList() would find non-generic
classes with generic ancestry, as long as they ultimately inherit
from an @objc class. Make this so by emitting class stubs in a
few more cases.

Fixes <rdar://problem/71194117>.
2020-11-16 15:10:12 -05:00
Slava Pestov
bfee5fb800 IRGen: Emit list of Objective-C resilient class stubs in __objc_stublist section
Part of <rdar://problem/55000892>.
2020-11-02 17:01:42 -05:00
Joe Groff
445bde5127 IRGen: Give ObjC metadata symbols internal linkage.
This preserves the symbol names in (unstripped) binaries, so we can use them for link ordering and
memory usage analysis.
2020-07-29 13:49:25 -07:00
Slava Pestov
8e35609df2 IRGen: Sign the class stub initialization callback pointer on arm64e
The Objective-C runtime expects a signed pointer here. The existing test
would have caught this, except it was always disabled because the
symbol name passed to the dlsym() check should not have had the leading
'_'.

Fixes <rdar://problem/57679510>.
2020-05-01 21:55:11 -04:00
swift-ci
b91537d1b4 Merge remote-tracking branch 'origin/master' into master-next 2019-10-02 16:09:39 -07:00
Joe Groff
c39a2aeb0a IRGen: Always use symbolic references in mangled names (on Mach-O platforms)
Now that `swift-reflection-dump` correctly handles pointer values and unresolved
cross-image references (for Mach-O, at least), we can safely unconditionally use
symbolic references in runtime mangled names without regressing offline reflection
support.
2019-10-01 12:36:55 -07:00
Arnold Schwaighofer
9ee12db2a9 Fix tests for LLVM change that added anonymous parameter labeling
Fix for r367755.
2019-08-15 14:57:24 -07:00
mishal_shah
1e38fc3030 Update master to build with Xcode 11 beta, macOS 10.15, iOS 13, tvOS 13, and watchOS 6 SDKs 2019-06-03 22:50:02 -07:00
Slava Pestov
d6868acf8a IRGen: Categories on class stubs should go in a separate list and section 2019-04-19 16:50:29 -04:00
Slava Pestov
2846fa66a9 IRGen: Fix for categories on resilient classes from other modules
If a class has resilient metadata from our point of view, it might
still not have a class stub, if its entire inheritance chain is
defined in a single module.

Note that inserting a superclass is still a resilient operation;
the only way to change a class from having static metadata to having
a class stub is to change it's root class, which is not something
we can do resiliently.
2019-04-19 16:50:29 -04:00
Slava Pestov
aa77f6e2f2 IRGen: Emit reference to class stub from class context descriptor
This was an oversight. I was setting the flag but not emitting the
pointer at the end.
2019-04-19 16:50:29 -04:00
Slava Pestov
91d0a10462 IRGen: Don't add class stubs to objc_classes list 2019-04-19 16:50:29 -04:00
Slava Pestov
68c07620cd IRGen: Emit Objective-C resilient class stubs if experimental flag is on
Non-generic classes with resilient ancestry do not have statically-emitted
metadata, so we can now emit an Objective-C resilient class stub instead.

Also, when emitting an Objective-C category, reference the class stub if
the class has resilient ancestry; previously this case would hit an assert.

Note that class stubs always start with a zero word, with the address point
pointing immediately after. This works around a linker issue, where the
linker tries to coalesce categories and gets confused upon encountering a
class stub.
2019-03-26 18:53:09 -04:00