Add support for profiling the matchers used.
This will be connected with clang-tidy to generate a report to determine
and debug slow checks.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Awesome! A couple of comments inline.
| include/clang/ASTMatchers/ASTMatchFinder.h | ||
|---|---|---|
| 123 ↗ | (On Diff #15247) | I'd prefer a more structured interface, e.g. a map from string to some struct containing collected timings + a method to convert this map to string or print it to a stream. Not sure if this fits well with LLVM timing facilities you use, though. |
| lib/ASTMatchers/ASTMatchFinder.cpp | ||
| 315 ↗ | (On Diff #15247) | You can check EnableCheckProfiling inside getTimerForBucket to reduce code repetition. |
| include/clang/ASTMatchers/ASTMatchFinder.h | ||
|---|---|---|
| 123 ↗ | (On Diff #15247) | The current TimerGroup interface is a little awkward. So, would you prefer if this was: struct ProfileChecks { llvm::StringMap<llvm::TimeRecord> *Records; }; ? |
| lib/ASTMatchers/ASTMatchFinder.cpp | ||
| 315 ↗ | (On Diff #15247) | I put it outside to avoid calling the function when disabled. |
This is even better. One nit below.
| include/clang/ASTMatchers/ASTMatchFinder.h | ||
|---|---|---|
| 134 ↗ | (On Diff #15264) | Maybe just "CheckProfiling"? "Enable" hints that this is a bool, but it's not (though is used as a bool in some places). |
Fix some names.
| include/clang/ASTMatchers/ASTMatchFinder.h | ||
|---|---|---|
| 134 ↗ | (On Diff #15264) | It used to be a bool on the first iterations of the code. |