[clang-tools-extra] [clang-tidy] New option `CompilationArgsToRemoveRegex` to remove arguments from the command line (PR #111453)
Carlos Galvez via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 22 11:17:26 PST 2024
=?utf-8?q?FĂ©lix-Antoine?= Constantin
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/111453 at github.com>
carlosgalvezp wrote:
The way we do it at our place is that we have 2 toolchains, one for GCC and one for Clang, each with separate sets of flags. We assume that being able to compile with Clang is a prerequisite to running clang-tidy. For example, even if you have only `-Wall`, Clang (via clang-tidy) could introduce a warning that GCC doesn't have, so you'd get Clang compiler errors via clang-tidy (`clang-diagnostic-error`), which is confusing.
Once that's satisfied, we can run clang-tidy based on the Clang toolchain - this way we ensure all the flags are valid for clang-tidy (since they are for Clang).
But I understand if having 2 parallel toolchains can be costly to maintain.
https://github.com/llvm/llvm-project/pull/111453
More information about the cfe-commits
mailing list