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
This test checks that Sanitizer reports contain properly symbolicated
stacks. Let's make sure that all of the expected frames appear in the
stack by disabling inlining and preventing tail call optimization.
rdar://68171463
Co-authored-by: Julian Lettner <julian.lettner@apple.com>
Add a test that checks symbolication for out-of-process and in-process
symbolication for both Apple platforms and Linux.
Note that there already exist tests in the compiler-rt test suite that
check report symbolication. The purpose of this test is to have simple
smoke tests for Swift, and specifically Swift demangling.
rdar://62753845
Co-authored-by: Julian Lettner <julian.lettner@apple.com>