================ @@ -14296,6 +14296,31 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap<bool> &FeatureMap, } } +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, + const FunctionDecl *FD) { + return { KernelNameType, FD }; +} + +void ASTContext::registerSYCLEntryPointFunction(FunctionDecl *FD) { + assert(!FD->isInvalidDecl()); + assert(!FD->isDependentContext()); + + const auto *SKEPAttr = FD->getAttr<SYCLKernelEntryPointAttr>(); + assert(SKEPAttr && "Missing sycl_kernel_entry_point attribute"); + + CanQualType KernelNameType = getCanonicalType(SKEPAttr->getKernelName()); + auto IT = SYCLKernels.find(KernelNameType); + if (IT != SYCLKernels.end()) { + if (!declaresSameEntity(FD, IT->second.GetKernelEntryPointDecl())) + llvm::report_fatal_error("SYCL kernel name conflict"); ---------------- erichkeane wrote:
I would expect us to use the normal diagnostics engine on the 2nd to last line there to diagnose that. I think we did something similar in `intel/llvm` that should be what you're looking for. However, any such diagnostic is going to be imperfect cross-TU, but `report_fatal_error` cant do that anyway. Perhaps there is a need for a `checkSYCLEntryPointFunction` that does this look up vs previous ones. 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