Skip to content

[clang-tidy] Flags for more accurate selection of compile commands #148819

@t-a-james

Description

@t-a-james

Sometimes I'd like clang-tidy to use the "output" key in compile_commands.json, because that's guaranteed to be unique whereas "file" is not.

For example, one file may be compiled twice in the same build, once to target CPU and once to target AMD GPU. They have the same "file" value in compile_commands.json, but different "output" values. There is currently no way to tell clang-tidy to prefer either version of this file without pre-processing compile_commands.json.

I have run into this with clang-tidy, but I think it applies to all clang tools that consume compile_commands.json (clang-tidy, clang-query, clang-refactor, clang-include-cleaner, etc...). That might actually be all the clang tools...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions