Commit 285d3e9
committed
[CloneFunction][DebugInfo] Ensure DILocalVariables of inlined functions are not cloned (NFC)
This change was separated from #119001.
When cloning functions, use IdentityMDPredicate to ensure that
if DISubprogram is not cloned, then its DILocalVariables are not cloned
either.
This is expected to be an NFC currently, as DILocalVariables only reference
their subprograms (via DILocalScopes) and types.
Since inlined DISubprograms and DITypes are not cloned during the process,
DILocalVariables are mapped to self in ValueMapper (in mapTopLevelUniquedNode).
However, it will be needed for the original PR #119001,
where it is possible that the type of a DILocalVariable is cloned
if it lies in the scope of a DISubprogram that is being cloned,
whereas the DILocalVariable itself belongs to a different DISubprogram.
I'm making this change into a separate PR to make the original PR a bit smaller,
and since this has more to do with variables than with types.1 parent 4418a8e commit 285d3e9
1 file changed
+13
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
68 | | - | |
| 74 | + | |
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
72 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
73 | 84 | | |
74 | 85 | | |
75 | 86 | | |
| |||
0 commit comments