================ @@ -1100,3 +1101,49 @@ std::string SemaCUDA::getConfigureFuncName() const { // Legacy CUDA kernel configuration call return "cudaConfigureCall"; } + +// Record any local constexpr variables that are passed one way on the host +// and another on the device. +void SemaCUDA::recordPotentialODRUsedVariable( + MultiExprArg Arguments, OverloadCandidateSet &Candidates) { + sema::LambdaScopeInfo *LambdaInfo = SemaRef.getCurLambda(); + if (!LambdaInfo) + return; + + for (unsigned I = 0; I < Arguments.size(); ++I) { + auto *DeclRef = dyn_cast<DeclRefExpr>(Arguments[I]); + if (!DeclRef) + continue; + auto *Variable = dyn_cast<VarDecl>(DeclRef->getDecl()); + if (!Variable || !Variable->isLocalVarDecl() || !Variable->isConstexpr()) + continue; + + bool HostByValue = false, HostByRef = false; + bool DeviceByValue = false, DeviceByRef = false; ---------------- Artem-B wrote:
I'd move them do to where we use them. https://github.com/llvm/llvm-project/pull/136645 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits