[PATCH] D28670: [ObjC] Disallow vector parameters and return values in Objective-C methods on older X86 targets

Bruno Cardoso Lopes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 6 17:45:02 PST 2017


bruno added a comment.

Hi Alex,



================
Comment at: lib/Sema/SemaDeclObjC.cpp:4312
+  for (const ParmVarDecl *P : Method->parameters()) {
+    if (P->getType()->isVectorType()) {
+      Loc = P->getLocStart();
----------------
Assuming objc/c++ can pass/return these, the current check wouldn't be enough to cover x86_64 ABI cases where small (< 8 bytes) trivial classes containing vector types are directly passed / returned as vector types. You might want to check if that applies here.

See test/CodeGenCXX/x86_64-arguments-avx.cpp for examples (and x86_64 abi doc, item 3.2.3)


================
Comment at: test/SemaObjC/x86-method-vector-values.m:16
+
+typedef __attribute__((__ext_vector_type__(3))) float float3;
+
----------------
Can you also add to the testcase instances that use regular non-ext vector (`vector_type(...)`)?


Repository:
  rL LLVM

https://reviews.llvm.org/D28670





More information about the cfe-commits mailing list