This patch adds the Sema changes needed by the standard algorithm offload feature being proposed here: https://discourse.llvm.org/t/rfc-adding-c-parallel-algorithm-offload-support-to-clang-llvm/72159/1. The verbose documentation is included in the head of the patch series. This change impacts the CUDA / HIP language specific checks, and only manifests if compiling in stdpar mode. In this case, we essentially do two things:
- Allow device side callers to call host side callees - since the user visible HLL would be standard C++, with no annotations / restriction mechanisms, we cannot unambiguously establish that such a call is an error, so we conservatively allow all such calls, deferring actual cleanup to a subsequent pass over IR;
- Allow host formed lambdas to capture by reference;
- Allow device functions to use host global variables.
Please note that host and device here are used to match existing nomenclature, they would not be present in user code.