Skip to content

[CIR][CodeGen] Discrete bitfield layout #1798

@tommymcm

Description

@tommymcm

Minimized test case:

struct {
  signed : 0
} __attribute((__ms_struct__)) A;

Failed assertions:
https://github.com/llvm/clangir/blob/aeac352c9de907fcbb7adde22bbe4a7cfa3105be/clang/lib/CIR/CodeGen/CIRRecordLayoutBuilder.cpp#L517C5-L517C21

Notes:
The Microsoft bitfield layout rule allocates discrete storage units of the field's formal type and only combines adjacent fields of the same formal type. We want to emit a layout with these discrete storage units instead of combining them into a continuous run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions