Commit Graph

7 Commits

Author SHA1 Message Date
Thomas Roughton
c5bf2ec553 [runtime] Remove TwoWordPair and use the Swift calling convention instead. (#13299) 2017-12-07 19:27:24 -08:00
Jordan Rose
fd3b585de0 [stdlib] Surface NSKeyedArchiver issues in Xcode.
By calling through to swift_reportToDebugger, Xcode can pick up the
NSKeyedArchiver/Unarchiver issues with Swift classes and display them
in the Issues Navigator. This increases the probability that they'll
be seen and acted upon.

This is not a fully-general interface yet, please do not start hooking
random things up to it. Especially if you're working on something that
doesn't ship with Xcode itself. :-)

rdar://problem/32900735
2017-07-13 11:19:03 -07:00
Jordan Rose
f868d6dffe Fix up 08c2a7a3ac for 32-bit platforms. (#10433)
...where swift::TwoWordPair is defined a little less freely.
2017-06-20 19:24:36 -07:00
Jordan Rose
08c2a7a3ac Finish off the log part of _swift_checkClassAndWarnForKeyedArchiving. (#10418)
Logs a warning the first time a problematic class is archived or
unarchived. We expect people to actually fix these issues, so the
performance of the warning isn't too important.

Sample output:

  [timestamp] Attempting to archive Swift class '_Test.Outer.ArchivedThenUnarchived', which does not have a stable runtime name.
  [timestamp] Use the 'objc' attribute to ensure that the runtime name will not change: "@objc(_TtCC5_Test5Outer22ArchivedThenUnarchived)"
  [timestamp] If there are no existing archives containing this class, you can choose a unique, prefixed name instead: "@objc(ABCArchivedThenUnarchived)"

Finishes rdar://problem/32414508
2017-06-20 17:15:28 -07:00
Erik Eckstein
ce188682e5 runtime: remove an unnecessary helper function to get the class name 2017-06-13 15:20:07 -07:00
Erik Eckstein
1bff67f573 runtime: use class_getName instead of NSStringFromClass in _swift_checkClassAndWarnForKeyedArchiving 2017-06-13 09:25:42 -07:00
Erik Eckstein
488c43c825 runtime: add a runtime function _swift_checkClassAndWarnForKeyedArchiving
This function checks if a mangled class name is going to be written into an NSArchive.
If yes, a warning should be printed and the return value should indicate that.

TODO: print the actual warning

rdar://problem/32414508
2017-06-07 17:02:00 -07:00