Anthony Latsis
075768b7a0
Gardening: Migrate test suite to GH issues: SILOptimizer (2/2)
2022-09-22 03:21:35 +03:00
Xi Ge
ed635e5e7a
[test] disable SILOptimizer/unused_containers.swift to unblock CI. rdar://45797168
2018-11-04 19:20:31 -08:00
Brent Royal-Gordon
9bd1a26089
Implementation for SE-0228: Fix ExpressibleByStringInterpolation ( #20214 )
...
* [CodeCompletion] Restrict ancestor search to brace
This change allows ExprParentFinder to restrict certain searches for parents to just AST nodes within the nearest surrounding BraceStmt. In the string interpolation rework, BraceStmts can appear in new places in the AST; this keeps code completion from looking at irrelevant context.
NFC in this commit, but keeps code completion from crashing once TapExpr is introduced.
* Remove test relying on ExpressibleByStringInterpolation being deprecated
Since soon enough, it won’t be anymore.
* [AST] Introduce TapExpr
TapExpr allows a block of code to to be inserted between two expressions, accessing and potentially mutating the result of its subexpression before giving it to its parent expression. It’s roughly equivalent to this function:
func _tap<T>(_ value: T, do body: (inout T) throws -> Void) rethrows -> T {
var copy = value
try body(©)
return copy
}
Except that it doesn’t use a closure, so no variables are captured and no call frame is (even notionally) added.
This commit does not include tests because nothing in it actually uses TapExpr yet. It will be used by string interpolation.
* SE-0228: Fix ExpressibleByStringInterpolation
This is the bulk of the implementation of the string interpolation rework. It includes a redesigned AST node, new parsing logic, new constraints and post-typechecking code generation, and new standard library types and members.
* [Sema] Rip out typeCheckExpressionShallow()
With new string interpolation in place, it is no longer used by anything in the compiler.
* [Sema] Diagnose invalid StringInterpolationProtocols
StringInterpolationProtocol informally requires conforming types to provide at least one method with the base name “appendInterpolation” with no (or a discardable) return value and visibility at least as broad as the conforming type’s. This change diagnoses an error when a conforming type does not have a method that meets those criteria.
* [Stdlib] Fix map(String.init) source break
Some users, including some in the source compatibility suite, accidentally used init(stringInterpolationSegment:) by writing code like `map(String.init)`. Now that these intializers have been removed, the remaining initializers often end up tying during overload resolution. This change adds several overloads of `String.init(describing:)` which will break these ties in cases where the compiler previously selected `String.init(stringInterpolationSegment:)`.
* [Sema] Make callWitness() take non-mutable arrays
It doesn’t actually need to mutate them.
* [Stdlib] Improve floating-point interpolation performance
This change avoids constructing a String when interpolating a Float, Double, or Float80. Instead, we write the characters to a fixed-size buffer and then append them directly to the string’s storage.
This seems to improve performance for all three types, but especially for Double and Float80, which cannot always fit into a small string when stringified.
* [NameLookup] Improve MemberLookupTable invalidation
In rare cases usually involving generated code, an overload added by an extension in the middle of a file would not be visible below it if the type had lazy members and the same base name had already been referenced above the extension. This change essentially dirties a type’s member lookup table whenever an extension is added to it, ensuring the entries in it will be updated.
This change also includes some debugging improvements for NameLookup.
* [SILOptimizer] XFAIL dead object removal failure
The DeadObjectRemoval pass in SILOptimizer does not currently remove reworked string interpolations as well as the old design because their effects cannot be described by @_effects(readonly). That causes a test failure on Linux. This change temporarily silences that test. The SILOptimizer issue has been filed as SR-9008.
* Confess string interpolation’s source stability sins
* [Parser] Parse empty interpolations
Previously, the parser had an odd asymmetry which caused the same function to accept foo(), but reject “\()”. This change fixes the issue.
Already tested by test/Parse/try.swift, which uses this construct in one of its throwing interpolation tests.
* [Sema] Fix batch-mode-only lazy var bug
The temporary variable used by string interpolation needs to be recontextualized when it’s inserted into a synthesized getter. Fixes a compilation failure in Alamofire.
I’ll probably follow up on this bug a bit more after merging.
2018-11-02 19:16:03 -07: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
Erik Eckstein
e559b99766
tests: fixed 2 tests for 32-bit
...
actually, disabled one test for 32-bit
2018-05-30 11:20:09 -07:00
Erik Eckstein
ab22f5e33b
tests: also re-enable SILOptimizer/unused_containers.swift on linux
2018-03-29 15:21:01 -07:00
Erik Eckstein
bdb16f9436
tests: re-enable SILOptimizer/unused_containers.swift
2018-03-29 14:10:55 -07:00
Arnold Schwaighofer
d33dc3cd76
Disable test/SILOptimizer/unused_containers.swift
...
It is succeeding unexpectely on bots. Disable until somebody gets a chance to look at this
rdar://39002151
2018-03-29 10:07:13 -07:00
Michael Ilseman
bf21a07106
[test] Temporarily disable UXPASSing Linux test
2018-03-27 14:01:00 -07:00
Joe Shajrawi
a399d9bf60
XFAIL test wherein optimizations are not kicking in when compiling with a +0 runtime.
...
Turning these back on is tracked by:
rdar://38152291
2018-03-08 19:26:35 -08:00
Joe Shajrawi
c8f8782a80
Un-XFAIL unused_containers with resilience
2018-01-11 16:39:13 -08:00
Erik Eckstein
cd3d50a5d9
ABI: Change the mangling prefix from _T0 to $S
2018-01-06 13:55:59 -08:00
Erik Eckstein
c4a11f4c92
tests: remove the now unused option -new-mangling-for-tests
2017-03-22 11:28:43 -07:00
Roman Levenstein
2c811b82a1
Adjust some tests to pass in non-resilient and resilient modes.
2017-03-16 19:46:11 -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
practicalswift
ef8e43b519
[gardening] Increase consistency with regards to spacing after colons
2016-09-22 16:28:57 +02:00
Dmitri Gribenko
d175b3b66d
Migrate FileCheck to %FileCheck in tests
2016-08-10 23:52:02 -07:00
Erik Eckstein
7094653409
stdlib: use _onFastPath instead of @inline(__always) in ManagedBuffer.
...
This recovers most of the performance regression introduced with the recent inliner changes.
2016-03-31 12:53:44 -07:00
Adrian Prantl
310b0433a9
Reapply "Serialize debug scope and location info in the SIL assembler language.""
...
This ireapplies commit 255c52de9f .
Original commit message:
Serialize debug scope and location info in the SIL assembler language.
At the moment it is only possible to test the effects that SIL
optimization passes have on debug information by observing the
effects of a full .swift -> LLVM IR compilation. This change enable us
to write targeted testcases for single SIL optimization passes.
The new syntax is as follows:
sil-scope-ref ::= 'scope' [0-9]+
sil-scope ::= 'sil_scope' [0-9]+ '{'
sil-loc
'parent' scope-parent
('inlined_at' sil-scope-ref )?
'}'
scope-parent ::= sil-function-name ':' sil-type
scope-parent ::= sil-scope-ref
sil-loc ::= 'loc' string-literal ':' [0-9]+ ':' [0-9]+
Each instruction may have a debug location and a SIL scope reference
at the end. Debug locations consist of a filename, a line number, and
a column number. If the debug location is omitted, it defaults to the
location in the SIL source file. SIL scopes describe the position
inside the lexical scope structure that the Swift expression a SIL
instruction was generated from had originally. SIL scopes also hold
inlining information.
<rdar://problem/22706994>
2016-02-26 13:28:57 -08:00
Andrew Trick
bd35b4789c
Move test/SILOptimizer files to reflect lib/SILOptimizer.
2015-12-11 15:53:22 -08:00