[PATCH] D28670: [ObjC] Disallow vector parameters and return values in Objective-C methods on older X86 targets
Erik Pilkington via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 14 11:59:30 PST 2017
erik.pilkington added a comment.
Hi Alex, thanks for CCing me!
================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:1157
+def err_objc_method_unsupported_param_ret_type : Error<
+ "%0 %select{parameter|return value}1 is unsupported for this target">;
+
----------------
s/return value/return type/? Also, It would be nice to mention what isn't supported (vector types) and the version that it becomes supported in.
================
Comment at: lib/Sema/SemaDeclObjC.cpp:4337
+ VersionTuple MethodVersion = Method->getVersionIntroduced();
+ if (SemaRef.getASTContext().getTargetInfo().getPlatformMinVersion() >=
+ AcceptedInVersion &&
----------------
I wonder if this is the right place to check this. If we're compiling using a new SDK, but deploying back before vector types were supported we will diagnose a method declared in a header even if it is never called. We should probably hook this into DiagnoseAvailabilityOfDecl (in SemaExpr.cpp), which is called whenever a method is actually used, and diagnose it then.
Repository:
rL LLVM
https://reviews.llvm.org/D28670
More information about the cfe-commits
mailing list