diff options
author | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2024-07-11 21:52:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-11 21:52:04 -0400 |
commit | 90abdf83e273586a43e1270e5f0a11de5cc35383 (patch) | |
tree | 88812229ed82d216c2323c0355c850dbaf95023b /clang/lib/CodeGen/CodeGenModule.h | |
parent | f52a4679e683807d699e105a6139a5a91401667f (diff) | |
download | llvm-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.h | 3 |
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 *> |