With a new switch we may be able to print to stderr if a new TU is being loaded
during CTU. This is very important for higher level scripts (like CodeChecker)
to be able to parse this output so they can create e.g. a zip file in case of
a Clang crash which contains all the related TU files.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
The idea is great!
I think this should rather be an -analyzer-config flag, since the actual analysis changes with a new output (refer to AnalyzerOption's doxygen comments). Please note that I'm about to land some patches that modifies AnalyzerOptions.def quite a bit, but rebasing shouldn't be too bad anyways.
edit: They are now in trunk.
Also, almost everywhere CTU is capitalized, so I guess it should be in the field name too.
test/Analysis/ctu-main.cpp | ||
---|---|---|
6 ↗ | (On Diff #176159) | I think these RUN lines would really benefit from introducing line breaks. |
Hi Gabor,
In addition to Umann remarks, there is a small comment inline.
lib/CrossTU/CrossTranslationUnit.cpp | ||
---|---|---|
239 ↗ | (On Diff #176159) | I think we can remove parens from the message. |
Also, AnalyzerOptions.def was recently clan-formatted, feel free to run it again after the changes you make in it.
- Rename AnalyzerDisplayCtuProgress to Opts.AnalyzerDisplayCTUProgress
- Change the CTU progress message
Also, almost everywhere CTU is capitalized, so I guess it should be in the field name too.
Ok, I renamed it to have CTU all capitalized.
lib/CrossTU/CrossTranslationUnit.cpp | ||
---|---|---|
239 ↗ | (On Diff #176159) | Ok, I removed the parens. And also changed the text from CTU loaded AST for source file to CTU loaded AST file since we dump the path to the AST, not the path to the source file from which we generated the AST file. |
test/Analysis/ctu-main.cpp | ||
6 ↗ | (On Diff #176159) | Yes, I agree. Unfortunately, I could not figure out how to break them. Using a simple "\" at around the 80th column gives Test has unterminated run lines (with '\'). If I use block comments with "\" the same happens. If I use block comments and don't use the "\" then the second line is not interpreted. Is it really possible to break RUN lines? I could not find anything about that in the online docs. |
- Break long RUN line
test/Analysis/ctu-main.cpp | ||
---|---|---|
6 ↗ | (On Diff #176159) | Oh, I just have found your other comment to the other patch. So yes, it is indeed possible to break this line. I updated the patch accordingly. The other long lines which are already there I am going to change in an independent patch: (https://reviews.llvm.org/D55129). |
test/Analysis/ctu-main.cpp | ||
---|---|---|
6 ↗ | (On Diff #176159) | Is there any particular reason why we use %clang_cc1 -analyze as opposed to %clang_analyze_cc1? If not, lets change it. By the way, thanks! This looks neat. |
The code not directly related to adding the actual flag looks great, but this still should be an -analyzer-config option.
While Static Analyzer is the only client of CTU library at the moment, we might have more in the future. I would not use the phrase ANALYZE in the log message. Once this is resolved the rest looks good.
While Static Analyzer is the only client of CTU library at the moment, we might have more in the future. I would not use the phrase ANALYZE in the log message. Once this is resolved the rest looks good.
Ok, I removed the "ANALYZE " prefix from the log message.