Commit Graph

12 Commits

Author SHA1 Message Date
Hamish Knight
4e414b1cf7 [Sema] Avoid forming double braced single expression closures
For a single expression closure, just use the
expression as the body in the case where we're
coercing to Void, as the return is already
implied. This avoids crashing in
`ClosureExpr::getSingleExpressionBody` with a
double braced body.

Surprisingly it seems nothing is currently calling
`ClosureExpr::getSingleExpressionBody` after
type-checking, so no test case, but later commits
in this patch will exercise this case.
2023-02-01 15:30:16 +00:00
Saleem Abdulrasool
12db528a02 test: remove stray comment markers (NFC)
This removes the stray comment on the RUN commands that cause issues
with Python 3 and lit which will treat the last argument as a glob
pattern rather than a valid run command.
2020-06-25 10:39:58 -07:00
David Zarzycki
5dcc32f98f Remove all uses of -force-single-frontend-invocation
The `-force-single-frontend-invocation` flag predates WMO and is now an
alias for `-whole-module-optimization`. We should use the latter and let
the former fade into history.
2020-05-08 06:37:41 -04:00
Suyash Srijan
724f8c23db [Typechecker] Implement SE-0268 Refine didSet Semantics (#26632) 2020-04-09 01:23:15 +01:00
Chris Brough
87e8627f2d [5.1] Upgrade PCMacro/PlaygroundTransform to support module/file IDs
This change PCMacro and PlaygroundTransform to return an a moduleID and
fileID in addition to the source location information. The Frontend has
been changed to run PCMacro and PlaygroundTransform on all input files
instead of the main file only.

The tests have been updated to conform to these changes with an addition
of module and file ID specific tests. The Playgrounds related tests were
adjusted to make a module out of the stub interface files since those
files should not have PCMacro and PlaygroundTransform applied to them.

rdar://problem/50821146
2019-05-28 14:20:59 -07:00
Arnold Schwaighofer
1691abc073 Codesign test/PCMacro 2018-08-10 08:20:57 -07:00
Connor Wakamo
451778591e [PlaygroundTransform] Replace "$builtin" with "__builtin".
Currently, the playground transform requires the use of dollar-identifiers as the functions are prefixed with "$builtin".
This commit removes that requirement by replacing "$builtin" with "__builtin".
This aligns with the PC macro.

This addresses <rdar://problem/36031860>.
2018-07-06 13:03:02 -07:00
Saleem Abdulrasool
b67d5f0cf7 test: convert rm -rf && mkdir -p into %empty-directory
This converts the instances of the pattern for which we have a proper
substitution in lit.  This will make it easier to replace it
appropriately with Windows equivalents.
2018-03-06 14:30:54 -08:00
Connor Wakamo
2f9ab4493e [test] Introduced a test of the PC macro and nested functions. 2018-01-09 11:21:52 -08:00
Connor Wakamo
2c04058710 [PCMacro] Implemented support for defer statements in the PC macro.
As with the playground transform, defer statements were not supported in the PC macro.
This commit addresses that oversight.

This partially addresses <rdar://problem/29007242>.
2018-01-09 11:21:52 -08:00
Erik Eckstein
334ee62eb2 tests: disable the PCMacro tests on linux.
They fail in optimized mode on linux and it seems also sometimes in non-optimized mode.
rdar://problem/30234450
2017-01-27 16:50:24 -08:00
Maxwell Swadling
214efbfc3c Added a new AST Walker that instruments the AST to provide callbacks that simulate a program counter
Based off the PlaygroundTransform, this new ASTWalker leaves calls to __builtin_pc_before and __builtin_pc_after before and after a user would expect a program counter to enter a range of source code.
2016-12-19 10:56:40 -08:00