aaron.ballman added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp:73
+ // of -init.
+ const StringRef Receiver =
+ getReceiverString(Expr->getReceiverRange(), SM, LangOpts);
----------------
We don't typically make local value types `const` (only pointers or
references); here and elsewhere in the patch.
================
Comment at: clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp:76-77
+ // Some classes should use standard factory methods instead of alloc/init.
+ const std::map<StringRef, StringRef> ClassToFactoryMethodMap = {
+ {"NSDate", "date"}, {"NSNull", "null"}};
+ const auto FoundClassFactory = ClassToFactoryMethodMap.find(Receiver);
----------------
Should this be configurable, or will users not need to control the behavior
here?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61350/new/
https://reviews.llvm.org/D61350
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits