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

Richard Sandiford via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 1 05:00:09 PDT 2018


rsandifo-arm created this revision.
Herald added subscribers: cfe-commits, kristof.beyls, rengolin.
Herald added a reviewer: javed.absar.

`[ 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.`


Repository:
  rC Clang

https://reviews.llvm.org/D46308

Files:
  include/clang/AST/CanonicalType.h
  include/clang/AST/Expr.h
  include/clang/AST/Type.h
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Sema/Initialization.h
  include/clang/Sema/Sema.h
  lib/AST/ASTContext.cpp
  lib/AST/ExprClassification.cpp
  lib/AST/Type.cpp
  lib/Sema/SemaChecking.cpp
  lib/Sema/SemaCodeComplete.cpp
  lib/Sema/SemaDecl.cpp
  lib/Sema/SemaDeclAttr.cpp
  lib/Sema/SemaDeclCXX.cpp
  lib/Sema/SemaExpr.cpp
  lib/Sema/SemaExprCXX.cpp
  lib/Sema/SemaFixItUtils.cpp
  lib/Sema/SemaInit.cpp
  lib/Sema/SemaLambda.cpp
  lib/Sema/SemaOpenMP.cpp
  lib/Sema/SemaOverload.cpp
  lib/Sema/SemaPseudoObject.cpp
  lib/Sema/SemaStmt.cpp
  lib/Sema/SemaStmtAsm.cpp
  lib/Sema/SemaType.cpp
  test/Sema/sizeless-1.c
  test/SemaCXX/sizeless-1.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46308.144694.patch
Type: text/x-patch
Size: 90718 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180501/eea1f419/attachment-0001.bin>


More information about the cfe-commits mailing list