Commit Graph

18 Commits

Author SHA1 Message Date
Doug Gregor
def86ce402 Revert "[irgen] Force emission of objc class refs for non-foreign clang objc classes whose metadata we use."
This reverts commit 8247525471. While
correct, it has uncovered several issues in existing code bases that
need to be sorted out before we can land it again.
Fixes rdar://problem/57846390.
2020-01-11 21:46:42 -08: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
Arnold Schwaighofer
6eca97add6 Codesign test/Interpreter 2018-08-10 06:58:40 -07:00
Robert Widmann
f76da6f705 Migrate interpreter tests 2018-06-27 13:05:36 -07:00
Slava Pestov
5d2752f7d2 Run tests with -swift-version 4 by default
Some test now fail, so add an explicit -swift-version 3.
2018-06-19 23:24:19 -07:00
Dmitri Gribenko
486cab447d tests: replace 'rm -rf %t && mkdir -p %t' with '%empty-directory(%t)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Slava Pestov
c1c54d1462 Sema: Fix materializeForSet for members of extensions of imported classes
An assertion I added recently to check property overrides in
the ASTVerifier uncovered some bugs in this area:

- We did not synthesize a materializeForSet for properties
  defined in extensions of imported classes unless they
  witnessed a protocol requirement.

  This triggered an assertion if the property had an
  override that was checked before the protocol conformance,
  since the override's materializeForSet would not be marked
  as an override of the base materializeForSet.

- materializeForSet for properties defined in extensions would
  statically dispatch the getter and setter instead of dynamically
  dispatching. This is incorrect since we statically dispatch
  to the materializeForSet in this case, and we can in fact
  override it in a subclass.

Fixes <rdar://problem/31334272>.
2017-04-02 23:43:41 -07:00
Dmitri Gribenko
c9041beea3 Migrate callsites from 'expectNotEmpty()' to 'expectNotNil()' 2016-09-10 20:05:43 -07:00
Dmitri Gribenko
243a35cd65 Migrate callsites from 'expectEmpty()' to 'expectNil()' 2016-09-10 20:05:42 -07:00
Robert Widmann
4f465224ea Polish off uses of dynamicType in tests 2016-07-29 16:59:14 -07:00
Joe Groff
cfdb957d60 Update Interpreter tests for id-as-Any. 2016-07-25 06:40:35 -07:00
Jordan Rose
f0c3bc25ff [IRGen] Don't emit ObjC class property metadata on old targets. (#2350)
The ObjC runtime on OS X 10.10 and older and iOS 9 and older can't
handle them, so for these targets, emit nil for all class property
lists.

It's a little unfortunate that this is target-dependent, but there's
not much we can do about it.

rdar://problem/25605427
2016-05-02 13:10:02 -07:00
Dmitri Gribenko
c52787e900 Merge commit '9cdbec13eee72feccfc5f8b987882a8c52e8107b' into swift-3-indexing-model 2016-04-14 16:23:53 -07:00
Harlan Haskins
5d888873da [StdlibUnittest] Teach interpreter to run crash tests 2016-04-08 13:12:53 -07:00
Jordan Rose
90ddb2f2d9 [test] Disable two tests on OS X hosts before 10.11.
We're still investigating (rdar://problem/25605427).
2016-04-07 10:51:28 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Jordan Rose
4dd3c10a42 [IRGen] Correctly emit metadata for ObjC class properties.
...which is important because Clang CodeGen was already claiming we were!

rdar://problem/25473573
2016-04-04 19:26:48 -07:00
Jordan Rose
50e3b33739 [ClangImporter] Implement importing of ObjC class properties.
For the most part this was just "check isInstanceProperty"; the one feature not yet implemented
is the emission of ObjC metadata for class properties.

rdar://problem/16830785
2016-03-31 14:27:56 -07:00