================
@@ -2499,6 +2500,34 @@ checkMathBuiltinElementType(Sema &S, SourceLocation Loc,
QualType ArgTy,
return false;
}
+/// The AMDGPU printf lowering can only find %s specifiers in a format string
+/// known at compile time, so with any other format a string argument would be
+/// printed as its address. Any pointer argument may be a string, so reject it.
+static void checkAMDGPUDevicePrintf(Sema &S, CallExpr *TheCall) {
+ const llvm::Triple &TT = S.Context.getTargetInfo().getTriple();
----------------
steffenlarsen wrote:
I may be misunderstanding your comment, but it's a limitation of the way printf
is implemented for AMDGPU. It should be fine to have %s in non-constant format
strings on most other targets.
https://github.com/llvm/llvm-project/pull/238287
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits