Commit dec8f13
authored
[llvm][DebugInfo][clang] Finalize all declaration subprograms in DIBuilder::finalize() (llvm#139914)
DIBuilder began tracking definition subprograms and finalizing them in
`DIBuilder::finalize()` in eb1bb4e.
Currently, `finalizeSubprogram()` attaches local variables, imported
entities, and labels to the `retainedNodes:` field of a corresponding
subprogram.
After 75819ae, the definition and some declaration subprograms are
finalized in `DIBuilder::finalize()`:
`AllSubprograms` holds references to definition subprograms.
`AllRetainTypes` holds references to declaration subprograms.
For DISubprogram elements of both variables, `finalizeSubprogram()` was
called there.
However, `retainTypes()` is not necessarily called for every declaration
subprogram (as in 40a3fcb).
DIBuilder clients may also want to attach DILocalVariables to
declaration subprograms, for example, in 58bdf8f.
Thus, the `finalizeSubprogram()` function is called for all definition
subprograms in `DIBuilder::finalize()` because they are stored in the
`AllSubprograms` by the `CreateFunction(isDefinition: true)` call. But
for the declaration subprograms, it should be called manually.
With this commit, `AllSubprograms` is used for holding and finalizing all DISubprograms.1 parent b26baf1 commit dec8f13
2 files changed
+3
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4767 | 4767 | | |
4768 | 4768 | | |
4769 | 4769 | | |
4770 | | - | |
| 4770 | + | |
4771 | 4771 | | |
4772 | 4772 | | |
4773 | 4773 | | |
| |||
4784 | 4784 | | |
4785 | 4785 | | |
4786 | 4786 | | |
4787 | | - | |
4788 | | - | |
4789 | 4787 | | |
4790 | 4788 | | |
4791 | 4789 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
943 | 943 | | |
944 | 944 | | |
945 | 945 | | |
946 | | - | |
947 | | - | |
| 946 | + | |
948 | 947 | | |
949 | 948 | | |
950 | 949 | | |
| |||
981 | 980 | | |
982 | 981 | | |
983 | 982 | | |
984 | | - | |
985 | | - | |
| 983 | + | |
986 | 984 | | |
987 | 985 | | |
988 | 986 | | |
| |||
0 commit comments