Commit Graph

14 Commits

Author SHA1 Message Date
Anthony Latsis
08588b91d0 Gardening: Migrate test suite to GH issues: SILGen (2/2) 2022-09-04 09:35:41 +03:00
Brent Royal-Gordon
87d3d3ecb5 [NFC] Add comments with SR numbers for language version mode changes 2020-07-13 14:06:55 -07:00
Brent Royal-Gordon
327ea8bce2 [Staging] Force stdlib into “Swift 6 mode” for #file
We ultimately want to explicitly change standard library uses of #file to #fileID, but once we do, previous compilers won’t be able to build the standard library. So instead, we will temporarily build the standard library with -enable-experimental-concise-pound-file, which should have the same effect, but will back-deploy to compilers going back several months.
2020-07-13 14:06:55 -07:00
Brent Royal-Gordon
cad5f6236a Make swiftinterfaces propagate #file behavior
Add -experimental-enable-concise-pound-file to the list of flags preserved by module interfaces, so that when we rebuild an interface, it comes out the same way as the original file.
2020-07-13 14:06:55 -07:00
Brent Royal-Gordon
9a838bb654 Differentiate between Swift 5 and “Swift 6” #file
In -swift-version 5 and earlier, #file will continue to be a synonym for #filePath; in a future -swift-version (“Swift 6 mode”), it will become a synonym for #fileID. #file in libraries will be interpreted according to the language mode the library was compiled in, not the language mode its client uses.

Implement this behavior, tied to a frontend flag instead of a language version. We do so by splitting the old `MagicIdentifierLiteralExprKind::File` into two separate cases, `FileIDSpelledAsFile` and `FilePathSpelledAsFile`, and propagating this distinction throughout the AST. This seems cleaner than looking up the setting for the module the declaration belongs to every time we see `File`.

This doesn’t handle module interfaces yet; we’ll take care of those in a separate commit.
2020-07-13 14:06:55 -07:00
Brent Royal-Gordon
745dbef3ef Use file IDs in generated code
Such as force unwraps, as! casts, etc.
2020-07-13 14:05:13 -07:00
Brent Royal-Gordon
0e569f5d9e Add support for #fileID
This temporarily breaks -enable-experimental-concise-pound-file.

fixup adding #fileID
2020-07-13 14:05:13 -07:00
Brent Royal-Gordon
54f5967d48 Include #file -> #filePath table in printed SIL
A proof of concept for tools providing this information in more useful forms.
2020-03-05 17:23:44 -08:00
Brent Royal-Gordon
f34fa7ffcd Match prototype’s #file string format to upcoming SE-0274 revision 2020-03-05 16:01:13 -08:00
Brent Royal-Gordon
0f476284d1 Use #file string for force-unwrap and force-try
This ensures that -enable-experimental-concise-pound-file affects more of the file names that might be automatically embedded in a binary.
2020-01-10 13:48:45 -08:00
Saleem Abdulrasool
e3bed008c7 test: loosen the #file, #filePath tests for Windows
Be more lenient about the path separator.  This repairs the tests on
Windows after #25656.
2019-12-08 20:35:08 -08:00
Brent Royal-Gordon
63ec1cf5af Introduce a separate #filePath, remove -pound-file
This makes the path behavior more first-class. The feature is now hidden behind an experimental flag, -enable-experimental-concise-pound-file.
2019-12-04 16:35:13 -08:00
Brent Royal-Gordon
2acaf387c1 Flip default in test 2019-12-04 16:33:25 -08:00
Brent Royal-Gordon
44a2f67f4b Turn new #file behavior off by default 2019-12-04 16:33:25 -08:00