Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support cross translation unit analysis #83

Open
dkrupp opened this issue Apr 12, 2017 · 1 comment
Open

support cross translation unit analysis #83

dkrupp opened this issue Apr 12, 2017 · 1 comment

Comments

@dkrupp
Copy link

dkrupp commented Apr 12, 2017

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

@gerazo
Copy link
Contributor

gerazo commented May 12, 2017

So after clearing up, these flags will be implemented in analyze-build:
--ctu: Perform CTU analysis (collect and analyze phase), using the default ctu-dir for temporary output. At the end of the analysis, the temporary directory is removed.
--ctu-dir: Optional parameter to define the ctu temporary directory.
--ctu-collect-only: Do not perform the analyis phase, only the 1st collect phase. Keep temporary ctu-dir for further use.
--ctu-analyze-only: Perform only the 2nd analysis phase. In this mode ctu-dir should be present and will not be removed after analysis.

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

No branches or pull requests

2 participants