[PATCH] D85191: [AST] Get field size in chars rather than bits in RecordLayoutBuilder.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 6 16:01:10 PDT 2020


rsmith added a comment.

In D85191#2199574 <https://reviews.llvm.org/D85191#2199574>, @ebevhan wrote:

> In D85191#2197663 <https://reviews.llvm.org/D85191#2197663>, @efriedma wrote:
>
>>> If the intent is for getTypeInfo to always return sizes that are multiples of the char size, then the design should be inverted and getTypeInfo should simply be calling getTypeInfoInChars and multiply that result by the char size. But that isn't how it works.
>>
>> The reason it doesn't work this way is just that someone made the wrong choice a decade ago, and nobody has spent the time to rewrite it since.  Patch welcome.
>
> This does sound like a good thing to do, but it would be problematic downstream since it would completely prohibit the design that we're trying to use.

That would be a good thing, as the design you're trying to use is not one that we intend to support. The size returned by `getTypeInfo` is intended to include padding.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85191/new/

https://reviews.llvm.org/D85191



More information about the cfe-commits mailing list