Commit Graph

21 Commits

Author SHA1 Message Date
Michael Gottesman
a0088327d4 [concurrency] Represent a SILFunction without isolation as std::optional<ActorIsolation> instead of ActorIsolation::Unspecified.
The reason why is that we want to distinguish inbetween SILFunction's that are
marked as unspecified by SILGen and those that are parsed from textual SIL that
do not have any specified isolation. This will make it easier to write nice
FileCheck tests against SILGen output on what is the inferred isolation for
various items.

NFCI.
2024-09-18 11:23:22 -07:00
Adrian Prantl
37e403db78 Compile libraries in testcases with -parse-as-library (NFC)
This is in preparation to a change in serialization of global variables where
this detail will matter.
2020-01-28 17:37:52 -08:00
Michael Gottesman
3ebd8df493 [gardening] Remove unnecessary -enable-sil-ownership from tests that now just get it from their pattern.
This just eliminates -enable-sil-ownership from all target-swift-frontend and
target-swift-emit-silgen RUN lines. Both of those now include
enable-sil-ownership in their expansion.
2019-03-12 20:39:18 -07:00
Michael Gottesman
40a09c9c21 Fixup tests for -assume-parsing-unqualified-ownership-sil => [ossa] transition. 2018-12-18 00:49:32 -08:00
Michael Gottesman
9e13779702 [ownership] Remove most -enable-sil-ownership from SILGen now that %target-swift-emit-silgen does it automatically.
I did this using a sed pattern and verified by hand that I was only touching
target-swift-emit-silgen lines.
2018-12-13 11:54:54 -08:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Alex Hoppen
560c22b18e [tests] Verify the libSyntax tree on SILGen tests
The SILGen testsuite consists of valid Swift code covering most language
features. We use these tests to verify that no unknown nodes are in the
file's libSyntax tree. That way we will (hopefully) catch any future
changes or additions to the language which are not implemented in
libSyntax.
2018-04-27 09:33:03 -07:00
Erik Eckstein
cd3d50a5d9 ABI: Change the mangling prefix from _T0 to $S 2018-01-06 13:55:59 -08:00
Alex Hoppen
1c7e289b96 [Mangling] Adjust subscript mangling to not include "subscript"
Change the mangling of accessors to have a variable or subscript node
as their only child node, while subscript nodes no longer contain a decl
name.
2017-09-10 19:44:07 +02:00
Michael Gottesman
4ea0a402e1 [silgen] Update 31 more tests to run with the ownership verifier enabled.
Now ~32% of the SILGen tests run with the ownership verifier enabled.

rdar://33358110
2017-08-21 16:40:22 -07:00
Dmitri Gribenko
984210aa53 tests: replace '// RUN: rm -rf' '// RUN: mkdir' pairs with '%empty-directory(...)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Erik Eckstein
c4a11f4c92 tests: remove the now unused option -new-mangling-for-tests 2017-03-22 11:28:43 -07:00
Erik Eckstein
1d3724666f tests: convert about 400 tests to the new mangling by using the -new-mangling-for-tests option
When the new mangling is enabled permanently, the option can be removed from the RUN command lines again.
2017-01-24 15:27:45 -08:00
Dmitri Gribenko
55864d10cb Tests: use 'mkdir -p' 2016-09-02 21:36:45 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Erik Eckstein
c0cdbc4510 SILPrinter: only print simplified demangled names in comments.
For long names this is easier to read and in most cases the omitted information can be seen in the actual SIL code.
With the option -Xllvm -sil-full-demangle the old behavior can be restored.
2016-02-09 08:51:47 -08:00
Dmitri Hrybenko
3b04d1b013 tests: reorganize tests so that they actually use the target platform
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
2015-01-19 06:52:49 +00:00
John McCall
dc4431ebff Split addressors into unsafe, owning, and pinning variants.
Change all the existing addressors to the unsafe variant.

Update the addressor mangling to include the variant.

The addressor and mutable-addressor may be any of the
variants, independent of the choice for the other.

SILGen and code synthesis for the new variants is still
untested.

Swift SVN r24387
2015-01-13 03:09:16 +00:00
John McCall
671613644d Demangling support for mutableAddressor.
Note that the demangling for 'a' accessors changes from
'addressor' to 'mutableAddressor'.  This is correct for
the existing use-case of global variables, which permit
modification through the result.

Swift SVN r22254
2014-09-24 04:19:30 +00:00
Erik Eckstein
c16c510167 Set SILLinkage according to visibility.
Now the SILLinkage for functions and global variables is according to the swift visibility (private, internal or public).

In addition, the fact whether a function or global variable is considered as fragile, is kept in a separate flag at SIL level.
Previously the linkage was used for this (e.g. no inlining of less visible functions to more visible functions). But it had no effect,
because everything was public anyway.

For now this isFragile-flag is set for public transparent functions and for everything if a module is compiled with -sil-serialize-all,
i.e. for the stdlib.

For details see <rdar://problem/18201785> Set SILLinkage correctly and better handling of fragile functions.

The benefits of this change are:
*) Enable to eliminate unused private and internal functions
*) It should be possible now to use private in the stdlib
*) The symbol linkage is as one would expect (previously almost all symbols were public).

More details:

Specializations from fragile functions (e.g. from the stdlib) now get linkonce_odr,default
linkage instead of linkonce_odr,hidden, i.e. they have public visibility.
The reason is: if such a function is called from another fragile function (in the same module),
then it has to be visible from a third module, in case the fragile caller is inlined but not
the specialized function.

I had to update lots of test files, because many CHECK-LABEL lines include the linkage, which has changed.

The -sil-serialize-all option is now handled at SILGen and not at the Serializer.
This means that test files in sil format which are compiled with -sil-serialize-all
must have the [fragile] attribute set for all functions and globals.

The -disable-access-control option doesn't help anymore if the accessed module is not compiled
with -sil-serialize-all, because the linker will complain about unresolved symbols.

A final note: I tried to consider all the implications of this change, but it's not a low-risk change.
If you have any comments, please let me know.



Swift SVN r22215
2014-09-23 12:33:18 +00:00
Andrew Trick
f58ebbc251 Add a global_init attribute to SILFunction.
The implied semantics are:
- side-effects can occur any time before the first invocation.
- all calls to the same global_init function have the same side-effects.
- any operation that may observe the initializer's side-effects must be
  preceded by a call to the initializer.

This is currently true if the function is an addressor that was lazily
generated from a global variable access. Note that the initialization
function itself does not need this attribute. It is private and only
called within the addressor.

Swift SVN r16683
2014-04-23 01:09:47 +00:00