aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorYaxun (Sam) Liu <yaxun.liu@amd.com>2024-07-11 21:52:04 -0400
committerGitHub <noreply@github.com>2024-07-11 21:52:04 -0400
commit90abdf83e273586a43e1270e5f0a11de5cc35383 (patch)
tree88812229ed82d216c2323c0355c850dbaf95023b /clang/lib/CodeGen/CodeGenModule.h
parentf52a4679e683807d699e105a6139a5a91401667f (diff)
downloadllvm-90abdf83e273586a43e1270e5f0a11de5cc35383.zip
llvm-90abdf83e273586a43e1270e5f0a11de5cc35383.tar.gz
llvm-90abdf83e273586a43e1270e5f0a11de5cc35383.tar.bz2
[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.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h3
1 files changed, 3 insertions, 0 deletions
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<const CompoundLiteralExpr *, llvm::GlobalVariable *>