Commit d9de0d0
committed
[FIX] Register __ffi_repr__ for repr-sensitive types
New tvm-ffi uses ffi.ReprPrint (dataclass repr) for CObject.__repr__
instead of TVM's ReprPrinter. Register __ffi_repr__ for types that
need custom repr:
- Target: returns JSON via TargetNode::str()
- AccessPath/AccessStep: returns concise "<root>.field[idx]" format
- Trace: returns Python script format via AsPython()
- GlobalVar: returns I.GlobalVar("name")
- Var/SizeVar: returns the variable name
Also fix structural_equal.cc to use << (which now goes through the
fixed ReprPrinter dispatch) and update tests for new PassInfo format
and __slots__ enforcement.1 parent 93e58d7 commit d9de0d0
4 files changed
Lines changed: 59 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
228 | 232 | | |
229 | 233 | | |
230 | 234 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | 124 | | |
135 | 125 | | |
136 | 126 | | |
| 127 | + | |
| 128 | + | |
137 | 129 | | |
138 | 130 | | |
139 | 131 | | |
| 132 | + | |
140 | 133 | | |
141 | 134 | | |
142 | 135 | | |
| |||
145 | 138 | | |
146 | 139 | | |
147 | 140 | | |
148 | | - | |
| 141 | + | |
149 | 142 | | |
150 | 143 | | |
151 | 144 | | |
| |||
154 | 147 | | |
155 | 148 | | |
156 | 149 | | |
157 | | - | |
| 150 | + | |
158 | 151 | | |
159 | 152 | | |
160 | 153 | | |
| |||
178 | 171 | | |
179 | 172 | | |
180 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
181 | 186 | | |
182 | 187 | | |
183 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
522 | 524 | | |
523 | 525 | | |
524 | 526 | | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
525 | 549 | | |
526 | 550 | | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
| 551 | + | |
544 | 552 | | |
545 | 553 | | |
546 | 554 | | |
| |||
594 | 602 | | |
595 | 603 | | |
596 | 604 | | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
597 | 609 | | |
598 | 610 | | |
599 | 611 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
87 | 96 | | |
88 | 97 | | |
89 | 98 | | |
| |||
0 commit comments