summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Skip Pre/Post handlers for ObjC calls when receiver is nil.Devin Coughlin2015-09-151-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | In Objective-C, method calls with nil receivers are essentially no-ops. They do not fault (although the returned value may be garbage depending on the declared return type and architecture). Programmers are aware of this behavior and will complain about a false alarm when the analyzer diagnoses API violations for method calls when the receiver is known to be nil. Rather than require each individual checker to be aware of this behavior and suppress a warning when the receiver is nil, this commit changes ExprEngineObjC so that VisitObjCMessage skips calling checker pre/post handlers when the receiver is definitely nil. Instead, it adds a new event, ObjCMessageNil, that is only called in that case. The CallAndMessageChecker explicitly cares about this case, so I've changed it to add a callback for ObjCMessageNil and moved the logic in PreObjCMessage that handles nil receivers to the new callback. rdar://problem/18092611 Differential Revision: http://reviews.llvm.org/D12123 llvm-svn: 247653
* [analyzer] Apply whitespace cleanups by Honggyu Kim.Ted Kremenek2015-09-081-6/+6
| | | | llvm-svn: 246978
* Fix comment type pointed out by Kim Gräsman.Duncan Sands2013-05-251-1/+1
| | | | llvm-svn: 182702
* Fix comment typo pointed out by maslen on IRC.Duncan Sands2013-05-241-1/+1
| | | | llvm-svn: 182642
* [analyzer] Document existence of ConstPointerEscape.Anna Zaks2013-03-281-0/+12
| | | | llvm-svn: 178311
* [analyzer] Add pointer escape type param to checkPointerEscape callbackAnna Zaks2013-02-071-1/+3
| | | | | | | | | | | | | | The checkPointerEscape callback previously did not specify how a pointer escaped. This change includes an enum which describes the different ways a pointer may escape. This enum is passed to the checkPointerEscape callback when a pointer escapes. If the escape is due to a function call, the call is passed. This changes previous behavior where the call is passed as NULL if the escape was due to indirectly invalidating the region the pointer referenced. A patch by Branden Archer! llvm-svn: 174677
* [analyzer] Rename callback EndPath -> EndFunctionAnna Zaks2013-01-031-4/+4
| | | | | | | This better reflects when callback is called and what the checkers are relying on. (Both names meant the same pre-IPA.) llvm-svn: 171432
* [analyzer] Address Jordan's nitpicks as per code review of r170625.Anna Zaks2012-12-211-1/+1
| | | | llvm-svn: 170832
* [analyzer] Add the pointer escaped callback.Anna Zaks2012-12-201-1/+20
| | | | | | | | | | Instead of using several callbacks to identify the pointer escape event, checkers now can register for the checkPointerEscape. Converted the Malloc checker to use the new callback. SimpleStreamChecker will be converted next. llvm-svn: 170625
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+1
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* [analyzer] Enhance docs for checker callbacks (esp. processRegionChanges).Jordan Rose2012-11-071-13/+28
| | | | | | No functionality change; this checker is only used for documentation. llvm-svn: 167522
* [analyzer] CheckerDocumentation: Change examples for PreStmt and PostStmt.Jordan Rose2012-11-021-9/+9
| | | | llvm-svn: 167339
* [analyzer] Combine all ObjC message CallEvents into ObjCMethodCall.Jordan Rose2012-07-181-2/+1
| | | | | | | | | | | | As pointed out by Anna, we only differentiate between explicit message sends This also adds support for ObjCSubscriptExprs, which are basically the same as properties in many ways. We were already checking these, but not emitting nice messages for them. This depends on the llvm::PointerIntPair change in r160456. llvm-svn: 160461
* [analyzer] Add generic preCall and postCall checks.Jordan Rose2012-07-021-3/+33
| | | | llvm-svn: 159562
* [analyzer] Finish replacing ObjCMessage with ObjCMethodDecl and friends.Jordan Rose2012-07-021-2/+2
| | | | | | | | The preObjCMessage and postObjCMessage callbacks now take an ObjCMethodCall argument, which can represent an explicit message send (ObjCMessageSend) or an implicit message generated by a property access (ObjCPropertyAccess). llvm-svn: 159559
* [analyzer] Add a new abstraction over all types of calls: CallEventJordan Rose2012-07-021-1/+1
| | | | | | | | | | This is intended to replace CallOrObjCMessage, and is eventually intended to be used for anything that cares more about /what/ is being called than /how/ it's being called. For example, inlining destructors should be the same as inlining blocks, and checking __attribute__((nonnull)) should apply to the allocator calls generated by operator new. llvm-svn: 159554
* Documentation cleanup:James Dennett2012-06-151-10/+12
| | | | | | | | | * Add \brief to produce a summary in the Doxygen output; * Add missing parameter names to \param commands; * Fix mismatched parameter names for \param commands; * Add a parameter name so that the \param has a target. llvm-svn: 158503
* corrected check::EndOfTranslationUnit checker name and added 'const' to ↵Anton Yartsev2012-03-231-3/+3
| | | | | | declaration llvm-svn: 153302
* [analyzer] Make Malloc Checker optimistic in presence of inlining.Anna Zaks2012-02-141-2/+16
| | | | | | | | | | | | (In response of Ted's review of r150112.) This moves the logic which checked if a symbol escapes through a parameter to invalidateRegionCallback (instead of post CallExpr visit.) To accommodate the change, added a CallOrObjCMessage parameter to checkRegionChanges callback. llvm-svn: 150513
* Change references to 'const ProgramState *' to typedef 'ProgramStateRef'.Ted Kremenek2012-01-261-5/+5
| | | | | | | | At this point this is largely cosmetic, but it opens the door to replace ProgramStateRef with a smart pointer that more eagerly acts in the role of reclaiming unused ProgramState objects. llvm-svn: 149081
* [analyzer] Add checker callback documentation.Anna Zaks2011-11-301-0/+219
llvm-svn: 145495
OpenPOWER on IntegriCloud