Files
clang-p2996/llvm/lib/IR/DebugLoc.cpp
Felipe de Azevedo Piovezan 62b27f893e [CodeExtractor] Correctly propagate scope information post extraction
When a new function "NewF" is created with instructions extracted from
another function "OldF", the CodeExtractor only preserves debug
line/column of the extracted instructions. However:

1. Any inlinedAt nodes are dropped.
2. The scope chain is replaced with a single node, the Subprogram of NewF.

Both of these are incorrect: most of the debug metadata from the
original instructions should be preserved. We only need to update the
Subprogram found at the scope of the last node of the inline chain; this
Subprogram used to be OldF but now should be NewF.

Differential Revision: https://reviews.llvm.org/D139217
2022-12-06 14:26:06 -05:00

6.1 KiB