File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,9 @@ CPPINTEROP_API bool IsNamespace(TCppScope_t scope);
281281// / Checks if the scope is a class or not.
282282CPPINTEROP_API bool IsClass (TCppScope_t scope);
283283
284+ // / Checks if the scope is a CUDA function or not.
285+ CPPINTEROP_API bool IsCUDAFunction (TCppScope_t scope);
286+
284287// / Checks if the scope is a function.
285288CPPINTEROP_API bool IsFunction (TCppScope_t scope);
286289
Original file line number Diff line number Diff line change @@ -304,6 +304,17 @@ bool IsNamespace(TCppScope_t scope) {
304304 return isa<NamespaceDecl>(D);
305305}
306306
307+ bool IsCUDAFunction (TCppScope_t scope) {
308+ Decl* D = static_cast <Decl*>(scope);
309+ if (auto * FD = llvm::dyn_cast<FunctionDecl>(D)) {
310+ for (const auto & i : FD->attrs ()) {
311+ if (i->getKind () == clang::attr::Kind::CUDAGlobal)
312+ return true ;
313+ }
314+ }
315+ return false ;
316+ }
317+
307318bool IsClass (TCppScope_t scope) {
308319 Decl* D = static_cast <Decl*>(scope);
309320 return isa<CXXRecordDecl>(D);
You can’t perform that action at this time.
0 commit comments