[all-commits] [llvm/llvm-project] bba729: [clang-check] Adjust argument adjusters for clang-...

Sam McCall via All-commits all-commits at lists.llvm.org
Fri Jan 14 01:06:00 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bba729af3ef803c35c082417f89a1ac89462e22b
      https://github.com/llvm/llvm-project/commit/bba729af3ef803c35c082417f89a1ac89462e22b
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    A clang/test/Tooling/clang-check-analyze-save-temps.cpp
    M clang/tools/clang-check/ClangCheck.cpp

  Log Message:
  -----------
  [clang-check] Adjust argument adjusters for clang-check to strip options blocking the static analyzer

Output generation options (like `-save-temps`) will make the analyzer not executed even `--analyze` option is provided in the driver arguments.
Besides, the original approach of adding `--analyze` option will not work when (more than one) `-fsyntax-only` options are provided in the driver arguments.

This patch fixes these two problems by using the syntax-only adjuster to remove output generation options and manually filter out redundant `-fsyntax-only` options.

In the new implementation, the adjusters added by `ClangTool` will not be removed but used as dependencies for clang-check adjusters for analyzer options.

Reviewed By: sammccall

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




More information about the All-commits mailing list