Page MenuHomePhabricator

[PATCH 2/3] [RFC only] clang implementation of sizeless types

Authored by rsandifo-arm on May 1 2018, 4:59 AM.



`[ Not intended for commit. I'm just posting it to back up an

RFC on cfe-dev. ]

This patch adds the concept of "sizeless" types to core C and C++.
It's a prerequisite for adding AArch64 SVE intrinsics.

The patch relies on two new type categorisations:

  • sized vs. sizeless

    All standard types are "sized" (even void). Sizeless types are purely an extension.
  • indefinite vs. definite

    Indefinite types can be used to declare objects but can't be used to construct them. For sized types, "indefinite" is the same as the standard definition of "incomplete".

The patch then redefines "complete" to mean "sized and definite".
All sizeless types are permanently incomplete, since their size is
never known at compile time.

The cfe-dev RFC will have more details; the above is only a summary.

The patch doesn't reword the diagnostics to talk about "indefinite" rather
than "incomplete" since "indefinite" won't mean much to most users.

The FIXMEs about inline asms are resolved by later SVE patches.`

Diff Detail