Modify IRGen to emit “anonymous” string constants with names of the form `@.str.<len>.<contents>` (with a special mangling for internal `\0` characters). This makes it much easier to write IRGen tests that check for the contents of strings, because matching the constant name also implies that the constant has the expected content.
In some places, Foundation is comparing ObjC method pointers.
Therefore LLVM's function merging pass must not create aliases for identica; functions, but instead create thunks.
This can be ensured by not creating ObjC methods with the unnamed_addr attribute.
rdar://problem/58483698
Avoid a temporary file and executing FileCheck multiple types and prefer
multiple check prefixes and streaming. Additionally, enable some of
previously XFAIL'ed tests on Linux as well as tests that were marked as
requiring Objective-C interop.
This is NFC in intent, but I had to restructure the code to emit more
of the lists "inline", which means I inevitably altered some IRGen
emission patterns in ways that are visible to tests:
- GenClass emits property/ivar/whatever descriptors in a somewhat
different order.
- An ext method type list is now emitted as just an array, not a struct
containing only that array.
- Protocol descriptors are no longer emitted as packed structs.
I was sorely tempted to stop using packed structs for all the metadata
emission, but didn't really want to update that many tests in one go.
Use the generic type lowering algorithm described in
"docs/CallingConvention.rst#physical-lowering" to map from IRGen's explosion
type to the type expected by the ABI.
Change IRGen to use the swift calling convention (swiftcc) for native swift
functions.
Use the 'swiftself' attribute on self parameters and for closures contexts.
Use the 'swifterror' parameter for swift error parameters.
Change functions in the runtime that are called as native swift functions to use
the swift calling convention.
rdar://19978563
This reverts commit 062d14b422.
Revert "Fix a swift argument initialization bug - swift argument should be initialized"
This reverts commit 273b149583.
This breaks DebugAssert as well as REPL builds. Revert to appease the bots while i
look further.
after argc and argv are initialized. rdar://24250684
I reordered the CHECK statements in some tests to make them pass.
I tested this on Darwin and Linux.
And include some supplementary mangling changes:
- Give the first generic param (depth=0, index=0) a single character mangling. Even after removing the self type from method declaration types, 'Self' still shows up very frequently in protocol requirement signatures.
- Fix the mangling of generic parameter counts to elide the count when there's only one parameter at the starting depth of the mangling.
Together these carve another 154KB out of a debug standard library. There's some awkwardness in demangled strings that I'll clean up in subsequent commits; since decl types now only mangle the number of generic params at their own depth, it's context-dependent what depths those represent, which we get wrong now. Currying markers are also wrong, but since free function currying is going away, we can mangle the partial application thunks in different ways.
Swift SVN r32896
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK. The driver was defaulting to the
host OS. Thus, we could not run the tests when the standard library was
not built for OS X.
Swift SVN r24504
This is needed for tests which define internal functions which should not be eliminated.
So far this was not needed because of a hack which prevented whole-module-optimizations for tests.
Swift SVN r22658