Page MenuHomePhabricator

[analyzer][NFC] Refactor functions in PlistDiagnostics to take AnalyzerOptions as parameter
ClosedPublic

Authored by Szelethus on Oct 2 2018, 10:09 AM.

Details

Summary

I intend to add a new flag macro-expnasions-as-events, and unfortunately I'll only be able to convert the macro piece into an event one once I'm about to emit it, due to the lack of an avaible Preprocessor object in the BugReporter.

Diff Detail

Repository
rC Clang

Event Timeline

Szelethus created this revision.Oct 2 2018, 10:09 AM
NoQ accepted this revision.Oct 2 2018, 10:16 AM

Fair enough!

lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
306–307

Maybe just make this function non-static instead of passing members around manually?

315–317

And this.

This revision is now accepted and ready to land.Oct 2 2018, 10:16 AM
Szelethus added inline comments.Oct 2 2018, 10:50 AM
lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
306–307

That would probably be super-invasive for this file, from what I'm seeing. I might end up doing that, but this would mean pretty much a complete refactoring.

To be honest, almost all functions here should be a method, the output stream, FIDMap, Preprocessor, AnalyzerOptions could all be left out.

I'll probably do something with this parameter spaghetti, it bothers me too, but maybe in a separate patch :)

This revision was automatically updated to reflect the committed changes.