================
@@ -6795,8 +6795,9 @@ static FunctionDecl *rewriteBuiltinFunctionDecl(Sema 
*Sema, ASTContext &Context,
   QualType DeclType = FDecl->getType();
   const FunctionProtoType *FT = dyn_cast<FunctionProtoType>(DeclType);
 
-  if (!Context.BuiltinInfo.hasPtrArgsOrResult(FDecl->getBuiltinID()) || !FT ||
-      ArgExprs.size() < FT->getNumParams())
+  if (!Context.BuiltinInfo.hasPtrArgsOrResult(FDecl->getBuiltinID()) ||
+      Context.BuiltinInfo.hasNoAddressSpaceRewrite(FDecl->getBuiltinID()) ||
----------------
yxsamliu wrote:

Could we keep accepting `address_space(0)` when it matches the target’s code 
address space? The current builtin emits the right `ptr` operands for that 
case, and this guard would reject it. Could we add a CodeGen test for it?

https://github.com/llvm/llvm-project/pull/218642
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to