From ea08c4cd1c0869ec5024a8bb3f5cdf06ab03ae83 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Fri, 20 Aug 2021 13:28:37 +0200 Subject: [CUDA] Fix static device variables with -fgpu-rdc NVPTX does not allow dots in the identifier, so ptxas errors out with fatal : Parsing error near '.static': syntax error because it parses .static as a directive. Avoid this problem by using two underscores, similar to what OpenMP does for outlined functions. Differential Revision: https://reviews.llvm.org/D108456 --- clang/lib/CodeGen/CodeGenModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 13d7cce880e0..0940980461cd 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -6444,5 +6444,5 @@ bool CodeGenModule::stopAutoInit() { void CodeGenModule::printPostfixForExternalizedStaticVar( llvm::raw_ostream &OS) const { - OS << ".static." << getContext().getCUIDHash(); + OS << "__static__" << getContext().getCUIDHash(); } -- cgit v1.2.3