[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-30 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL285533: [analyzer] NumberObjectConversion: support more types, misc updates. (authored by dergachev). Changed prior to commit: https://reviews.llvm.org/D25731?vs=76043&id=76349#toc Repository: rL LLV

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-27 Thread Devin Coughlin via cfe-commits
dcoughlin accepted this revision. dcoughlin added a comment. LGTM. Comment at: test/Analysis/number-object-conversion.m:98 + +#define NULL_INSIDE_MACRO NULL +void test_NULL_inside_macro(NSNumber *p) { This is great! And a good catch. https://reviews.llvm.org/

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-27 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 76043. NoQ added a comment. - Fix warning messages, finally, hopefully. - Make handling of macros much more careful, because errors of form `x == Y`, where X is an `NSNumber` pointer, and `Y` is a custom macro that expands to `0`, were found. https://reviews.l

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-24 Thread Anna Zaks via cfe-commits
zaks.anna accepted this revision. zaks.anna added a comment. This revision is now accepted and ready to land. Minor nit below. Thanks for iterating so much on this! Anna. Comment at: test/Analysis/number-object-conversion.cpp:46 +#ifdef PEDANTIC + if (p) {} // expected-warnin

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-24 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 75612. NoQ added a comment. Do not suggest any API when we're not sure (was already advised by Anna but i missed it somehow). https://reviews.llvm.org/D25731 Files: lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp test/Analysis/number-object-c

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-24 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 75586. NoQ marked an inline comment as done. NoQ added a comment. - Update warning messages. I think it's better to pattern-match for integer sizes after all when we're suggesting API, this especially looks ugly for OSNumber (which is rare). - Add tests for conv

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-21 Thread Anna Zaks via cfe-commits
zaks.anna added inline comments. Comment at: test/Analysis/number-object-conversion.c:14 + if (p) {} // expected-warning{{Converting 'CFNumberRef' to a plain boolean value for branching; please compare the pointer to NULL instead to suppress this warning}} + if (!p) {} // exp

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-21 Thread Artem Dergachev via cfe-commits
NoQ marked an inline comment as done. NoQ added inline comments. Comment at: lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp:149 BugReporter &BR) const { MatchFinder F; Callback CB(this, BR, AM.getAnalysisD

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-21 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 75411. NoQ marked 5 inline comments as done. NoQ added a comment. Address review comments. Add the forgotten tests. https://reviews.llvm.org/D25731 Files: lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp test/Analysis/number-object-conversion.c

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-20 Thread Anna Zaks via cfe-commits
zaks.anna added inline comments. Comment at: lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp:111 + QualType ObjT = (IsCpp || IsObjC) + ? Obj->getType().getCanonicalType().getUnqualifiedType() + : Obj->getType(); ---

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-20 Thread Alexander Shaposhnikov via cfe-commits
alexshap added inline comments. Comment at: lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp:149 BugReporter &BR) const { MatchFinder F; Callback CB(this, BR, AM.getAnalysisDeclContext(D));

[PATCH] D25731: [analyzer] NumberObjectConversion: Support OSNumber and CFNumberRef.

2016-10-20 Thread Artem Dergachev via cfe-commits
NoQ added a comment. Ouch, i think i forgot about `OSNumber`, including tests. Comment at: lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp:111 + QualType ObjT = (IsCpp || IsObjC) + ? Obj->getType().getCanonicalType().getUnqualifiedType() +