Commit ad488d7
committed
[DwarfDebug] Restore broken test llvm/test/DebugInfo/X86/pr12831.ll
This test was added in 4d358b5 to fix the issue with emission of
empty DW_TAG_subprogram tags (https://bugs.llvm.org/show_bug.cgi?id=12831).
However, the test output is not checked properly, and it contains:
```
0x00000206: DW_TAG_subprogram
0x00000207: DW_TAG_reference_type
DW_AT_type (0x00000169 "class ")
```
The reason is that the DIE for the definition DISubprogram "writeExpr"
is created during the call to `getOrCreateSubprogramDIE(declaration of writeExpr)`.
Therefore, when `getOrCreateSubprogramDIE(definition of writeExpr)` is
first called, we get a recursive chain of calls:
```
getOrCreateSubprogramDIE(definition of writeExpr)
...
getOrCreateSubprogramDIE(declaration of writeExpr)
...
getOrCreateSubprogramDIE(definition of writeExpr)
```
The outer call doesn't expect that the DIE for the definition of
writeExpr will be created during the creation of declaration DIE.
In this PR, a check is added to fix that.
I'm not sure whether the problem described in
https://bugs.llvm.org/show_bug.cgi?id=12831 is still relevant (I wasn't
able to reproduce the problem with C++ reproducer from there).
But if this test stays in repo, it should be fixed.1 parent 0a7eabc commit ad488d7
File tree
2 files changed
+40
-1
lines changed- llvm
- lib/CodeGen/AsmPrinter
- test/DebugInfo/X86
2 files changed
+40
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1351 | 1351 | | |
1352 | 1352 | | |
1353 | 1353 | | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
1354 | 1358 | | |
1355 | 1359 | | |
1356 | 1360 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
2 | 37 | | |
3 | 38 | | |
4 | 39 | | |
| |||
0 commit comments