Page MenuHomePhabricator

[analyzer][NFC] Refactor PlistDiagnostics to use a class instead of passing 9 parameters around
ClosedPublic

Authored by Szelethus on Oct 29 2018, 3:58 AM.

Details

Summary

This has been a long time coming. Note the usage of AnalyzerOptions: I'll need it for D52742, and added it in rC343620. The main motivation for this was that I'll need to add yet another parameter to every single function, and some functions would reach their 10th (!!!!) parameter with that change.

Diff Detail

Event Timeline

Szelethus created this revision.Oct 29 2018, 3:58 AM
Szelethus edited the summary of this revision. (Show Details)Oct 29 2018, 4:00 AM
Szelethus updated this revision to Diff 171505.Oct 29 2018, 8:08 AM
xazax.hun added inline comments.Oct 29 2018, 8:19 AM
lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
82

The raw_ostream seems to be a common argument. MAybe it would be worth to make that a member too?

Szelethus added inline comments.Oct 29 2018, 8:46 AM
lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
82

I did that, and then later changed it back for debugging purposes, if anyone needs to print note pieces to errs or something.

NoQ accepted this revision.Oct 29 2018, 12:23 PM

Wow thanks! Great point.

lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
82

I guess both problems could be solved by doing a private method raw_ostream while also wrapping it into a public method with a default raw_ostream.

This revision is now accepted and ready to land.Oct 29 2018, 12:23 PM
Szelethus added inline comments.Oct 29 2018, 12:40 PM
lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
82

I think that would add unnecessary complication for very little value. I'd rather commit as is.

NoQ added inline comments.Oct 29 2018, 12:42 PM
lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
82

Sure np, just thinking aloud.

Szelethus closed this revision.Oct 29 2018, 1:13 PM

Commited in rC345531. Oops.