Commit Graph

14 Commits

Author SHA1 Message Date
Tim Kientzle
1d961ba22d Add #include "swift/Basic/Assertions.h" to a lot of source files
Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
2024-06-05 19:37:30 -07:00
Dave Lee
00c33f8f74 [Demangling] Disable ShowAsyncResumePartial in SimplifiedUI (#41870)
Change `SimplifiedUIDemangleOptions` to remove "partial function" prefixes when demangling async coroutine symbols.

This removes the prefixes "await resume partial function" and "suspend resume partial function" from demangled names, in doing so hides the effect of async/coroutine function splitting from stack traces and other symbolication. This output will produce the source level function name.

For example, a symbol that previously would have demangled to:

```
(1) await resume partial function for static Main.main()
```

will, with this change, demangle to:

```
static Main.main()
```

See https://github.com/apple/swift/pull/36978 where `ShowAsyncResumePartial` was introduced for lldb.

rdar://90455541
2022-03-22 14:23:12 -07:00
Andrew Trick
ddf0965d3f Rewrite ClosureScopeAnalysis for generality.
Handle recursive non-escaping local functions.

Previously, it was thought that recursion would force a closure to be
escaping. This is not necessarilly true.

Update AccessEnforcementSelection to conservatively handle closure cycles.

Fixes rdar://88726092 (Compiler hangs when building)
2022-03-18 02:28:53 -07:00
Jonas Devlieghere
b4d268e9e1 Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances in the swift repo.
2019-08-15 11:32:39 -07:00
Arnold Schwaighofer
eb609d0420 Address review comment 2019-05-20 14:10:59 -07:00
Arnold Schwaighofer
6c0baaee85 Fix closurescope analysis
rdar://50949761
2019-05-20 13:20:23 -07:00
Michael Gottesman
234fcc1771 [pass-manager] notifyDeleteFunction => notifyWillDeleteFunction.
This name makes it clear that the function has not yet been deleted and also
contrasts with the past tense used in the API notifyAddedOrModifiedFunction to
show that said function has already added/modified the function.
2018-07-16 14:11:06 -07:00
Michael Gottesman
56d100f493 [analysis] Standardize AnalysisKind by moving it out of SILAnalysis into its own "struct enum" in a non-nested scope.
Generally in the SIL/SILOptimizer libraries we have been putting kinds in the
swift namespace, not a nested scope in a type in swift (see ValueKind as an
example of this).
2018-07-15 11:00:33 -07:00
Huon Wilson
978a5c89b1 [SILOptimizer] std::function -> llvm::function_ref for some non-escaping params. 2018-05-01 08:29:07 +10:00
Andrew Trick
0dfce6c0f6 Don't rerun mandatory lowering passes on deserialized SIL. 2018-02-09 09:55:47 -08:00
Andrew Trick
c1f8d094a0 Add an assert for cycles in the closure graph. 2017-06-17 18:56:48 -07:00
Andrew Trick
0ce81c90f0 Doxygen formatting. 2017-06-17 16:19:16 -07:00
Andrew Trick
94db617471 Add TopDownClosureFunctionOrder based on ClosureScopeAnalysis.
Simple utility for transfersing functions such that parent scopes are always
visited before noescape closures.

Note that recursion is disallowed. Noescape closures are not reentrant.
2017-06-16 19:08:40 -07:00
Andrew Trick
3bec7d81ac Add ClosureScopeAnalysis.
Record noescape closure scopes. This allows passes to process closures and their
parent scopes in a controlled order. AccessEnforcementSelection needs this
because it needs to process parent scopes before selecting enforcement within
noescape closures.

Eventually this could be used by the PassManager so that
AccessEnforcementSelection can go back to being a function transform.
2017-06-16 19:08:39 -07:00