Commit Graph

6 Commits

Author SHA1 Message Date
Adrian Prantl
158772c2ab Rebase SILScope generation on top of ASTScope.
This patch replaces the stateful generation of SILScope information in
SILGenFunction with data derived from the ASTScope hierarchy, which should be
100% in sync with the scopes needed for local variables. The goal is to
eliminate the surprising effects that the stack of cleanup operations can have
on the current state of SILBuilder leading to a fully deterministic (in the
sense of: predictible by a human) association of SILDebugScopes with
SILInstructions. The patch also eliminates the need to many workarounds. There
are still some accomodations for several Sema transformation passes such as
ResultBuilders, which don't correctly update the source locations when moving
around nodes. If these were implemented as macros, this problem would disappear.

This necessary rewrite of the macro scope handling included in this patch also
adds proper support nested macro expansions.

This fixes

rdar://88274783

and either fixes or at least partially addresses the following:

rdar://89252827
rdar://105186946
rdar://105757810
rdar://105997826
rdar://105102288
2023-04-04 15:20:11 -07:00
Davide Italiano
67f90696d8 [SILGen] Create a new debug scope for top-level code.
<rdar://problem/46686369>
2019-01-10 15:38:24 -08:00
Adrian Prantl
21a73cbcf7 Relax tests to use CHECK-DAG.
The order in which the metadata nodes are output differs when compiling against a debug stdlib.
<rdar://problem/29867213>
2017-01-04 16:59:02 -08:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Adrian Prantl
59226f383d Debug Info: Fix a backend crash by removing obsolete linetable heuristics.
Recent versions of LLDB can deal with line 0 locations much better and
due to a subtle bug in the heuristic instructions immediately following
the prologue could end up without debug locations which can cause serious
problems for the LLVM inliner when constructing inline debug scope info.

<rdar://problem/24394944>
2016-02-01 13:05:52 -08:00
Adrian Prantl
d1ec8a225b Debug Info: Ensure that patterns bound in a foreach stmt end up in their
own debug scope.

rdar://problem/22677613

Swift SVN r31996
2015-09-16 17:30:14 +00:00