Skip to content

[clangd] Incorrect compile command heuristic in project with CUDA, HIP, and vanilla C++ #148972

@alexbaretta

Description

@alexbaretta

I am using clangd in a project that combines the three dialects of C++ listed in the title. CMake is configured to produce the appropriate compile commands for each source file, but header files do not match one-to-one the source files, as the code is highly templatized, and most headers do not have a corresponding source. Therefore, for each header, clangd uses its heuristic match logic to pick a source file whose compile command will be used as the basis for to compute the compile command for the header. This logic however fails because, although LLVM supports both HIP and CUDA, LLVM does not have the necessary file types for CUDA and HIP headers, nor the logic to map them to their corresponding source file types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions