[PATCH] D42745: [analyzer] Add support for __builtin_constant_p to BuiltinFunctionChecker

2018-02-09 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL324789: [analyzer] Add support for __builtin_constant_p. (authored by dergachev, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D42745?vs=1334

[PATCH] D42745: [analyzer] Add support for __builtin_constant_p to BuiltinFunctionChecker

2018-02-09 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC324789: [analyzer] Add support for __builtin_constant_p. (authored by dergachev, committed by ). Repository: rC Clang https://reviews.llvm.org/D42745 Files: lib/StaticAnalyzer/Checkers/BuiltinFuncti

[PATCH] D42745: [analyzer] Add support for __builtin_constant_p to BuiltinFunctionChecker

2018-02-09 Thread Felix Kostenzer via Phabricator via cfe-commits
sp4r74n-117 added a comment. I do not have commit access so it would be great if you could do it for me. Thanks. https://reviews.llvm.org/D42745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/

[PATCH] D42745: [analyzer] Add support for __builtin_constant_p to BuiltinFunctionChecker

2018-02-08 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Do you have commit access, or do you want me to commit this for you? https://reviews.llvm.org/D42745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42745: [analyzer] Add support for __builtin_constant_p to BuiltinFunctionChecker

2018-02-08 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. Tests look good. You can't test deadcode :) https://reviews.llvm.org/D42745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.o

[PATCH] D42745: [analyzer] Add support for __builtin_constant_p to BuiltinFunctionChecker

2018-02-08 Thread Felix Kostenzer via Phabricator via cfe-commits
sp4r74n-117 updated this revision to Diff 133447. sp4r74n-117 added a comment. Thanks for the explanation, seems like I was on the wrong track. I now do realize that my initial approach was in fact duplicating the logic of 'BI__builtin_object_size'. I've removed most of the changes applied to the

[PATCH] D42745: [analyzer] Add support for __builtin_constant_p to BuiltinFunctionChecker

2018-02-05 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Oh, i see what you did here. I thought you're evaluating the argument, but you're evaluating the whole builtin function call. In this case you don't need the else-branch: `EvaluateAsInt` will always succeed. Moreover, you can merge your code with the `BI__builtin_object_siz

[PATCH] D42745: [analyzer] Add support for __builtin_constant_p to BuiltinFunctionChecker

2018-02-03 Thread Felix Kostenzer via Phabricator via cfe-commits
sp4r74n-117 updated this revision to Diff 132738. sp4r74n-117 added a comment. Thanks for the feedback. I've added two additional tests to 'test_constant_p' for the case where an expression evaluating to a constant 0 is passed to the builtin. The existing tests have been refactored to check expli

[PATCH] D42745: [analyzer] Add support for __builtin_constant_p to BuiltinFunctionChecker

2018-01-31 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Nice, thanks! Comment at: lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp:126 + SVB.getBasicValueFactory().getAPSIntType(CE->getType()).apply(Result); + V = SVB.makeIntVal(Result); +} https://gcc.gnu.org/onlinedocs/gcc/

[PATCH] D42745: [analyzer] Add support for __builtin_constant_p to BuiltinFunctionChecker

2018-01-31 Thread Felix Kostenzer via Phabricator via cfe-commits
sp4r74n-117 created this revision. sp4r74n-117 added reviewers: george.karpenkov, dcoughlin, dergachev.a. sp4r74n-117 created this object with visibility "All Users". Herald added subscribers: cfe-commits, a.sidorin, szepet, xazax.hun. Added evaluation of __builtin_constant_p to the dedicated Stat

Re: [analyzer] Add support for __builtin_constant_p to BuiltinFunctionChecker

2018-01-24 Thread George Karpenkov via cfe-commits
Hi Felix, If you would like to get the patch reviewed and committed the best way is to create a review in phabricator (http://reviews.llvm.org) and add Devin Coughlin, me, and Artem Dergachev as reviewers. > On Jan 16, 2018, at 7:30 PM, Vedant Kumar wrote: > > + Devin and George > >> On Jan

Re: [analyzer] Add support for __builtin_constant_p to BuiltinFunctionChecker

2018-01-16 Thread Vedant Kumar via cfe-commits
+ Devin and George > On Jan 14, 2018, at 10:44 AM, Felix Kostenzer via cfe-commits > wrote: > > > Hi, > > Added evaluation of __builtin_constant_p to the dedicated StaticAnalyzer > checker > along with a regression test. > > 'make clang-test' results: > > Testing Time: 335.63s > Expected

[analyzer] Add support for __builtin_constant_p to BuiltinFunctionChecker

2018-01-15 Thread Felix Kostenzer via cfe-commits
Hi, Added evaluation of __builtin_constant_p to the dedicated StaticAnalyzer checker along with a regression test. 'make clang-test' results: Testing Time: 335.63s Expected Passes : 11769 Expected Failures : 19 Unsupported Tests : 50 - felixIndex: lib/StaticAnalyzer/Checkers/BuiltinFunct