================ @@ -14794,9 +14803,36 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap<bool> &FeatureMap, } } -static SYCLKernelInfo BuildSYCLKernelInfo(CanQualType KernelNameType, +static SYCLKernelInfo BuildSYCLKernelInfo(ASTContext &Context, + CanQualType KernelNameType, const FunctionDecl *FD) { - return {KernelNameType, FD}; + // Host and device compilation may use different ABIs and different ABIs + // may allocate name mangling discriminators differently. A discriminator + // override is used to ensure consistent discriminator allocation across + // host and device compilation. + auto DeviceDiscriminatorOverrider = + [](ASTContext &Ctx, const NamedDecl *ND) -> std::optional<unsigned> { + if (const auto *RD = dyn_cast<CXXRecordDecl>(ND)) + if (RD->isLambda()) ---------------- erichkeane wrote:
I believe my point was; At the time it is a Generic lambda, it doesn't actually have a device mangling number yet. So you won't get it mangled correctly. Also, it doesn't seem that we are properly transforming the device mangling number by my investigation of the code. https://github.com/llvm/llvm-project/pull/133030 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits