This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by george.karpenkov on Jan 2 2019, 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

Event Timeline

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

Gathered weirdness is better than scattered weirdness!

clang/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp
106–112

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.Jan 8 2019, 5:17 PM
george.karpenkov marked an inline comment as done.Jan 8 2019, 5:29 PM
george.karpenkov added inline comments.
clang/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp
106–112

Nope, it's ambiguous otherwise.

This revision was automatically updated to reflect the committed changes.