Page MenuHomePhabricator

[clang-tidy] Profile is a per-AST (per-TU) data.
ClosedPublic

Authored by lebedev.ri on May 6 2018, 10:23 AM.

Details

Summary

As discussed in D45931, currently, profiling output of clang-tidy is somewhat not great.
It outputs one profile at the end of the execution, and that profile contains the data
from the last TU that was processed. So if the tool run on multiple TU's, the data is
not accumulated, it is simply discarded.

It would be nice to improve this.

This differential is the first step - make this profiling info per-TU,
and output it after the tool has finished processing each TU.
In particular, when ClangTidyASTConsumer destructor runs.

Next step will be to add a CSV (JSON?) printer to store said profiles under user-specified directory prefix.

Diff Detail

Repository
rL LLVM

Event Timeline

lebedev.ri created this revision.May 6 2018, 10:23 AM
Eugene.Zelenko added inline comments.
clang-tidy/ClangTidyDiagnosticConsumer.cpp
181 ↗(On Diff #145402)

Will be good idea to use default member initialization for DiagEngine too.

lebedev.ri added inline comments.May 7 2018, 12:27 AM
clang-tidy/ClangTidyDiagnosticConsumer.cpp
181 ↗(On Diff #145402)

Yes, but in the context of the diff that would be a completely unrelated change, i try to avoid those..

alexfh accepted this revision.May 8 2018, 5:10 AM

LG with a couple of nits.

clang-tidy/ClangTidyDiagnosticConsumer.cpp
181 ↗(On Diff #145402)

I'd better leave the initializer here for consistency with the other fields.

clang-tidy/ClangTidyDiagnosticConsumer.h
168 ↗(On Diff #145402)

It seems to be setEnableProfiling() now.

This revision is now accepted and ready to land.May 8 2018, 5:10 AM

LG with a couple of nits.

Thank you for the review, faster than ever :)

Closed by commit rL331763: [clang-tidy] Profile is a per-AST (per-TU) data. (authored by lebedevri, committed by ). · Explain WhyMay 8 2018, 6:18 AM
This revision was automatically updated to reflect the committed changes.