Skip to content

[CIR] Handling of ABI relevant type information #159731

@nikic

Description

@nikic

cc @mmha Thanks for your talk yesterday!

I'm trying to get a handle on how ClangIR handles ABI relevant type information. What I originally wanted to figure out is how __int128 and _BitInt(128) are distinguished (which have different alignment), given that integer types are represented using only signedness and bit width: https://clang.godbolt.org/z/zGK5shafz

It turns out that the type representation is actually much lower level than I thought, and seems to correspond more to the lowered LLVM IR type (including padding fillers) rather than the original C type. However, I don't believe it is possible to perform correct calling convention lowering on such a low-level representation.

It seems like calling convention lowering is currently not implemented (in this example the structs get passed as LLVM structs), but I'm curious what the plan for handling this in the future is. Is the type system going to become higher level?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClangIRAnything related to the ClangIR projectquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions