Page MenuHomePhabricator

[analyzer] [RetainCountChecker] [NFC] Refactor the way attributes are handled
ClosedPublic

Authored by george.karpenkov on Wed, Jan 2, 1:48 PM.

Details

Summary

Make sure all checks for attributes go through a centralized function,
which checks whether attribute handling is enabled, and performs validation.
The type of the attribute is returned.

Sadly, metaprogramming is required as attributes have no sensible static getters.

Diff Detail

Repository
rL LLVM

Event Timeline

NoQ accepted this revision.Tue, Jan 8, 5:17 PM

Gathered weirdness is better than scattered weirdness!

clang/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp
106–112 ↗(On Diff #179937)

Is it possible to skip T2 here? I.e., template <class T1, class... Others> and then hasAnyEnabledAttrOf<Others...>.

This revision is now accepted and ready to land.Tue, Jan 8, 5:17 PM
george.karpenkov marked an inline comment as done.Tue, Jan 8, 5:29 PM
george.karpenkov added inline comments.
clang/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp
106–112 ↗(On Diff #179937)

Nope, it's ambiguous otherwise.

This revision was automatically updated to reflect the committed changes.