Skip to content

support cross translation unit analysis #83

@dkrupp

Description

@dkrupp

Cross TU analysis feature (to be introduced in this patch: https://reviews.llvm.org/D30691) requires 2 stage analysis: 1st stage: emit ast (clang -emit-ast) for all source files into a a temporary directory (ctu-dir)
2nd stage: invoke clang analysis for each file with the -ctu-dir option so can clang can find the result of the first phase.

In the CTU patch this feature is implemented in the
ctu-build.py and ctu-analyze.py scripts. These scripts reuse scan-build's analyze-cc script.

Reviewers suggested that the whole ctu features should be added to scan-build and then ctu-build.py and ctu-analyze.py scripts could be deleted.


scan-build and anayze-build could be extended withe following options (at least the first should be supported):

--ctu : Perform CTU analysis (1st and 2nd phase), using the default ctu-dir for temporary output. At the end of the analysis, the temporary directory is removed.
--ctu-dir directory: Optional parameter to define the ctu temporary directory
--ctu-first-phase-only: do not perform the analyis phase, only the 1st emit-ast phase
--keep-ctu-dir: do not automatically remove ctu-dir temporary directory after analysis
--ctu-analyze-only: Perform only the 2nd analysis phase. In this mode ctu-dir option is mandatory

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions