I was working on CUDA support for clangd, and I've found that clangd is missing support for auxiliary triple specification. Thus, if we try making clangd work with CUDA or other languages that requires auxiliary triple, it will produce some wrong results.
After some investigation of what clang actually did, I borrowed some code from clang/lib/Frontend/CompilerInstance.cpp to make clangd work as well.
I don't know whether this fix is reasonable or not, but it just fix something looks like a problem in clangd.