fhahn added inline comments.

================
Comment at: clang/lib/Sema/SemaChecking.cpp:16727-16728
   QualType TyA = A.get()->getType();
-  if (checkMathBuiltinElementType(*this, ArgLoc, TyA))
+  if (checkMathBuiltinElementType(*this, ArgLoc, TyA) ||
+      ExtraCheck(TyA, ArgLoc))
     return true;
----------------
aaron.ballman wrote:
> In some ways, it's a not really ideal that we split the type checking like 
> this. `SemaBuiltinElementwiseMathOneArg()` checks some type validity and the 
> caller checks some more type validity, so there's no one location to know 
> what types are actually expected for any given builtin calling this.
> 
> Would it be reasonable to instead hoist all the type checking code out of 
> `SemaBuiltinElementwiseMathOneArg()` and not pass in a functor to it, but 
> instead check the `CallExpr` type after the call returns? We could also fix 
> up the function name to be a bit less nonsensical at the same time, like 
> renaming it to `PrepareBuiltinElementwiseMathOneArgCall()` or something along 
> those lines?
> Would it be reasonable to instead hoist all the type checking code out of 
> SemaBuiltinElementwiseMathOneArg() and not pass in a functor to it, but 
> instead check the CallExpr type after the call returns?

Yeah that sounds better!


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

https://reviews.llvm.org/D114688

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to