[all-commits] [llvm/llvm-project] 5227be: [clangd] More precisely enable clang warnings thro...

Sam McCall via All-commits all-commits at lists.llvm.org
Fri Apr 29 13:30:31 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5227be8b6aa0edb2edb0b76e1039a7dd5641c80a
      https://github.com/llvm/llvm-project/commit/5227be8b6aa0edb2edb0b76e1039a7dd5641c80a
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2022-04-29 (Fri, 29 Apr 2022)

  Changed paths:
    M clang-tools-extra/clangd/ParsedAST.cpp
    M clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
    M clang/include/clang/Basic/DiagnosticIDs.h
    M clang/lib/Basic/DiagnosticIDs.cpp

  Log Message:
  -----------
  [clangd] More precisely enable clang warnings through ClangTidy options

clang-tidy's behavior is to add the -W flags, and then map all clang diagnostics
to "clang-diagnostic-foo" pseudo-check-names, then use Checks to filter those.

Previous to this patch, we were handling -W flags but not filtering the
diagnostics, assuming both sets of information encoded the same thing.

However this intersection is nontrivial when diagnostic group hierarchy is
involved. e.g. -Wunused + clang-diagnostic-unused-function should not enable
unused label warnings.

This patch more closely emulates clang-tidy's behavior, while not going to
the extreme of generating tidy check names for all clang diagnostics and
filtering them with regexes.

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




More information about the All-commits mailing list