After D86781, the check for the TO flag when processing firstprivates is missing. As a result, sometimes the device copy of a firstprivate never gets initialized.
More specifically, D86781 tried to force lambda structs to be allocated immediately by marking them as a non-firstprivate, so that PrivateArgumentManagerTy::addArg allocates memory for them immediately. However, calling addArg with IsFirstPrivate=false makes the function skip initializing the device copy. Whether an argument is firstprivate and whether we need to allocate memory immediately are not synonyms, so this patch introduces one more control variable for immediate allocation and sets it apart from initialization.
clang-tidy: warning: 'HstPtrName' declared with a const-qualified type alias; results in the type being 'void *const' instead of 'const void *' [misc-misplaced-const]
not useful