Граф коммитов

308 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek af9dc27b1c More summary generation refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54696 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 18:48:50 +00:00
Ted Kremenek 9e476ded1d Add variadic addInstMethSummary() and refactored addPanicSummary() to use this method. (code reduction).
Misc. cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54694 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 18:30:56 +00:00
Daniel Dunbar c4a1dea2dc More #include cleaning
- Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h
 - Moved Sema::getCurMethodDecl() out of line (dependent on
   ObjCMethodDecl via dyn_cast).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54629 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 05:35:13 +00:00
Nico Weber 7bfaaaecb3 * Remove isInSystemHeader() from DiagClient, move it to SourceManager
* Move FormatError() from TextDiagnostic up to DiagClient, remove now  
  empty class TextDiagnostic
* Make DiagClient optional for Diagnostic

This fixes the following problems:

* -html-diags (and probably others) does now output the same set of  
  warnings as console clang does
* nothing crashes if one forgets to call setHeaderSearch() on  
  TextDiagnostic
* some code duplication is removed




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54620 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 19:59:06 +00:00
Chris Lattner d9f6910f4e rename PreDefinedExpr -> PredefinedExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54605 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 01:53:14 +00:00
Ted Kremenek 23f7823b3c Added FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54568 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 00:41:45 +00:00
Ted Kremenek e12691c2a2 Don't use Expr::isIntegerConstantExpr just to check if a pointer value is initialize to NULL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54563 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 00:05:14 +00:00
Ted Kremenek 2619be072c Added AssumeSymGT, AssumeSymGE, AssumeSymLT, AssumeSymLE to add some minor improvements to path-sensitivity. Right now we basically treat 'x > y' and 'x < y' as implying 'x != y', but this restriction will only inevitably apply to our must rudimentary value tracking component (we'll implement more advanced value reasoning later).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54493 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 22:30:22 +00:00
Ted Kremenek b238c3e81e Don't flag any dead stores for variables marked unused.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54492 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 22:28:30 +00:00
Ted Kremenek 14f8b4ff66 Added decl_iterator to DeclStmt to provide an abstract interface to iterate over the ScopedDecls of a DeclStmt.
Updated a few clients of DeclStmt::getNextDeclarator() to use decl_iterator instead.  Will update other clients after additional testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54368 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 20:46:55 +00:00
Ted Kremenek 48d5faf306 Change 'dead store (++/--)' to 'dead increment'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54268 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-02 18:19:48 +00:00
Ted Kremenek 22bda887aa Enhanced path-sensitive return-of-stack-address check to print out the name of the variable whose address was returned.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54253 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-31 20:31:27 +00:00
Ted Kremenek b7714b291b Add range highlighting for path-sensitive return-of-stack-address check.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54219 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-30 17:49:12 +00:00
Chris Lattner 8b51fd7631 remove some unneeded calls to getCanonicalType
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54106 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26 22:36:27 +00:00
Chris Lattner b77792eabf change more instances of QualType::getCanonicalType to call
ASTContext::getCanonicalType instead (PR2189)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54105 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26 22:17:49 +00:00
Ted Kremenek 694eefb745 Have the UnusedIvar check skip ivars with setters/getters created by @synthesize.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54050 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 20:28:02 +00:00
Ted Kremenek a95acd672d Remove call to isSEL and isSEL itself since the call is dead (isObjCObjectPointerType() will never return true for selectors).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54034 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 18:17:35 +00:00
Ted Kremenek 684b9d2d15 Only warn about missing/incomplete -dealloc implementations when a class contains a non-SEL, non-IBOutlet ivar that references an ObjC object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54024 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 17:04:49 +00:00
Ted Kremenek fc7ff55404 Don't emit 'dead initialization' warnings for variables marked 'unused'.
This fixes PR 2573: http://llvm.org/bugs/show_bug.cgi?id=2573


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54009 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 04:47:34 +00:00
Ted Kremenek ec455e0564 Use ASTContext::isObjCObjectPointerType() to check if an ivar is a reference to an Objective-C object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53999 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-24 23:59:07 +00:00
Ted Kremenek 17a61db7da Correctly handle NSAssertionHandle -handleFailureInMethod:object:file:lineNumber:description:
This fixes: http://llvm.org/bugs/show_bug.cgi?id=2593


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53993 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-24 18:47:16 +00:00
Ted Kremenek f071e18373 Don't issue a missing +dealloc warning for classes that just contain SEL ivars.
This fixes PR 2592: http://llvm.org/bugs/show_bug.cgi?id=2592


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53987 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-24 17:45:56 +00:00
Ted Kremenek b0f36323d9 Issue dead store warnings for preincrements involved in a subexpression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53983 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-24 17:01:17 +00:00
Ted Kremenek 1c61b472b2 Don't flag dead stores when the result of a preincrement/predecrement is used in an enclosing expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53964 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-23 22:19:56 +00:00
Ted Kremenek 2cfac226b0 Further refine dead store checking to distinguish between dead stores and dead increments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53960 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-23 21:16:38 +00:00
Ted Kremenek cc87ba2b95 Properly skip IBOutlets when checking for unused ivars.
Refine the error message of unused ivars.
Added test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53957 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-23 18:21:36 +00:00
Ted Kremenek 6678f7f8a3 Ivar access mode ObjCIvarDecl::None == ObjCIvarDecl::Protected, not private.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53953 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-23 17:14:39 +00:00
Ted Kremenek 395aaf20d6 Add prototype implementation of unused ivar check.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53942 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-23 00:45:26 +00:00
Ted Kremenek 78d46242e3 Moved registration of basic path-sensitive checks from GRSimpleVals.cpp to GRExprEngineInternalChecks.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53909 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-22 16:21:24 +00:00
Ted Kremenek e3ae82accd Rename file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53906 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-22 14:41:47 +00:00
Ted Kremenek 584def7364 Added path-sensitive checking for null pointer values passed to function arguments marked nonnull.
This implements <rdar://problem/6069935>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-22 00:46:16 +00:00
Ted Kremenek 1a80448f6f "currentHandler" is a nullary selector
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53763 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 18:14:26 +00:00
Ted Kremenek 2d1086cec0 Fix caching bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53759 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 17:39:56 +00:00
Ted Kremenek 70a733e64e Add panic support for NSAssertionHandler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53758 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 17:24:20 +00:00
Ted Kremenek 7386d77217 Add panic function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53755 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 16:28:33 +00:00
Ted Kremenek 75b0a1ce3e Fix 80 col violation
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53754 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 15:59:33 +00:00
Ted Kremenek 40fc5c7e23 Fix regression by explicitly checking if we are negating a SymIntConstantVal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53753 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 15:54:51 +00:00
Ted Kremenek 1e38f85dc0 Improve path-sensitivity when using the logical not operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53752 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 15:46:06 +00:00
Ted Kremenek ad8329e58d Renamed deterministic EvalBinOp to DetermEvalBinOpNN. This name mangling is unfortunately needed because virtual methods with the same name can be hidden by subclasses.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53751 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 15:27:58 +00:00
Ted Kremenek 6297a8ec31 Created ValueStateSet class to manage the creation of multiple states by a method.
Modified the new EvalBinOpNN to generate states instead of nodes.  This is a much simpler interface and is what clients will want to do.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53750 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 05:53:58 +00:00
Ted Kremenek 35912db2b1 Update signature of EvalAssume.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53745 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-17 23:33:10 +00:00
Ted Kremenek 729a9a276f Move GRTransferFunc* into ValueStateManager, and move the assumption logic there as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53743 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-17 23:15:45 +00:00
Ted Kremenek b48c6455dd Remove redundant logic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53740 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-17 21:36:43 +00:00
Ted Kremenek df7533b5e5 Begin major changes to EvalXXX methods in GRTransferFuncs. Currently some of the methods only return an RVal; we want them to be able to create an arbitrary number of states.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53739 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-17 21:27:31 +00:00
Ted Kremenek f59bf48ee7 Moved RemoveDeadBindings logic for the contents of 'Store' to a virtual RemoveDeadBindings method in StoreManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53726 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-17 18:38:48 +00:00
Ted Kremenek cd512dce55 Fix regression introduced by http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080714/006514.html.
The regression was the casts from integers to pointers where not being handled: they would just return UnknownVal.  This would greatly decrease path-sensitivity.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-16 00:23:49 +00:00
Ted Kremenek f496ee1710 Fix transfer function logic in GRSimpleVals for integer casts: only support casts from integers to integers.
This fixes a crash reported by Anders Carlsson!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53649 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-15 23:17:54 +00:00
Ted Kremenek f4ebf42b06 For the MissingDealloc check, don't treat IBOutlet ivars as being needed to be released
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53647 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-15 23:04:27 +00:00
Ted Kremenek f9c2a5d1b4 Distinguish between dead stores and dead initializations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53628 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-15 18:06:32 +00:00
Ted Kremenek 10161bfe1a isRetain() and isRelease() now only returns true if "Retain"/"Release" appears in the suffix of a function's name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53621 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-15 17:43:41 +00:00