Skip to content

Collect Clang dependencies for ClangSA reproducers - #5184

Open
SamirRafiei wants to merge 1 commit into
Ericsson:masterfrom
SamirRafiei:fix-3161-clang-dependencies
Open

SamirRafiei wants to merge 1 commit into
Ericsson:masterfrom
SamirRafiei:fix-3161-clang-dependencies

Conversation

@SamirRafiei

Copy link
Copy Markdown

Fixes #3161

Clang Static Analyzer reproducers could miss headers when the recorded build command used GCC/G++, because TU dependency collection followed the original GCC command and therefore GCC-specific conditional includes.

This change:

  • uses CodeChecker’s existing GCC-to-Clang command transformation for dependency collection,
  • uses Clang/Clang++ dependency commands only for ClangSA reproducers,
  • preserves the original recorded build commands in the reproducer metadata and compilation database,
  • keeps C/C++ language handling intact,
  • avoids introducing a new GCC flag blacklist.

Regression coverage includes:

  • GCC vs Clang conditional headers,
  • GCC-only flags such as -fno-var-tracking-assignments,
  • correct preservation of original commands,
  • command/action association when filtering or CTU reorders build actions.

Validation:

  • 5/5 TU collector tests passed
  • relevant analyzer command / option parser tests passed
  • git diff --check passed
  • pycodestyle passed

@SamirRafiei
SamirRafiei requested a review from bruntib as a code owner November 8, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tu collector should collect dependencies for Clang and not for GCC

1 participant