Commit e6d9bd6
authored
[lldb] Fix Language Plugin decl printing (#6795)
`SwiftLanguage::GetDeclPrintingHelper` is a helper function used for Swift types. This
code contains some very similar logic to the default logic in `ValueObjectPrinter`.
Specifically:
`SwiftLanguage`:
```c++
else if (!options.m_hide_name)
stream.Printf(" =");
```
`ValueObjectPrinter`:
```c++
else if (ShouldShowName())
m_stream->Printf(" =");
```
The function `ValueObjectPrinter::ShouldShowName` is not accessible by `SwiftLanguage`.
To allow `SwiftLanguage` to make the right decision, and fit within the existing API
boundary, this change uses a custom print options, which sets calls `SetHideName`
according to the value of `ShouldShowName()`. This allows the Swift language decl
printing helper to correctly know whether to print the name, or not.1 parent 73f3d7e commit e6d9bd6
File tree
3 files changed
+26
-2
lines changed- lldb
- source/DataFormatters
- test/API/commands/dwim-print/swift
3 files changed
+26
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
303 | 308 | | |
304 | 309 | | |
305 | | - | |
| 310 | + | |
306 | 311 | | |
307 | 312 | | |
308 | 313 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
12 | 20 | | |
13 | 21 | | |
14 | 22 | | |
0 commit comments