codechecker icon indicating copy to clipboard operation
codechecker copied to clipboard

Create new tool(s) for normalizing compilation databases

Open gamesh411 opened this issue 6 years ago • 0 comments

CodeChecker currently uses the following 2 mechanisms to preprocess the compilation databases (compile_commands.json):

  • Filtering and extending compilation flags in order to make the build command analysis-friendly.
  • Unique-ing the compilation database, so translation unit is only analyzed once, even if there are multiple binaries which use its object code (appears a linker input multiple times).

The steps which handle these are mostly used as part of the analysis process, however, the need may arise to create a "normalized" compilation database as a separate step.

IMHO 2 new tools should be created (accessible as CodeChecker subcommands, and CodeChecker libraries as well) to handle these task (with an optional wrapper command which runs these two in sequence).

On-the-fly analysis feature would also require this "normalized" compilation database, as parsing the original compile_commands.json and using the dumped AST files leads to some amount of difference in AST used for analysis. Analysis results may differ, which is undesirable.

gamesh411 avatar Jul 23 '19 09:07 gamesh411