Commit Graph

13 Commits

Author SHA1 Message Date
Bartosz Polaczyk
e388b185f2 [SIL] Always print types in SIL
SIL prints types and declarations defined in a current file
(-primary-file flag) or a module (whole module mode).
2018-02-13 20:30:03 +01: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
Dmitri Hrybenko
60a05bc40f tests: rewrite (almost) all tests that assume that Swift.Int is
implemented with Builtin.Word

The definition Swift.Int is becoming heavily platform-dependent, please
avoid using it in SIL and IR tests unless Swift.Int is being tested and
can't be replaced with a fixed-width type (e.g., Int32).

Swift SVN r24720
2015-01-25 12:48:26 +00:00
Jordan Rose
182d24f869 [test] Whole-module mode with private functions with the same name and type.
There's no reason this test shouldn't already be working fine, and indeed it is.
We do have a bit of a problem with the emitted SIL, though: we get two
AST declarations of "the same" function. That's rdar://problem/17632252.

Swift SVN r22979
2014-10-28 02:46:10 +00:00
Joe Groff
78d904561c Organize existing SIL tests into SIL/SILGen subdir.
Swift SVN r6068
2013-07-08 21:54:56 +00:00
Joe Groff
9d4328380a Mangle: Always mangle decl contexts.
Our mangling grammar says that entities should always be mangled with a context, so in cases where we weren't (Clang module contexts and top-level code), do so. Additionally, for ObjC protocols, mangle them into the special "So" context so we can catch global ObjC runtime namespace collisions with them. Fixes <rdar://problem/14221244>.

Swift SVN r5851
2013-06-27 23:07:06 +00:00
Joe Groff
59e803ed84 ClangImporter,SIL: Bridge ObjCBool to Bool.
Map BOOL parameters, return types, and properties to swift.Bool in the Clang importer like we map NSString to swift.String. Generalize SIL's handling of type bridging to accommodate Bool bridging in addition to String bridging. Add convertObjCBoolToBool and v.v. entry points for the compiler to use to insert bridging conversions between the two types. Implements <rdar://problem/14271667>.

Swift SVN r5819
2013-06-26 21:15:17 +00:00
Joe Groff
07b9ca7c3e Remove workaround in SIL test module for <rdar://problem/13992215>.
The ClangImporter now correctly imports nullary C functions.

Swift SVN r5517
2013-06-07 20:15:18 +00:00
Joe Groff
11c7a3a92d ClangImporter: Bridge NSString objc properties to String properties.
We had an inconsistency where the synthesized Swift getter/setters were bridged but the VarDecl wasn't, causing assertion failures in SILGen.

Swift SVN r5366
2013-05-28 22:53:14 +00:00
Joe Groff
8693c5efaa SIL: Emit String-to-NSString conversions.
If -nsstring-is-string is enabled, lower Strings in cc(c) and cc(objc) function types to NSString, and when calling them, insert calls to StringToNSString/NSStringToString to perform the bridging conversion.

This isn't quite ready for prime-time yet, because we still need to emit the inverse bridging for ObjC method thunks, and I haven't tested the IRGen end of things yet.

Swift SVN r5355
2013-05-26 20:29:09 +00:00
Joe Groff
19b9ad913e SILGen: Use 'isObjC' bit on SILConstant.
When we intend an ObjC dispatch, indicate so in the SILConstant. This lets us distinguish Swift from ObjC dispatch for Swift classes with ObjC superclasses.

Swift SVN r5207
2013-05-17 18:12:29 +00:00
Joe Groff
e5068920bb SILGen: Handle ObjC ownership conventions of calls
Port IRGen's calculation of consumed arguments and return value semantics to SILGen, and use it to handle the ownership semantics of calls. Refactor the handling of properties and other clients of emitApply so they can properly hand ownership semantics down to it.

This should let all the moribund cleanup management code in IRGen die. Unfortunately Scope appears to be tied into scoped calculated metadata caching so it's not quite ready to die.

Swift SVN r4834
2013-04-20 23:13:42 +00:00
Joe Groff
bc7afbae3a SILGen: Visit ClangImporter external definitions.
Emit SIL for definitions synthesized by the Clang importer.

Swift SVN r4552
2013-03-30 17:41:33 +00:00