aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>2019-08-22 15:34:35 +0530
committerSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>2020-01-16 15:15:38 +0530
commited181efa175d3e0acc134e6cd161914e64c7195e (patch)
treec1d76b4bf5b23ad36928088f459153baacef2dc2 /clang/lib/CodeGen/CodeGenFunction.h
parent773ae62ff85d435d48240e8fb5267db32edaf7a1 (diff)
downloadllvm-ed181efa175d3e0acc134e6cd161914e64c7195e.zip
llvm-ed181efa175d3e0acc134e6cd161914e64c7195e.tar.gz
llvm-ed181efa175d3e0acc134e6cd161914e64c7195e.tar.bz2
[HIP][AMDGPU] expand printf when compiling HIP to AMDGPU
Summary: This change implements the expansion in two parts: - Add a utility function emitAMDGPUPrintfCall() in LLVM. - Invoke the above function from Clang CodeGen, when processing a HIP program for the AMDGPU target. The printf expansion has undefined behaviour if the format string is not a compile-time constant. As a sufficient condition, the HIP ToolChain now emits -Werror=format-nonliteral. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D71365
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 3d8bc93..5ab15bf 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -3722,6 +3722,8 @@ public:
RValue EmitNVPTXDevicePrintfCallExpr(const CallExpr *E,
ReturnValueSlot ReturnValue);
+ RValue EmitAMDGPUDevicePrintfCallExpr(const CallExpr *E,
+ ReturnValueSlot ReturnValue);
RValue EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
const CallExpr *E, ReturnValueSlot ReturnValue);