[PATCH] D139428: Handle char{8,16,32} and wchar_t in ASTContext::getIntegerRank()

Tom Honermann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 6 07:31:16 PST 2022


tahonermann requested changes to this revision.
tahonermann added a comment.
This revision now requires changes to proceed.

The direction of the changes looks right. I noted a couple of minor considerations.



================
Comment at: clang/lib/AST/ASTContext.cpp:7109
+  case BuiltinType::Char8:
+    return getIntegerRank(CharTy.getTypePtr());
+  case BuiltinType::Char16:
----------------
This should technically be `UnsignedCharTy` though it probably doesn't matter.


================
Comment at: clang/test/SemaCXX/vector-bool.cpp:93-104
+
+// Don't crash due to missing integer ranks.
+char8_t v1 __attribute__((vector_size(16)));
+char16_t v2 __attribute__((vector_size(16)));
+char32_t v3 __attribute__((vector_size(16)));
+wchar_t v4 __attribute__((vector_size(16)));
+void triggerIntegerRankCheck() {
----------------
This source file purports to be specific to vectors with bool element type. These additions look like they would be more at home in `clang/test/SemaCXX/vector.cpp`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139428



More information about the cfe-commits mailing list