================ @@ -14296,6 +14296,34 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap<bool> &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(CanQualType KernelNameType, + const FunctionDecl *FD) { + return {KernelNameType, FD}; +} + +void ASTContext::registerSYCLEntryPointFunction(FunctionDecl *FD) { + // If the function declaration to register is invalid or dependent, the + // registration attempt is ignored. + if (FD->isInvalidDecl() || FD->isTemplated()) + return; + + const auto *SKEPAttr = FD->getAttr<SYCLKernelEntryPointAttr>(); + assert(SKEPAttr && "Missing sycl_kernel_entry_point attribute"); + + // Be tolerant of multiple registration attempts so long as each attempt + // is for the same entity. Callers are obligated to detect and diagnose + // conflicting kernel names prior to calling this function. + CanQualType KernelNameType = getCanonicalType(SKEPAttr->getKernelName()); + auto IT = SYCLKernels.find(KernelNameType); + if (IT != SYCLKernels.end()) { + assert(declaresSameEntity(FD, IT->second.getKernelEntryPointDecl()) && ---------------- tahonermann wrote:
Good suggestion. Done. https://github.com/llvm/llvm-project/pull/111389 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits