Douglas Gregor
29bd76fd04
Eliminate the three SmallVectors in ObjCImplDecl (for instance
...
methods, class methods, and property implementations) and instead
place all of these entities into the DeclContext.
This eliminates more linear walks when looking for class or instance
methods and should make PCH (de-)serialization of ObjCDecls trivial
(and lazy).
llvm-svn: 69849
2009-04-23 01:02:12 +00:00
Ted Kremenek
63e29cc99c
Add PathDiagnosticRange to PathDiagnostics. These simply wrap SourceRange and
...
indicate whether or not the range represents an absolute range or should be
extended by lexing to the end of the token.
llvm-svn: 69834
2009-04-22 22:26:10 +00:00
Ted Kremenek
48b7875e55
BugReporter (extensive diagnostics): Use correct location for location contexts.
...
llvm-svn: 69824
2009-04-22 20:51:59 +00:00
Ted Kremenek
fb05406cef
BugReporter (extensive diagnostics): always add an edge if there is no location
...
context.
llvm-svn: 69823
2009-04-22 20:36:26 +00:00
Ted Kremenek
6c867a1460
BugReporter (extensive diagnostics):
...
- Remove stale assertion that was breaking the test suite.
- When popping location contexts, only add a control-flow piece for fileID
locations.
llvm-svn: 69814
2009-04-22 18:37:42 +00:00
Ted Kremenek
0752a5dff3
BugReporter (extensive diagnostic algorithm): The initial control-flow edge now
...
starts from the first character of the first statement.
llvm-svn: 69813
2009-04-22 18:16:20 +00:00
Ted Kremenek
22579c4c8f
PathDiagnosticLocation: ranges for terminators now only include the first
...
character instead of the entire range for the IfStmt, ForStmt, etc. We may
gradually refine these ranges later, but basically terminator ranges just refer
to the first keyword.
llvm-svn: 69812
2009-04-22 18:03:00 +00:00
Ted Kremenek
fe95afd0bc
Fix crash reported in PR 3991. The analyzer doesn't reason about ObjCKVCExpr.
...
llvm-svn: 69754
2009-04-21 23:53:32 +00:00
Ted Kremenek
eff7c6a2d6
This patch is largely due to Zhongxing Xu. I've simply applied it because of
...
some refactoring I did recently to StoreManager.
StoreManager::CastRegion: Handle casts to void* by stripping TypedViewRegions.
llvm-svn: 69751
2009-04-21 23:31:46 +00:00
Ted Kremenek
35f875c136
Fix: <rdar://problem/6777209> false Dereference of null pointer in loop: pointer increment/decrement preserves non-nullness
...
When the StoreManager doesn't reason well about pointer-arithmetic, propagate
the non-nullness constraint on a pointer value when performing pointer
arithmetic uisng ++/--.
llvm-svn: 69741
2009-04-21 22:38:05 +00:00
Ted Kremenek
1a1b62c168
Tweak pretty-printing of constraints.
...
llvm-svn: 69740
2009-04-21 22:37:11 +00:00
Ted Kremenek
2d495a6f43
Refactor 'BasicStoreManager::CastRegion' and 'RegionStoreManager::CastRegion'
...
into StoreManager::CastRegion. Both methods were practically identical, and this
is core logic that is common to all StoreManagers since it defines the basic
invariants of the abstract memory model.
llvm-svn: 69730
2009-04-21 21:51:34 +00:00
Ted Kremenek
9bb660c3f4
Recommit 69694 but this time also include the header changes (sorry for breaking
...
the build).
llvm-svn: 69702
2009-04-21 19:56:58 +00:00
Daniel Dunbar
2655f85975
Revert 69694 (use of undefined getSymbol)
...
llvm-svn: 69697
2009-04-21 18:54:52 +00:00
Ted Kremenek
99de8ae19c
Add pretty-printing for CodeTextRegions.
...
llvm-svn: 69694
2009-04-21 18:31:19 +00:00
Ted Kremenek
7421c0161a
Lexically order the implementation of MemRegion 'print' methods. No functionality change.
...
llvm-svn: 69688
2009-04-21 18:09:22 +00:00
Ted Kremenek
30fb341f4f
Use 'getAs<CodeTextRegion>' instead of 'dyn_cast<CodeTextRegion>' to handle any
...
layered regions.
llvm-svn: 69686
2009-04-21 17:37:26 +00:00
Zhongxing Xu
3070210377
Remove loc::FuncVal.
...
llvm-svn: 69577
2009-04-20 06:35:22 +00:00
Zhongxing Xu
ac1294318d
get a CodeTextRegion when visiting FunctionDecl reference.
...
get FunctionDecl with more general utility method.
llvm-svn: 69570
2009-04-20 05:24:46 +00:00
Zhongxing Xu
23e1f45664
As we now have ValueManager as the new value factory, we do not need factory
...
methods of SVal.
llvm-svn: 69565
2009-04-20 02:27:09 +00:00
Douglas Gregor
e3dcb2ddd1
FunctionDecl::getBody() is getting an ASTContext argument for use in
...
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.
llvm-svn: 69406
2009-04-18 00:02:19 +00:00
Ted Kremenek
4531be138c
Add analyzer support for objc_atomicCompareAndSwap()
...
llvm-svn: 68849
2009-04-11 00:54:13 +00:00
Ted Kremenek
df24000d24
Implement analyzer support for OSCompareAndSwap. This required pushing "tagged"
...
ProgramPoints all the way through to GRCoreEngine.
NSString.m now fails with RegionStoreManager because of the void** cast.
Disabling use of region store for that test for now.
llvm-svn: 68845
2009-04-11 00:11:10 +00:00
Ted Kremenek
ffe4ad6795
Move a few more NonLoc static functions to ValueManager.
...
llvm-svn: 68800
2009-04-10 18:11:44 +00:00
Zhongxing Xu
1aced0c9d2
Add prototype for CodeTextRegion.
...
A CodeTextRegion wraps two kinds of data: FunctionDecl* or SymbolRef.
The latter comes from the symbolic function pointer that are generated from
function calls or input data.
llvm-svn: 68777
2009-04-10 08:45:10 +00:00
Zhongxing Xu
dadf250598
Finally nuke loc::SymbolVal.
...
llvm-svn: 68771
2009-04-10 06:06:13 +00:00
Ted Kremenek
5054663daa
Fix: <rdar://problem/6776949> Branch condition evaluates to an uninitialized value (argc is guaranteed to be >= 1)
...
The analyzer now adds the precondition that the first argument of 'main' is > 0.
llvm-svn: 68757
2009-04-10 00:59:50 +00:00
Ted Kremenek
40f4ee74fd
Implement attribute "analyzer_noreturn" (<rdar://problem/6777003>). This allows
...
clients of the analyzer to designate custom assertion routines as "noreturn"
functions from the analyzer's perspective but not the compiler's.
llvm-svn: 68746
2009-04-10 00:01:14 +00:00
Ted Kremenek
f2489ea043
- Move ownership of MemRegionManager into ValueManager.
...
- Pull SVal::GetConjuredSymbol() and friends into ValueManager. This greatly
simplifies the calling interface to clients.
llvm-svn: 68731
2009-04-09 22:22:44 +00:00
Douglas Gregor
bcced4ec31
Propagate the ASTContext to various AST traversal and lookup functions.
...
No functionality change (really).
llvm-svn: 68726
2009-04-09 21:40:53 +00:00
Ted Kremenek
f8cb51c20e
Remove SVal::MakeZero and replace it with ValueManager::makeZeroVal.
...
llvm-svn: 68711
2009-04-09 16:46:55 +00:00
Ted Kremenek
aa4cfc2604
analyzer: Introduce a new class, ValueManager, that serves as an aggregate
...
"manager of symbolic values", wrapping BasicValueFactory, SymbolManager, and
MemRegionManager. While these individual managers nicely separate functionality
in the analyzer, constructing symbolic values can sometimes be cumbersome
because it requires using multiple managers at once. The goal of this class is
to create some factory methods to create SVals that require the use of these
different managers, thus (hopefully) simplifying the analyzer API for clients.
llvm-svn: 68709
2009-04-09 16:13:17 +00:00
Zhongxing Xu
7e9c193398
stop using loc::SymbolVal and clean up code with new API.
...
llvm-svn: 68703
2009-04-09 07:39:46 +00:00
Zhongxing Xu
48abb5d91f
clean up code with new API.
...
llvm-svn: 68701
2009-04-09 07:04:45 +00:00
Zhongxing Xu
783cd82487
clean up code with new API.
...
llvm-svn: 68700
2009-04-09 07:01:16 +00:00
Zhongxing Xu
726876b385
clean up code with new API.
...
llvm-svn: 68699
2009-04-09 06:56:25 +00:00
Zhongxing Xu
2945210d71
clean up code with new API.
...
llvm-svn: 68698
2009-04-09 06:53:24 +00:00
Zhongxing Xu
c48eb32872
stop using loc::SymbolVal.
...
llvm-svn: 68697
2009-04-09 06:49:52 +00:00
Zhongxing Xu
22f72485ed
stop using loc::SymbolVal.
...
llvm-svn: 68696
2009-04-09 06:43:44 +00:00
Zhongxing Xu
0c87a4e79b
stop using loc::SymbolVal.
...
llvm-svn: 68695
2009-04-09 06:41:51 +00:00
Zhongxing Xu
4a8f0cf874
clean up code with new API.
...
llvm-svn: 68694
2009-04-09 06:35:30 +00:00
Zhongxing Xu
b74817f387
clean up code with new API.
...
llvm-svn: 68693
2009-04-09 06:32:20 +00:00
Zhongxing Xu
9410d7ee97
Add a new method because sometimes the type of the conjured symbol is not the
...
type of the expression where we create the symbol.
llvm-svn: 68692
2009-04-09 06:30:17 +00:00
Zhongxing Xu
40934cfa9b
make a conjured symbol as the original code.
...
llvm-svn: 68691
2009-04-09 06:18:05 +00:00
Zhongxing Xu
d3b33ba406
clean up code with new API.
...
llvm-svn: 68687
2009-04-09 06:03:54 +00:00
Ted Kremenek
2f3b0dbff4
Fix a null pointer dereference error due to state caching in a loop involving
...
sending a message to a nil receiver.
llvm-svn: 68686
2009-04-09 06:02:06 +00:00
Zhongxing Xu
cb5d3ced70
Create a symbolic region instead of a loc::SymbolVal. This is a continued step
...
to eliminate the use of loc::SymbolVal.
llvm-svn: 68685
2009-04-09 05:57:11 +00:00
Ted Kremenek
f9f9420303
GRExprEngine: Don't try to reason about the size of 'void' for the return type
...
of messages sent to nil.
llvm-svn: 68683
2009-04-09 05:45:56 +00:00
Ted Kremenek
c3f7c85129
Fix another regression introduced by changes to the analyzer's reasoning about
...
nil receivers in message expressions.
llvm-svn: 68672
2009-04-09 04:06:51 +00:00
Ted Kremenek
d937ed386e
Refactor/cleanup reasoning of nil receivers in message expressions.
...
llvm-svn: 68661
2009-04-09 00:00:02 +00:00