From 90abdf83e273586a43e1270e5f0a11de5cc35383 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 11 Jul 2024 21:52:04 -0400 Subject: [CUDA][HIP][NFC] add CodeGenModule::shouldEmitCUDAGlobalVar (#98543) Extract the logic whether to emit a global var based on CUDA/HIP host/device related attributes to CodeGenModule::shouldEmitCUDAGlobalVar to be used by other places. --- clang/lib/CodeGen/CodeGenModule.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.h') diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 585c4ea..caa3786 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -563,6 +563,9 @@ private: bool isTriviallyRecursive(const FunctionDecl *F); bool shouldEmitFunction(GlobalDecl GD); + // Whether a global variable should be emitted by CUDA/HIP host/device + // related attributes. + bool shouldEmitCUDAGlobalVar(const VarDecl *VD) const; bool shouldOpportunisticallyEmitVTables(); /// Map used to be sure we don't emit the same CompoundLiteral twice. llvm::DenseMap -- cgit v1.1