[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
Loading
Please sign in to comment