Skip to content

Generating CodeQL database without compiling the project #5303

@adriaanjacobs

Description

@adriaanjacobs

[C/C++]

This is more of a nice-to-have/curiosity question, but I was wondering if it would be possible (either right now or in the future) to generate CodeQL databases without actually compiling the project? I'm working on some compiler instrumentation task and using CodeQL's excellent taint analysis to automatically detect certain patterns and provide automatic mediation inside the compiler. However, from a user experience standpoint the process of compiling the same code twice (first to generate the database, then a second time with a modified compiler to run the analysis and instrument the code) to produce a single instrumented executable is quite strange.

Does CodeQL actually need to run the compiler or is looking at the invocations sufficient (i.e. make --dry-run)? Up until now, I thought the generated binaries where simply a side-effect for CodeQL to be able to look at the compiler invocations and also serve as a kind of sanity check that the code is in fact compilable. But now I was wondering, does it use any of the generated files in the extraction process?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions