[clang][clangd] Avoid inconsistent target creation

As proposed in D97109, I tried to make target creation consistent in `clang` and `clangd` by replacing the original procedure with a single function introduced in D97493.

This also helps `clangd` works with CUDA, OpenMP, etc.

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D98128

GitOrigin-RevId: 14a7296c0120913e949739e4e90ea5a5f1bd8af1
2 files changed