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

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 7 04:02:53 PST 2017


arphaman added inline comments.


================
Comment at: lib/Sema/SemaDeclObjC.cpp:4312
+  for (const ParmVarDecl *P : Method->parameters()) {
+    if (P->getType()->isVectorType()) {
+      Loc = P->getLocStart();
----------------
bruno wrote:
> 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)
It seems that on X86 all the troubling aggregates are passed by pointer anyway, and we don't warn for X86_64 at all. The only aggregates that seem to use registers for Objective-C methods are the ones that don't use vector registers.


Repository:
  rL LLVM

https://reviews.llvm.org/D28670





More information about the cfe-commits mailing list