Commit 79cf744
committed
Revert "Reland [clang][ASTImport] Add support for import of empty records" (llvm#100903)
This reverts commit 88e5206. The
original change went in a while ago (last year) in
https://reviews.llvm.org/D145057. The specific reason I'm proposing a
revert is that this is now causing exactly the issue that @balazske
predicted in https://reviews.llvm.org/D145057#4164717:
> Problematic case is if the attribute has pointer to a Decl or Type
that is imported here in a state when the field is already created but
not initialized. Another problem is that attributes are added a second
time in Import(Decl *)
This now came up in the testing of LLDB support for
llvm#93069. There,
`__compressed_pair`s are now replaced with fields that have an
`alignof(...)` and `[[no_unique_address]]` attribute. In the specific
failing case, we're importing following `std::list` method:
```
size_type& __sz() _NOEXCEPT { return __size_; }
```
During this process, we create a new `__size_` `FieldDecl` (but don't
initialize it yet). Then we go down the `ImportAttrs` codepath added in
D145057. This imports the `alignof` expression which then references the
uninitialized `__size_` and we trigger an assertion.
Important to note, this codepath was added specifically to support
`[[no_unique_address]]` in LLDB, and was supposed to land with
https://reviews.llvm.org/D143347. But the LLDB side of that never
landed, and the way we plan to support `[[no_unique_address]]` doesn't
require things like the `markEmpty` method added here. So really, this
is a dead codepath, which as pointed out in the original review isn't
fully sound.
(cherry picked from commit 31769e4)1 parent 9be6e4b commit 79cf744
File tree
4 files changed
+9
-49
lines changed- clang
- include/clang/AST
- lib/AST
- unittests/AST
4 files changed
+9
-49
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
262 | 261 | | |
263 | 262 | | |
264 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1188 | 1188 | | |
1189 | 1189 | | |
1190 | 1190 | | |
1191 | | - | |
1192 | | - | |
1193 | | - | |
1194 | | - | |
1195 | 1191 | | |
1196 | 1192 | | |
1197 | 1193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4201 | 4201 | | |
4202 | 4202 | | |
4203 | 4203 | | |
4204 | | - | |
4205 | | - | |
4206 | | - | |
4207 | | - | |
4208 | | - | |
4209 | | - | |
4210 | 4204 | | |
4211 | 4205 | | |
4212 | 4206 | | |
| |||
9423 | 9417 | | |
9424 | 9418 | | |
9425 | 9419 | | |
9426 | | - | |
9427 | | - | |
9428 | | - | |
9429 | | - | |
9430 | | - | |
9431 | | - | |
9432 | | - | |
9433 | | - | |
9434 | | - | |
9435 | | - | |
9436 | | - | |
9437 | | - | |
9438 | | - | |
9439 | 9420 | | |
9440 | 9421 | | |
9441 | 9422 | | |
| |||
9569 | 9550 | | |
9570 | 9551 | | |
9571 | 9552 | | |
9572 | | - | |
9573 | | - | |
| 9553 | + | |
| 9554 | + | |
| 9555 | + | |
| 9556 | + | |
| 9557 | + | |
| 9558 | + | |
| 9559 | + | |
| 9560 | + | |
| 9561 | + | |
9574 | 9562 | | |
9575 | 9563 | | |
9576 | 9564 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9376 | 9376 | | |
9377 | 9377 | | |
9378 | 9378 | | |
9379 | | - | |
9380 | | - | |
9381 | | - | |
9382 | | - | |
9383 | | - | |
9384 | | - | |
9385 | | - | |
9386 | | - | |
9387 | | - | |
9388 | | - | |
9389 | | - | |
9390 | | - | |
9391 | | - | |
9392 | | - | |
9393 | | - | |
9394 | | - | |
9395 | | - | |
9396 | | - | |
9397 | | - | |
9398 | | - | |
9399 | | - | |
9400 | | - | |
9401 | | - | |
9402 | 9379 | | |
9403 | 9380 | | |
9404 | 9381 | | |
| |||
0 commit comments