[clang] Add clang_elementwise_builtin_alias (PR #86175)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 21 13:23:35 PDT 2024


================
@@ -2239,6 +2239,39 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
       return true;
     ICEArguments &= ~(1 << ArgNo);
   }
+  // if the call has the elementwise attribute, then
+  // make sure that an elementwise expr is emitted.
+  if (FDecl->hasAttr<ElementwiseBuiltinAliasAttr>()) {
+    switch (FDecl->getNumParams()) {
+    case 1: {
+      if (PrepareBuiltinElementwiseMathOneArgCall(TheCall))
+        return ExprError();
+
+      QualType ArgTy = TheCall->getArg(0)->getType();
+      if (checkFPMathBuiltinElementType(
----------------
farzonl wrote:

not all one arg math builtin  are floating point only.

https://github.com/llvm/llvm-project/pull/86175


More information about the cfe-commits mailing list