https://github.com/usx95 requested changes to this pull request.

Thanks for working on this.

I have a primary comment on . This implementation exposes many `internal::` 
details of lifetime safety to `AnalysisBasedWarnings.h`.

Layering-wise I propose the following changes:
- Define `struct LifetimeSafetyStats { llvm::StringMap<unsigned> 
MissingOriginCount; }` in `LifetimeSafety.h`
- Have an instance of `LifetimeSafetyStats` as a field of 
`AnalysisBasedWarnings` instead of `MissingOriginCount`.
- Change `runLifetimeSafetyAnalysis` to accept this stats instance which it can 
modify if we have collection turned on:
```cpp
void runLifetimeSafetyAnalysis(AnalysisDeclContext &AC, 
                               LifetimeSafetyReporter *Reporter, 
LifetimeSafetyStats& Stats, bool CollectStats)
```
- Also add a `void PrintStats(LifetimeSafetyStats& Stats)` in 
LifetimeSafety.h/.cpp in `clang::lifetimes` namespace which prints the stats to 
`lvm::errs()`.
- Call `clang::lifetimes::PrintStats` from 
`AnalysisBasedWarnings::PrintStats()`.

https://github.com/llvm/llvm-project/pull/166568
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to