diff options
author | Michael Buch <michaelbuch12@gmail.com> | 2024-09-13 11:01:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-13 11:01:25 +0100 |
commit | 4ca8fb18129e6465c3594a8681f1cca0e2aff724 (patch) | |
tree | e8d20cba5397b8ab55ed41c8f3cec603b573d889 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 637aa61732c5bda7cbcf94e5f08fb3a44655cef0 (diff) | |
download | llvm-4ca8fb18129e6465c3594a8681f1cca0e2aff724.zip llvm-4ca8fb18129e6465c3594a8681f1cca0e2aff724.tar.gz llvm-4ca8fb18129e6465c3594a8681f1cca0e2aff724.tar.bz2 |
[lldb][test] TestDataFormatterLibcxxStringSimulator.py: fix padding for current layout (#108362)
IIUC, the history of `std::string`'s `__short` structure in the
alternate ABI layout (as recorded by the simulator test) looks as
follows:
* First layout ( `SUBCLASS_PADDING` is defined):
```
struct __short
{
value_type __data_[__min_cap];
struct
: __padding<value_type>
{
unsigned char __size_;
};
};
```
* Then:
```
struct __short
{
value_type __data_[__min_cap];
unsigned char __padding[sizeof(value_type) - 1];
unsigned char __size_;
};
```
* Then, post-`BITMASKS`:
```
struct __short
{
value_type __data_[__min_cap];
unsigned char __padding[sizeof(value_type) - 1];
unsigned char __size_ : 7;
unsigned char __is_long_ : 1;
};
```
Which is the one that's [on
top-of-tree](https://github.com/llvm/llvm-project/blob/89c10e27d8b4d5f44998aad9abd2590d9f96c5df/libcxx/include/string#L854-L859).
But for `REVISION > 1`, `BITMASKS` is never set, so for those tests we
lose the `__padding` member.
This patch fixes this by splitting out the `SUBCLASS_PADDING` out of the
ifdef.
Drive-by:
* Also run expression evaluator on the string to provide is with some
extra coverage.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions