Anna Zaks
0ec04bf738
[analyzer] Move enqueueEndOfFunction into CoreEngine.
...
llvm-svn: 143090
2011-10-27 00:59:28 +00:00
Anna Zaks
b1d3d96872
[analyzer] Make CoreEngine responsible for enqueueing Stmt Nodes.
...
Enqueue the nodes generated as the result of processing a statement
inside the Core Engine. This makes sure ExpEngine does not access
CoreEngine's private members and is more concise.
llvm-svn: 143089
2011-10-27 00:59:23 +00:00
Anna Zaks
b31d0143dd
[analyzer] GenericNodeBuilder -> NodeBuilder.
...
Remove GenericNodeBuilder and use a class inherited from NodeBuilder instead.
llvm-svn: 143057
2011-10-26 21:06:22 +00:00
Anna Zaks
b473816b4a
[analyzer] Simplify CheckerContext
...
Remove dead members/parameters: ProgramState, respondsToCallback, autoTransition.
Remove addTransition method since it's the same as generateNode. Maybe we should
rename generateNode to genTransition (since a transition is always automatically
generated)?
llvm-svn: 142946
2011-10-25 19:57:06 +00:00
Anna Zaks
513921dc8a
[analyzer] Remove unused headers.
...
llvm-svn: 142945
2011-10-25 19:56:58 +00:00
Anna Zaks
f380534a1a
[analyzer] Make branch for condition callback use CheckerContext
...
Now, all the path sensitive checkers use CheckerContext!
llvm-svn: 142944
2011-10-25 19:56:54 +00:00
Anna Zaks
3eae33412d
[analyze] Convert EndOfPath callback to use CheckerContext
...
Get rid of the EndOfPathBuilder completely.
Use the generic NodeBuilder to generate nodes.
Enqueue the end of path frontier explicitly.
llvm-svn: 142943
2011-10-25 19:56:48 +00:00
Douglas Gregor
deb4a2be67
Implement support for dependent Microsoft __if_exists/__if_not_exists
...
statements. As noted in the documentation for the AST node, the
semantics of __if_exists/__if_not_exists are somewhat different from
the way Visual C++ implements them, because our parsed-template
representation can't accommodate VC++ semantics without serious
contortions. Hopefully this implementation is "good enough".
llvm-svn: 142901
2011-10-25 01:33:02 +00:00
Anna Zaks
e4e5712cd7
[analyzer] Node builders cleanup + comments
...
Renamed PureNodeBuilder->StmtNodeBuilder.
llvm-svn: 142849
2011-10-24 21:19:59 +00:00
Anna Zaks
2338c15efe
[analyzer] Remove the old StmtNodeBuilder.
...
llvm-svn: 142848
2011-10-24 21:19:53 +00:00
Anna Zaks
4c9169254f
[analyzer] Completely remove the global Builder object.
...
llvm-svn: 142847
2011-10-24 21:19:48 +00:00
Anna Zaks
7b8a2609ff
[analyzer] Remove more dependencies from global Builder
...
- OSAtomicChecker
- ExprEngine::processStmt
llvm-svn: 142846
2011-10-24 21:19:43 +00:00
Anna Zaks
e594034f1f
[analyzer] Convert ExprEngine::visit() to use short lived builders.
...
This commit removes the major functional dependency on the ExprEngine::Builder
member variable.
In some cases the code became more verbose. Particularly, we call takeNodes()
and addNodes() to move responsibility for the nodes from one builder to another.
This will get simplified later on.
llvm-svn: 142831
2011-10-24 18:26:19 +00:00
Anna Zaks
5236792019
[analyzer] Convert VisitDeclStmt to use local node builder.
...
llvm-svn: 142830
2011-10-24 18:26:12 +00:00
Anna Zaks
cbdf10be19
[analyzer] Convert more functions (ex:evalBind()) to iterative builders
...
llvm-svn: 142829
2011-10-24 18:26:08 +00:00
Anna Zaks
f011a4a6f9
[analyzer] Convert VisitUnaryOperator to use short lived Node builders
...
To convert iteratively, we take the nodes the local builder will
process from the from the global builder and add the generated nodes
after the short lived builder is done. PureStmtNodeBuilder is the
one we should eventually use everywhere. Added Stmt index and Builder
context as ExprEngine globals. To avoid passing them around.
llvm-svn: 142828
2011-10-24 18:26:03 +00:00
Anna Zaks
0bb9d1b917
[analyzer] Use a temporary builder in CheckerContext.
...
First step toward removing the global Stmt builder. Added several transitional methods (like takeNodes/addNodes).
+ Stop early if the set of exploded nodes for the next iteration is empty.
llvm-svn: 142827
2011-10-24 18:25:58 +00:00
Anna Zaks
7fec527d16
[analyzer] Pass external Dst set to NodeBuilder
...
This moves the responsibility for storing the output node set from the
builder to the clients. The builder is just responsible for transforming
an input set into the output set: {SrcSet/SrcNode} -> {Frontier}.
llvm-svn: 142826
2011-10-24 18:25:53 +00:00
Ted Kremenek
81ce1c8a99
Rename AnalysisContext to AnalysisDeclContext. Not only is this name more accurate, but it frees up the name AnalysisContext for other uses.
...
llvm-svn: 142782
2011-10-24 01:32:45 +00:00
Ted Kremenek
142adc492b
[analyzer] Remove LocationContext creation methods from AnalysisManager, and change clients to use AnalysisContext instead.
...
WIP to remove/reduce ExprEngine's usage of AnalysisManager.
llvm-svn: 142739
2011-10-23 02:31:52 +00:00
Anna Zaks
d009bfac0c
[analyzer] Move predecessor into the NodeBuilder context.
...
llvm-svn: 142454
2011-10-18 23:06:48 +00:00
Anna Zaks
a99b41f37f
[analyzer] Make NodeBuilder and Pred node loosely coupled
...
NodeBuilder should not assume it's dealing with a single predecessor. Remove predecessor getters. Modify the BranchNodeBuilder to not be responsible for doing auto-transitions (which depend on a predecessor).
llvm-svn: 142453
2011-10-18 23:06:44 +00:00
Anna Zaks
1dd965eaa5
[analyzer] Remove StmtNodeBuilder from CheckerContext
...
It now only depends on a generic NodeBuilder instead. As part of this change, make the generic node builder results finalized by default.
llvm-svn: 142452
2011-10-18 23:06:38 +00:00
Anna Zaks
88d9462b73
[analyzer] Subclassing StmtBuilder from the NodeBuilder
...
llvm-svn: 142451
2011-10-18 23:06:33 +00:00
Anna Zaks
e83ddcc4ec
[analyzer] Remove dead code.
...
ExprEngineBuilders is not used.
llvm-svn: 142450
2011-10-18 23:06:29 +00:00
Anna Zaks
6d285c58ec
[analyzer] Modularize builder use in processBranch.
...
Take advantage of the new builders for branch processing. As part of this change pass generic NodeBuilder (instead of BranchNodeBuilder) to the BranchCondition callback and remove the unused methods form BranchBuilder.
llvm-svn: 142448
2011-10-18 23:06:21 +00:00
Anna Zaks
eebbbc7253
[analyzer] Pull Pred out of NodeBuilderContext.
...
Each builder will have a different one, so it doesn't make sense to keep it in the context.
llvm-svn: 142447
2011-10-18 23:06:16 +00:00
Anna Zaks
ce5e97efdd
[analyzer] NodeBuilder Refactoring: Subclass BranchNodeBuilder from NodeBuilder.
...
llvm-svn: 142444
2011-10-18 23:06:04 +00:00
Anna Zaks
fc0189aadc
[analyzer] Node Builder refactoring: Introduce a simple Node Builder responsible for generating the node frontier.
...
Currently we have a bunch of different node builders which provide some common
functionality but are difficult to refactor. Each builder generates nodes of
different kinds and calculates the frontier nodes, which should be propagated
to the next step (after the builder dies).
Introduce a new NodeBuilder which provides very basic node generation facilities
but takes care of the second problem. The idea is that all the other builders
will eventually use it. Use this builder in CheckerContext instead of
StmtNodeBuilder (the way the frontier is propagated to the StmtBuilder
is a hack and will be removed later on).
llvm-svn: 142443
2011-10-18 23:05:58 +00:00
Richard Smith
faa32a9b83
Refactor static analyzer to use simpler interface to constant expression evaluation.
...
llvm-svn: 141983
2011-10-14 20:22:00 +00:00
Benjamin Kramer
b89514a9b8
Change operator<< for raw_ostream and NamedDecl to take a reference instead of a pointer.
...
Passing a pointer was a bad idea as it collides with the overload for void*.
llvm-svn: 141971
2011-10-14 18:45:37 +00:00
Anna Zaks
fc2b79029c
[analyzer] Remove an unused member variable.
...
llvm-svn: 141690
2011-10-11 18:19:20 +00:00
Anna Zaks
8c57c4ba27
[analyzer] CheckerContext updates checkDst in it's destructor, so make sure the object is destructed before checkDst is used.
...
llvm-svn: 141683
2011-10-11 17:29:59 +00:00
Eli Friedman
df14b3a837
Initial implementation of __atomic_* (everything except __atomic_is_lock_free).
...
llvm-svn: 141632
2011-10-11 02:20:01 +00:00
Ted Kremenek
8f34b6999c
[analyzer] Teach the static analyzer about CXXForRangeStmt. Patch by Jim Goodnow II!
...
llvm-svn: 141587
2011-10-10 22:36:31 +00:00
Richard Smith
caf3390d44
Constant expression evaluation refactoring:
...
- Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions,
and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert
behaviour.
- Factor out evaluation of bitfield bit widths.
- Fix a few places which would evaluate an expression twice: once to determine
whether it is a constant expression, then again to get the value.
llvm-svn: 141561
2011-10-10 18:28:20 +00:00
Ted Kremenek
d79719b144
Provide basic static analyzer support for CXXTemporaryObjectExpr. Patch by Jim Goodnow II.
...
llvm-svn: 141433
2011-10-07 22:48:13 +00:00
Ted Kremenek
dccc2b2277
Remove AnalysisContext::getLiveVariables(), and introduce a templatized mechanism to lazily create analyses that are attached to AnalysisContext objects.
...
llvm-svn: 141425
2011-10-07 22:21:02 +00:00
Anna Zaks
754eafb765
[analyzer] Previously, we were passing to CheckerContext enough info to construct ProgramPoint and it would pass it to NodeBuilder, which in turn would construct the ProgramPoint. Simplify it by just passing the ProgramPoint to CheckerContext. The ProgramPoint can only change if a checker tags it, in which case, we create a copy with the given tag.
...
(A step closer to making CheckerContext work with all node builders, not only StmtNodeBuilder.)
llvm-svn: 141417
2011-10-07 21:52:33 +00:00
Anna Zaks
8de8cfdd21
ProgramPoint cleanup after the previous commit r141408 (remove the copy constructor, mark withTag const).
...
Move getProgramPoint() utility from CoreEngine.cpp into ProgramPoint.
llvm-svn: 141414
2011-10-07 21:01:38 +00:00
John McCall
f937c023bf
Rename TagDecl::isDefinition -> isCompleteDefinition
...
for better self-documenting code, since the semantics
are subtly different from getDefinition().
llvm-svn: 141355
2011-10-07 06:10:15 +00:00
Ted Kremenek
b7531d622d
[static analyzer] Fix crash in LiveVariables and Environment::getSVal() when analyzing C++ pointer-to-member calls. Fixes <rdar://problem/10243398>.
...
llvm-svn: 141312
2011-10-06 20:53:28 +00:00
Anna Zaks
3e0f415d0d
[analyzer] Remove the dependency on CheckerContext::getStmt() as well as the method itself.
...
llvm-svn: 141262
2011-10-06 00:43:15 +00:00
Anna Zaks
77f8661d18
[analyzer] OSAtomicChecker implements evalCall in a very invasive way - it essentially simulates inlining of compareAndSwap() by means of setting the NodeBuilder flags and calling ExprEngine directly.
...
This commit introduces a new callback just for this checker to unblock checker API cleanup.
llvm-svn: 141246
2011-10-05 23:37:30 +00:00
Ted Kremenek
2a14c695eb
Fix LiveVariables analysis bug with MaterializeTemporaryExpr and fix handling in ExprEngine. Fixes <rdar://problem/10201666>.
...
llvm-svn: 140956
2011-10-02 00:54:48 +00:00
Anna Zaks
79ada929b7
Address PR10616. The crash has already been fixed by Ted in r140725, so just refactor to use existing API + test case.
...
llvm-svn: 140932
2011-10-01 06:35:19 +00:00
Ted Kremenek
afedc07a9b
Fix crash when analyzing C++ code involving constant enums and switch statements (<rdar://problem/10202899>).
...
llvm-svn: 140844
2011-09-30 03:51:54 +00:00
Anna Zaks
8d4c8e1498
[analyzer] Add -analyzer-purge option which can take on multiple values, remove -analyzer-purge=none. (Small refactor as well: move the work of constructing AnalysisManager from the callers to the class itself.)
...
llvm-svn: 140838
2011-09-30 02:03:00 +00:00
Ted Kremenek
252e03596a
Check for empty predecessors for walking them.
...
llvm-svn: 140725
2011-09-28 21:20:00 +00:00
David Blaikie
0cc494361c
Renaming PathDiagnosticClients.h to PathDiagnosticConsumers.h (issue 5397)
...
llvm-svn: 140596
2011-09-27 01:43:33 +00:00
David Blaikie
53c125d063
Rename PathDiagnosticClient to PathDiagnosticConsumer as per issue 5397
...
llvm-svn: 140492
2011-09-26 00:51:36 +00:00
David Blaikie
9c902b5502
Rename Diagnostic to DiagnosticsEngine as per issue 5397
...
llvm-svn: 140478
2011-09-25 23:23:43 +00:00
David Blaikie
aa347f9392
Removing a bunch of dead returns/breaks after llvm_unreachables.
...
llvm-svn: 140407
2011-09-23 20:26:49 +00:00
Anna Zaks
ff7da05670
Move immutable map canonization out of the removeDeadBindings loop (via using ImmutableMapRef). Gives ~2% speedup.
...
llvm-svn: 140403
2011-09-23 19:14:09 +00:00
David Blaikie
83d382b1ca
Switch assert(0/false) llvm_unreachable.
...
llvm-svn: 140367
2011-09-23 05:06:16 +00:00
Anna Zaks
9db35a8750
ST->scanReachableSymbols() is creating a SubRegionMap (SRM) on every call since one SRM is created in each ScanReachableSymbols instance. Creating the object just once and calling only scan inside the loop gives ~ 14% speed up of the StaticAnalyzer run (Release+Asserts).
...
Pull out the declaration of the ScanReachableSymbols so that it can be used directly. Document ProgramState::scanReachableSymbols() methods.
llvm-svn: 140323
2011-09-22 18:10:41 +00:00
Anna Zaks
15ca5e7a21
[analyzer] Fix a bug where PathDiagnosticLocation did not generate a valid range and add asserts to check validity of locations early on. Ignore invalid ranges in PathDiagnosticPiece (they could be added by checker writers).
...
Addresses radar://10124836 and radar://radar10102244.
llvm-svn: 140218
2011-09-21 00:35:58 +00:00
Anna Zaks
d70da08160
[analyzer] Refactor PathDiagnosticLocation: Remove SourceRange member from PathDiagnosticLocation - FullSourceLoc Loc and PathDiagnosticRange Range are sufficient.
...
llvm-svn: 140206
2011-09-20 23:27:32 +00:00
Anna Zaks
6800ab437c
[analyzer] Remove dead code. (This code is trying to implement the idea that PathDiagnosticClient could implement DiagnosticClient and has been dead for a while).
...
llvm-svn: 140198
2011-09-20 22:30:48 +00:00
Anna Zaks
c29bed3989
[analyzer] Refactor PathDiagnosticLocation: Make PathDiagnosticLocation(SourceLocation...) private. Most of the effort here goes to making BugReport refer to a PathDiagnosticLocation instead of FullSourceLocation.
...
(Another step closer to the goal of having Diagnostics which can recover from invalid SourceLocations.)
llvm-svn: 140182
2011-09-20 21:38:35 +00:00
Anna Zaks
b2dfc2b7be
[analyzer] Refactor PathDiagnosticLocation: Use the pre-computed Range and Location for profile.
...
llvm-svn: 140180
2011-09-20 21:25:00 +00:00
Anna Zaks
83128bc101
[analyzer] Refactor PathDiagnosticLocation: Use PointerUnion of LocationContext and AnalysisContext to support creation of PathDiagnosticLocations for checkers which no context sensitivity.
...
llvm-svn: 140162
2011-09-20 18:23:52 +00:00
Anna Zaks
de03d72a7b
[analyzer] Refactor PathDiagnosticLocation: Lazily query LocationContext for a ParentMap as needed.
...
llvm-svn: 140147
2011-09-20 16:37:36 +00:00
Anna Zaks
22fec1c4d9
[analyzer] Remove LocationContext and a dependency from PathDiagnosticLoaction.
...
llvm-svn: 140146
2011-09-20 16:23:37 +00:00
Anna Zaks
745486a5da
[analyzer] Refactor PathDiagnosticLocation: Pre-compute Range and Location with gen methods on object creation instead of computing on demand. This would allow to remove dependency on the other members which help with construction and might not even be valid at later stages (to be removed later on).
...
llvm-svn: 140131
2011-09-20 01:51:40 +00:00
Anna Zaks
de8c5eddb9
[analyzer] Use more create methods in the PathDiagnostic, cleanup.
...
llvm-svn: 140130
2011-09-20 01:38:47 +00:00
Anna Zaks
6e76384c82
[analyzer] BugReport has a profile method, so reuse it here.
...
llvm-svn: 140100
2011-09-19 23:44:31 +00:00
Argyrios Kyrtzidis
e6e67deeed
Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.
...
It already works (and is useful with) macro locs as well.
llvm-svn: 140057
2011-09-19 20:40:19 +00:00
Anna Zaks
efd182d992
[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of SourceLocations (commit 5 of ?):
...
- Get rid of PathDiagnosticLocation(SourceRange r,..) constructor by providing a bunch of create methods.
- The PathDiagnosticLocation(SourceLocation L,..), which is used by crate methods, will eventually become private.
- Test difference is in the case when the report starts at the beginning of the function. We used to represent that point as a range of the very first token in the first statement. Now, it's just a single location representing the first character of the first statement.
llvm-svn: 139932
2011-09-16 19:18:30 +00:00
Anna Zaks
207c68012a
[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of SourceLocations (commit 4 of ?):
...
- The closing brace is always a single location, not a range.
- The test case previously had a location key 57:1 followed by a range [57:1 - 57:1].
llvm-svn: 139832
2011-09-15 20:06:34 +00:00
Anna Zaks
921f04924f
[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of SourceLocations (commit 2 of ?):
...
- Fix a fixme and move the logic of creating a PathDiagnosticLocation corresponding to a ProgramPoint into a PathDiagnosticLocation constructor.
- Rename PathDiagnosticLocation::create to differentiate from the added constructor.
llvm-svn: 139825
2011-09-15 18:56:07 +00:00
Anna Zaks
3a769bd996
[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of SourceLocations (commit 2 of ?):
...
- Modify all PathDiagnosticLocation constructors that take Stmt to also requre LocationContext.
- Add a constructor which should be used in case there is no valid statement/location (it will grab the location of the enclosing function).
llvm-svn: 139763
2011-09-15 01:08:34 +00:00
Anna Zaks
615e3a69c3
[analyzer] After CFG has been linearized, we can have a situation where an ExpoledNode has an invalid SourceLocation (which has no correspondence in the source code). This commit is the first step to solve this problem.
...
- It adds LocationContext to the PathDiagnosticLocation object and uses it to lookup the enclosing statement with a valid location.
- So far, the LocationContext is only available when the object is constructed from the ExplodedNode.
- Already found some subtle bugs(in plist-output-alternate.m) where the intermediate diagnostic steps were not previously shown.
llvm-svn: 139703
2011-09-14 17:48:01 +00:00
Anna Zaks
2c65eea947
[analyzer] Refactor: Make PathDiagnosticLocation responsible for creating a valid object given an ExploadedNode (the same logic can be reused by other checkers).
...
llvm-svn: 139672
2011-09-14 00:25:17 +00:00
Anna Zaks
79301b16f3
[analyzer] Fix a failure encountered while analyzing bind (radar://10105448).
...
llvm-svn: 139509
2011-09-12 18:07:30 +00:00
Anna Zaks
295208d744
[analyzer] Fix a new failure encountered while building Adium exposed as a result of r138196(radar://10087620). ObjectiveC property of type int has a value of type ObjCPropRef, which is a Loc.
...
llvm-svn: 139507
2011-09-12 17:56:08 +00:00
John McCall
2d637d2e79
Rename the ARC cast kinds to start with "ARC".
...
llvm-svn: 139466
2011-09-10 06:18:15 +00:00
John McCall
cd78e805e9
When converting a block pointer to an Objective-C pointer type, extend
...
the lifetime of the block by copying it to the heap, or else we'll get
a dangling reference because the code working with the non-block-typed
object will not know it needs to copy.
There is some danger here, e.g. with assigning a block literal to an
unsafe variable, but, well, it's an unsafe variable.
llvm-svn: 139451
2011-09-10 01:16:55 +00:00
John McCall
9320b87cff
Give conversions of block pointers to ObjC pointers a different cast kind
...
than conversions of C pointers to ObjC pointers. In order to ensure that
we've caught every case, add asserts to CastExpr that strictly determine
which cast kind is used for which kind of bit cast.
llvm-svn: 139352
2011-09-09 05:25:32 +00:00
Jordy Rose
087611ed81
[analyzer] Remove TransferFuncs.h, then deal with the fallout.
...
And with that, TransferFuncs is gone!
llvm-svn: 139003
2011-09-02 08:02:59 +00:00
Jordy Rose
75e680eae3
[analyzer] Move RetainReleaseChecker to the Checkers library and rename it to RetainCountChecker...and clean up the file while I'm at it.
...
llvm-svn: 139002
2011-09-02 06:44:22 +00:00
Jordy Rose
dd7a654b1a
[analyzer] Remove lingering CFRefCount creation, which would have resulted in a leak. There's room for improvement here...
...
llvm-svn: 139000
2011-09-02 06:29:27 +00:00
Jordy Rose
a87a2775fa
[analyzer] Fix member initialization order. No functionality change.
...
llvm-svn: 138999
2011-09-02 06:21:26 +00:00
Jordy Rose
c49ec53e29
[analyzer] Move the knowledge of whether or not GC is enabled for the current analysis from CFRefCount to ExprEngine.
...
Remove TransferFuncs from ExprEngine and AnalysisConsumer.
Demote RetainReleaseChecker to a regular checker, and give it the name osx.cocoa.RetainCount (class name change coming shortly). Update tests accordingly.
llvm-svn: 138998
2011-09-02 05:55:19 +00:00
Jordy Rose
58a20d31b7
[analyzer] Introduce a new callback for checkers, printState, to be used for debug-printing the contents of a ProgramState.
...
Unlike the other callbacks, this one is a simple virtual method, since it is only to be used for debugging.
This new callback replaces the old ProgramState::Printer interface, and allows us to move the printing of refcount bindings from CFRefCount to RetainReleaseChecker.
llvm-svn: 138728
2011-08-28 19:11:56 +00:00
Jordy Rose
e9ff97b850
[analyzer] Remove the ProgramState argument from ExprEngine::evalBind; we were ignoring it anyway. No functionality change.
...
llvm-svn: 138720
2011-08-28 06:02:28 +00:00
Jordy Rose
d26e9e7f7c
[analyzer] Eliminate almost all uses of TransferFuncs from ExprEngine.
...
llvm-svn: 138719
2011-08-28 05:54:23 +00:00
Jordy Rose
d188d66e69
[analyzer] Migrate argument invalidation from CFRefCount to ExprEngine.
...
This is a common path for function and C++ method calls, Objective-C messages and property accesses, and C++ construct-exprs.
As support, add message receiver accessors to ObjCMessage and CallOrObjCMessage.
llvm-svn: 138718
2011-08-28 05:16:28 +00:00
Jordy Rose
1fad663126
[analyzer] Change the check::RegionChanges callback to include the regions explicitly requested for invalidation.
...
Also, allow CallOrObjCMessage to wrap a CXXConstructExpr as well.
Finally, this allows us to remove the clunky whitelisting system from CFRefCount/RetainReleaseChecker. Slight regression due to CXXNewExprs not yet being handled in post-statement callbacks (PR forthcoming).
llvm-svn: 138716
2011-08-27 22:51:26 +00:00
Ted Kremenek
996bfab499
[analyzer] Rename current PathDiagnosticClient::HandlePathDiagnostic() to HandlePathDiagnosticImpl(), and slot in new HandlePathDiagnostic() for potentially handling concurrent access to PathDiagnosticClients (in the future).
...
llvm-svn: 138713
2011-08-27 21:39:14 +00:00
Jordy Rose
256a6dd13b
[analyzer] Remove a couple of unnecessary returns after llvm_unreachables.
...
llvm-svn: 138649
2011-08-26 20:32:01 +00:00
Jeffrey Yasskin
0e9cdbbb06
Handle CXXTempObjectRegion in StackAddrEscapeChecker.
...
Also convert stack-addr-ps.cpp to use the analyzer instead of just Sema, now
that it doesn't crash, and extract the stack-block test into another file since
it errors, and that prevents the analyzer from running.
llvm-svn: 138613
2011-08-26 00:41:31 +00:00
Jordy Rose
15484daafe
[analyzer] Move the leak bugs from CFRefCount to RetainReleaseChecker, with a level of indirection to handle GC vs. non-GC.
...
llvm-svn: 138538
2011-08-25 01:14:38 +00:00
Jordy Rose
4ba0ba42e2
[analyzer] Move the easy bug types from CFRefCount to RetainReleaseChecker.
...
(These bug types may have just been leaked before...!)
llvm-svn: 138532
2011-08-25 00:34:03 +00:00
Jordy Rose
8b289a2cbd
[analyzer] Move the RetainSummaryManager from CFRefCount to RetainReleaseChecker.
...
Because Checkers live for an entire translation unit, this persists summary caches across multiple code bodies and avoids repeated initialization (but probably at the cost of memory). This removes the last references from RetainReleaseChecker to CFRefCount.
llvm-svn: 138529
2011-08-25 00:10:37 +00:00
Jordy Rose
a4c41bb875
[analyzer] Better fix for the "missing return" error, from Ted.
...
llvm-svn: 138526
2011-08-24 23:41:46 +00:00
Jordy Rose
34a83e911f
[analyzer] Silence another incorrect warning ("control reaches end of non-void function")
...
llvm-svn: 138510
2011-08-24 22:58:49 +00:00
Jordy Rose
763982b82d
[analyzer] Remove experimental FIXME that never actually applied to the code in trunk.
...
llvm-svn: 138508
2011-08-24 22:45:12 +00:00
Jordy Rose
184bd1430b
[analyzer] CFRefReport and friends no longer depend on CFRefCount.
...
llvm-svn: 138506
2011-08-24 22:39:09 +00:00
Jordy Rose
9ff0299935
[analyzer] Silence an (incorrect) uninitialized variable warning, caught by Cameron.
...
llvm-svn: 138477
2011-08-24 20:38:42 +00:00
Jordy Rose
38eea65acd
[analyzer] Copy GC mode setting from CFRefCount to RetainReleaseChecker in preparation for getting rid of CFRefCount.
...
This is a little hacky for now but will get better once we decide the best way to handle this.
llvm-svn: 138476
2011-08-24 20:33:55 +00:00
Anna Zaks
45aa208554
[analyzer] Allow checker writes to specify that no region should be accosiated with the report. (Useful when we report an error on endOfPath or deadSymbols, when the range of the last expression might have nothing to do with the error.)
...
llvm-svn: 138474
2011-08-24 20:31:06 +00:00
Jordy Rose
e8743a7499
[analyzer] Remove unused DoNothingByRef and the special case for CFDictionaryCreate.
...
This is a very small regression (actually introduced in r138309) because it won't catch leaks of objects passed by reference to CFDictionaryCreate (they're considered to have escaped and are ignored). If this is important we can put in a specific eval::Call to restore the functionality.
llvm-svn: 138464
2011-08-24 19:10:50 +00:00
Jordy Rose
5df640dc33
[analyzer] Slightly clean up the fix in 138432, so that it doesn't depend on the relative ordering of path-sensitive and path-insensitive checks. Still not ideal, but I think a real fix would require infrastructure that doesn't exist yet.
...
llvm-svn: 138462
2011-08-24 18:56:32 +00:00
Jordy Rose
95589f13ff
[analyzer] Fix a Heisenbug concerning object lifetimes with a hack. Hopefully a better fix coming soon. See comment for more details.
...
llvm-svn: 138432
2011-08-24 09:27:24 +00:00
Jordy Rose
58428b914d
[analyzer] Reapply 138390 "Clean up unused bits of CFRefCount", reverted in 138405. Ended up unrelated to any problems.
...
llvm-svn: 138431
2011-08-24 09:22:31 +00:00
Jordy Rose
14de7c5a88
[analyzer] Fix potential crasher with RAII. No functionality change. (No test because this particular circumstance requires an impossible series of events, but this is future-proofing.)
...
llvm-svn: 138430
2011-08-24 09:02:37 +00:00
Jordy Rose
7a53498f20
[analyzer] Reapply 138382 and 138388 (reverted in 138419 and 138420). The issue seems to have been with the uninitialized variable fixed in 138424; a fix for another Heisencrasher coming soon.
...
llvm-svn: 138426
2011-08-24 05:47:39 +00:00
Jordy Rose
03a8f9e578
[analyzer] Correctly initialize a variable and hopefully fix crashes.
...
llvm-svn: 138424
2011-08-24 04:48:19 +00:00
Eric Christopher
aa8b6a5cf4
Revert "[analyzer] Cleanup: Move temporary declarations of CFRefCount variables closer to their uses. No functionality change."
...
This reverts commit d02b4af7bd6ca4a743c7074d64e205d718aa221d.
llvm-svn: 138420
2011-08-24 00:39:51 +00:00
Eric Christopher
1825e7a260
Revert "[analyzer] Make CFRefBug and CFRefReportVisitor not dependent on CFRefCount. Unfortunately, CFRefReport still is. No functionality change."
...
This reverts commit e3fb7e428b7ba0d5d902dfe3f165d70e09b03a15.
llvm-svn: 138419
2011-08-24 00:39:48 +00:00
Ted Kremenek
adfb445466
Constify the result of CFGStmt::getStmt().
...
llvm-svn: 138408
2011-08-23 23:05:04 +00:00
Eric Christopher
fba570c9d8
Revert "[analyzer] Clean up unused bits of CFRefCount."
...
This reverts commit 6886a92640f5bffc972f67c0a1f302d6c6e7c322.
llvm-svn: 138405
2011-08-23 22:38:04 +00:00
Jordy Rose
5aa9b1dd3f
[analyzer] Clean up unused bits of CFRefCount.
...
llvm-svn: 138390
2011-08-23 21:51:36 +00:00
Jordy Rose
908426aae4
[analyzer] Make CFRefBug and CFRefReportVisitor not dependent on CFRefCount. Unfortunately, CFRefReport still is. No functionality change.
...
llvm-svn: 138388
2011-08-23 21:47:17 +00:00
Jordy Rose
fd13f6f56a
[analyzer] Cleanup: Move temporary declarations of CFRefCount variables closer to their uses. No functionality change.
...
llvm-svn: 138382
2011-08-23 21:06:32 +00:00
Jordy Rose
20d4e68195
[analyzer] Move function retain-count effect summary log from CFRefCount to RetainReleaseChecker, and then explicitly provide the summary log when creating CFRefReports. No functionality change.
...
llvm-svn: 138374
2011-08-23 20:55:48 +00:00
Ted Kremenek
ee9848e20d
Fix regression in -Wuninitialized involving VLAs. It turns out that we were modeling sizeof(VLAs)
...
incorrectly in the CFG, and also the static analyzer. This patch regresses the analyzer a bit, but
that needs to be followed up with a better solution.
Fixes <rdar://problem/10008112>.
llvm-svn: 138372
2011-08-23 20:30:50 +00:00
Jordy Rose
bf77e51fa1
[analyzer] Move helper method Update from CFRefCount to RetainReleaseChecker. No functionality change.
...
llvm-svn: 138370
2011-08-23 20:27:16 +00:00
Jordy Rose
6763e38736
[analyzer] Move helper method handleAutoreleaseCounts from CFRefCount to RetainReleaseChecker. No functionality change.
...
llvm-svn: 138365
2011-08-23 20:07:14 +00:00
Jordy Rose
298cc4d907
[analyzer] Move ReturnStmt retain-count analysis from CFRefCount to RetainReleaseChecker. Tweak CFRefReport to reflect that fact that ReturnStmt checks are pre-statement, not post-statement. No intended functionality change.
...
llvm-svn: 138358
2011-08-23 19:43:16 +00:00
Jordy Rose
7861276f47
[analyzer] Move symbol death leak analysis from CFRefCount to RetainReleaseChecker.
...
llvm-svn: 138353
2011-08-23 19:01:07 +00:00
Jordy Rose
212e459164
[analyzer] Only allocate retain summaries for interesting functions/messages. This is a minor saving of memory but doesn't seem to cost any performance.
...
llvm-svn: 138320
2011-08-23 04:27:15 +00:00
Jordy Rose
f5b0234992
[analyzer] Rename CFRefCount's evalSummary method to evalCallOrMessage, since it no longer, uh, evaluates call summaries.
...
llvm-svn: 138313
2011-08-23 00:03:01 +00:00
Jordy Rose
5b31d7acf7
[analyzer] Migrate the handling of retain-count-related RetEffects and ArgEffects from CFRefCount to RetainReleaseChecker. No intended functionality change.
...
llvm-svn: 138309
2011-08-22 23:48:23 +00:00
Anna Zaks
76c3fb6a51
Static Analyzer Diagnostics: Allow checkers to add ExtraDescriptiveText, now renamed into ExtraText, to the diagnostic without subclassing BugReport.
...
llvm-svn: 138272
2011-08-22 20:31:28 +00:00
Anna Zaks
752de1443f
Clean up the CFRefBugReport - remove the members, which got moved to the CFRefReportVisitors.
...
llvm-svn: 138259
2011-08-22 18:54:07 +00:00
Jordy Rose
898a148d28
[analyzer] Migrate the aliasing effects of CFRetain and CFMakeCollectable from CFRefCount to RetainReleaseChecker. No intended functionality change.
...
llvm-svn: 138223
2011-08-21 21:58:18 +00:00
Jordy Rose
6582dde545
[analyzer] Remove FIXME; Ted reminded me that -init is not guaranteed to return its receiver and pretending that it does won't actually buy us anything. (Comment change only.)
...
llvm-svn: 138221
2011-08-21 21:04:38 +00:00
Jordy Rose
3f7f7568f2
[analyzer] Migrate return value handling from CFRefCount to ExprEngine. This seems to result in a minor performance hit, but I think that will go away again once we eliminate TransferFuncs from function calls entirely.
...
llvm-svn: 138220
2011-08-21 19:41:36 +00:00
Jordy Rose
82c673de33
[analyzer] Replace calls to getNameAsString() with StringRef equivalents.
...
llvm-svn: 138215
2011-08-21 05:25:15 +00:00
Jordy Rose
a8f99ba749
[analyzer] RetainReleaseChecker always wants region change updates. There's no need for a flag, at least not right now.
...
llvm-svn: 138212
2011-08-20 21:17:59 +00:00
Jordy Rose
5c252ef7b1
Fix indentation.
...
llvm-svn: 138211
2011-08-20 21:16:58 +00:00
Jordy Rose
5a3c9ff3a3
[analyzer] Move handling of hardcoded noreturn ("panic") methods from CFRefCount to NoReturnFunctionChecker. No functionality change intended.
...
llvm-svn: 138210
2011-08-20 20:55:40 +00:00
Ted Kremenek
60d2ec5765
[analyzer] Handle reads of ObjCPropertyRefExprs implicitly in Environment. No need to bind an explicit value and create a new node.
...
llvm-svn: 138196
2011-08-20 06:23:25 +00:00
Ted Kremenek
876e34b7b5
[analyzer] Simplify ExprEngine::VisitBinaryOperator() by removing recursive visit to subexpressions (which is no longer needed).
...
llvm-svn: 138195
2011-08-20 06:16:31 +00:00
Ted Kremenek
a9ce612fa2
Start partitioning ExprEngine.cpp into separate .cpp files that handle different parts
...
of the analysis (e.g., analysis of C expressions, analysis of Objective-C expressions, and so on).
llvm-svn: 138194
2011-08-20 06:00:03 +00:00
Ted Kremenek
10e2503177
Rename CXXExprEngine.cpp to ExprEngineCXX.cpp.
...
llvm-svn: 138193
2011-08-20 05:59:58 +00:00
Anna Zaks
88255cc533
Static Analyzer Diagnostics: Move the responsibility for generating the endOfPath diagnostic piece from BugReport to BugReporterVisitor. Switch CFRefCount to use visitors in order to generate the endOfPath piece.
...
llvm-svn: 138184
2011-08-20 01:27:22 +00:00
Anna Zaks
071a89c39f
Static Analyzer Diagnostics: Switch CFRefCount to using the new visitor API. BugReport no longer needs to inherit from BugReporterVisitor.
...
llvm-svn: 138142
2011-08-19 23:21:56 +00:00
Anna Zaks
f86615ca5c
Static Analyzer Diagnostics: Kill the addVisitorCreator(callbackTy, void*) API in favor of addVisitor(BugReporterVisitor*).
...
1) Create a header file to expose the predefined visitors. And move the parent(BugReporterVisitor) there as well.
2) Remove the registerXXXVisitor functions - the Visitor constructors/getters can be used now to create the object. One exception is registerVarDeclsLastStore(), which registers more then one visitor, so make it static member of FindLastStoreBRVisitor.
3) Modify all the checkers to use the new API.
llvm-svn: 138126
2011-08-19 22:33:38 +00:00
Anna Zaks
be28d6c66d
Fix a memory leak in the analyzer - BugReports didn't get freed. Plus, remove invalid assert from the destructor which wasn't called previously due to the leak.
...
llvm-svn: 138027
2011-08-19 01:57:09 +00:00
Anna Zaks
f4dd4ae7cc
Static Analyzer Diagnostics: Move custom diagnostic visitors from BugReporterContext to BugReport.
...
One API change: I added BugReporter as an additional parameter to the BugReporterVisitor::VisitNode() method to allow visitors register other visitors with the report on the fly (while processing a node). This functionality is used by NilReceiverVisitor, which registers TrackNullOrUndefValue when the receiver is null.
llvm-svn: 138001
2011-08-18 22:37:56 +00:00
Anna Zaks
525cfe7d28
Remove DiagBugReport by pulling it into its parent BugReport.
...
llvm-svn: 137899
2011-08-17 23:21:23 +00:00
Anna Zaks
3a6bdf8f82
Remove EnhancedBugReport and RangedBugReport - pull all the extra functionality they provided into their parent BugReport. The only functional changes are: made getRanges() non const - it adds default range to Ranges if none are supplied, made getStmt() private, which was another FIXME.
...
llvm-svn: 137894
2011-08-17 23:00:25 +00:00
Jordy Rose
217eb9043f
[analyzer] Migrate assumption and binding handling from CFRefCount to RetainReleaseChecker. This is mostly a textual move and required no supporting changes. No functionality change intended.
...
llvm-svn: 137874
2011-08-17 21:27:39 +00:00
Ted Kremenek
c14efa7122
Fix a handful of dead stores found by Clang's static analyzer. There's a bunch of others I haven't touched.
...
llvm-svn: 137867
2011-08-17 21:04:19 +00:00
Ted Kremenek
e1962328f5
[analyzer] teach ExprEngine about loads from static C++ class fields. Fixes <rdar://problem/9948787>.
...
llvm-svn: 137760
2011-08-16 21:37:52 +00:00
Jordy Rose
59cce71af6
[analyzer] Overhaul of checker registration in preparation for basic plugin support. Removes support for checker groups (we can add them back in later if we decide they are still useful), and -analyzer-checker-help output is a little worse for the time being (no packages).
...
llvm-svn: 137758
2011-08-16 21:24:21 +00:00
Ted Kremenek
31fdb61618
[analyzer] Enhance ConditionVisitor to handle arbitrary ValueDecls in binary expressions, and also handle inverting the order of comparison when the named decl appears on the RHS.
...
llvm-svn: 137714
2011-08-16 10:57:37 +00:00
Ted Kremenek
01401a54f8
[analyzer] fix operation inversion calculation in ConditionVisitor.
...
llvm-svn: 137708
2011-08-16 03:44:38 +00:00
Ted Kremenek
667417ef9c
[analyzer] Enhance ConditionVisitor to understand eagerly evaluated (simple) binary conditions, and teach it to only focus on constraint changes.
...
llvm-svn: 137705
2011-08-16 01:53:41 +00:00
Ted Kremenek
b1bf2680f5
[analyzer] add ExprEngine::getEagerlyAssumedTags() to allow externally querying of "eagerly assumed" expressions.
...
llvm-svn: 137704
2011-08-16 01:53:39 +00:00
Ted Kremenek
9815709cd2
[analyzer] Remove PostStmtCustom ProgramPoint. It can be represented using tagged PostStmts.
...
llvm-svn: 137697
2011-08-16 00:49:19 +00:00
Ted Kremenek
32b9e234fe
Add ProgramState.cpp.
...
llvm-svn: 137677
2011-08-15 23:05:22 +00:00
Ted Kremenek
001fd5b498
Rename GRState to ProgramState, and cleanup some code formatting along the way.
...
llvm-svn: 137665
2011-08-15 22:09:50 +00:00
Ted Kremenek
5ef32dbf2a
Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer and libStaticAnalyzer[*]. It was highly inconsistent, and very ugly to look at.
...
llvm-svn: 137537
2011-08-12 23:37:29 +00:00
Ted Kremenek
e8f7316fee
[analyzer] change "tag" in ProgramPoint from "void*" to a ProgramPointTag*.
...
Having a notion of an actual ProgramPointTag will aid in introspection of the analyzer's behavior.
For example, the GraphViz output of the analyzer will pretty-print the tags in a useful manner.
llvm-svn: 137529
2011-08-12 23:04:46 +00:00
Ted Kremenek
8df44b2632
[analyzer] Introduce new MemRegion, "TypedValueRegion", so that we can separate TypedRegions that implement getValueType() from those that don't.
...
Patch by Olaf Krzikalla!
llvm-svn: 137498
2011-08-12 20:02:48 +00:00
Anna Zaks
9b25cee36f
Optimizations for Dependent Symbol tracking (as per Ted's code review for r137309):
...
1) Change SymbolDependTy map to keep pointers as data. And other small tweaks like making the DenseMap smaller 64->16 elements; remove removeSymbolDependencies() as it will probably not be used.
2) Do not mark dependents live more then once.
llvm-svn: 137401
2011-08-12 00:34:56 +00:00
Anna Zaks
22a9d0f316
Analyzer Core: Adding support for user-defined symbol dependencies. (For example, the allocated resource symbol only needs to be freed if no error has been returned by the allocator, so a checker might want to make the lifespan of the error code symbol depend on the allocated resource symbol.) Note, by default, the map that holds the dependencies will get destroyed along with the SymbolManager at the end of function exploration.
...
llvm-svn: 137309
2011-08-11 16:43:28 +00:00
Anna Zaks
173864b36c
Cleanup: remove CleanedSate member and GetState() wrapper from StmtNodeBuilder, not needed as of r137273.
...
llvm-svn: 137284
2011-08-11 00:11:21 +00:00
Anna Zaks
e309e05603
Cleanup: remove GetState() wrapper from ExprEngine, not needed as of r137273.
...
llvm-svn: 137279
2011-08-10 23:34:53 +00:00
Anna Zaks
5a56a6653f
Analyzer Core: In checkDeadSymbols checker callback, provide the state in which the symbols are not yet deleted so that checkers could inspect them. Since we are now always creating a transition in ProcessStmt(), remove the logic for adding a transition when none was generated. TODO: the extra transitions will have to be removed; more cleanups; a checker that tests teh new fucntionality.
...
llvm-svn: 137273
2011-08-10 23:14:54 +00:00
Ted Kremenek
54d456758e
[analyzer] Start sketching out a new BugReporterVisitor that inspects branches and other expressions to generate interesting path events in diagnostics.
...
llvm-svn: 137012
2011-08-06 06:54:45 +00:00
Ted Kremenek
84a1ca5280
[analyzer] Simplify logic for ExprEngine::VisitUnaryExprOrTypeTraitExpr to avoid recursion to subexpression.
...
This exposed bugs in the live variables analysis, and a latent analyzer bug in the SymbolReaper.
llvm-svn: 137006
2011-08-06 00:30:00 +00:00
Ted Kremenek
c91ca30b4c
[analyzer] Change SymbolReaper to store region roots implied by the Environment, allowing it be queried when
...
determining if symbols derived from regions are still live.
llvm-svn: 137005
2011-08-06 00:29:57 +00:00
Anna Zaks
59546b8f79
Static Analyzer diagnostics visualization: when the last location on a path is end of the function, the arrow should point to the closing brace, not the statement before it. Patch by Ted Kremenek.
...
llvm-svn: 136761
2011-08-03 01:57:49 +00:00
Ted Kremenek
9a2001a817
[analyzer] Drastically simplify ExprEngine::VisitInitListExpr() by assuming all initializer expressions have already been evaluated.
...
llvm-svn: 136706
2011-08-02 18:27:05 +00:00
Benjamin Kramer
558e37858b
Remove dead code flagged by GCC's -Wunused-but-set-variable.
...
llvm-svn: 136581
2011-07-31 01:06:41 +00:00
Ted Kremenek
67d7136f26
[analyzer] Remove recursive visitation in ExprEngine::VisitDeclStmt because it isn't needed anymore.
...
llvm-svn: 136522
2011-07-29 21:18:41 +00:00
Ted Kremenek
e905c68cbd
[analyzer] Remove recursive visitation in ExprEngine::VisitCompoundLiteralExpr because it isn't needed anymore.
...
llvm-svn: 136521
2011-07-29 21:18:39 +00:00
Ted Kremenek
dc492c29f7
[analyzer] Remove recursive visitation in ExprEngine::VisitCastExpr because it isn't needed anymore.
...
llvm-svn: 136520
2011-07-29 21:18:37 +00:00
Ted Kremenek
cf36b0c64d
[analyzer] Remove recursive visitation in ExprEngine::VisitObjCForCollectionStmt because it isn't needed anymore.
...
llvm-svn: 136519
2011-07-29 21:18:35 +00:00
Ted Kremenek
65eefed6c6
[analyzer] Remove explicit argument processing from ExprEngine::VisitObjCMessage() since it is no longer needed.
...
llvm-svn: 136518
2011-07-29 21:18:31 +00:00
Ted Kremenek
4e577fae2c
[analyzer] Remove recursive visitation in ExprEngine::VisitLValObjCIvarRefExpr because it isn't needed anymore.
...
llvm-svn: 136517
2011-07-29 21:18:28 +00:00
Ted Kremenek
003ec6ff83
[analyzer] tighten up ExprEngine::VisitObjCAtSynchronizationStmt().
...
llvm-svn: 136516
2011-07-29 21:18:26 +00:00
Ted Kremenek
f8c0bcf101
[analyzer] Remove recursive visitation in ExprEngine::VisitObjCPropertyRefExpr because it isn't needed anymore.
...
llvm-svn: 136515
2011-07-29 21:18:24 +00:00
Ted Kremenek
298e5cc7f4
[analyzer] Remove recursive visitation in ExprEngine::VisitCallExpr because it isn't needed anymore.
...
llvm-svn: 136514
2011-07-29 21:18:22 +00:00
Ted Kremenek
22a1e65532
[analyzer] Remove recursive visitation in ExprEngine::VisitMemberExpr because it isn't needed anymore.
...
llvm-svn: 136513
2011-07-29 21:18:19 +00:00
Ted Kremenek
db835cc213
[analyzer] Remove recursive visitation in ExprEngine::VisitLvalArraySubscriptExpr() because it is no longer needed.
...
llvm-svn: 136512
2011-07-29 21:18:17 +00:00
Chandler Carruth
605415923f
Remove an unused function (found by Clang's -Wunused-function)
...
llvm-svn: 136434
2011-07-29 00:15:44 +00:00
Ted Kremenek
73665188fc
Really remove FlatStoreManager and BasicStoreManager, this time from the driver. Also remove associated tests. Sorry for the messy commits; this is the result of a botched Git merge.
...
llvm-svn: 136422
2011-07-28 23:08:16 +00:00
Ted Kremenek
e2e37b9afc
Remove FlatStoreManager and BasicStoreManager. The latter has long been obsolete and the former has no had development in a long time.
...
llvm-svn: 136420
2011-07-28 23:08:02 +00:00
Ted Kremenek
e9fda1e48a
[analyzer] Overhaul how the static analyzer expects CFGs by forcing CFGs to be linearized only when used by the static analyzer. This required a rewrite of LiveVariables, and exposed a ton of subtle bugs.
...
The motivation of this large change is to drastically simplify the logic in ExprEngine going forward.
Some fallout is that the output of some BugReporterVisitors is not as accurate as before; those will
need to be fixed over time. There is also some possible performance regression as RemoveDeadBindings
will be called frequently; this can also be improved over time.
llvm-svn: 136419
2011-07-28 23:07:59 +00:00
Ted Kremenek
ae16d1cc67
[analyzer] Add StoreManager::includedInBindings() to to query whether a region is used in any bindings.
...
llvm-svn: 136416
2011-07-28 23:07:46 +00:00
Ted Kremenek
6b1a761f3e
[analyzer] Add safety checking in RegionStoreManager for string literal underruns.
...
llvm-svn: 136415
2011-07-28 23:07:43 +00:00
Ted Kremenek
47fc816b96
[analyzer] Teach Environment to not look through MaterializeTemporaryExprs.
...
llvm-svn: 136414
2011-07-28 23:07:41 +00:00
Ted Kremenek
3b446215d1
[analyzer] Fix bug in ObjCMessage where casts were being incorrectly ignored.
...
llvm-svn: 136413
2011-07-28 23:07:38 +00:00
Ted Kremenek
a644668193
[analyzer] fix handling of MaterializeTemporaryExpr by binding the result value to
...
the proper expression.
llvm-svn: 136412
2011-07-28 23:07:36 +00:00
Chandler Carruth
d48db2115a
Rename getInstantiationLineNumber to getExpansionLineNumber in both
...
SourceManager and FullSourceLoc.
llvm-svn: 135969
2011-07-25 21:09:52 +00:00
Chandler Carruth
42f35f9cd2
Rename getInstantiationColumnNumber to getExpansionColumnNumber in both
...
SourceManager and FullSourceLoc.
llvm-svn: 135965
2011-07-25 20:57:57 +00:00
Chandler Carruth
c7ca5218b6
Rename getDecomposedInstantiationLoc to getDecomposedExpansionLoc.
...
llvm-svn: 135962
2011-07-25 20:52:32 +00:00
Chandler Carruth
35f5320d8e
Mechanically rename SourceManager::getInstantiationLoc and
...
FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part
of the API and documentation update from 'instantiation' as the term for
macros to 'expansion'.
llvm-svn: 135914
2011-07-25 16:49:02 +00:00
Chris Lattner
0e62c1cc0b
remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
...
them into the clang namespace.
llvm-svn: 135852
2011-07-23 10:55:15 +00:00
John McCall
d2930c2100
In Objective-C, pull arbitrary attributes from overridden
...
methods, including indirectly overridden methods like those
declared in protocols and categories. There are mismatches
that we would like to diagnose but aren't yet, but this
is fine for now.
I looked at approaches that avoided doing this lookup
unless we needed it, but the infer-related-result-type
checks were doing it anyway, so I left it with the same
fast-path check for no previous declartions of that
selector.
llvm-svn: 135743
2011-07-22 02:45:48 +00:00
Ted Kremenek
86070b9c0f
Move AnalysisManager constructor out of line. No functionality change (yet).
...
llvm-svn: 135667
2011-07-21 05:22:52 +00:00
Ted Kremenek
189ecec4db
Simplify passing of CFGBuildOptions around for AnalysisContext. No functionality change.
...
llvm-svn: 135666
2011-07-21 05:22:47 +00:00
Ted Kremenek
c85964ed90
[analyzer] Place checking for Core Foundation "Create" rule into a proper API. No functionality change.
...
llvm-svn: 135349
2011-07-16 19:50:32 +00:00
Jordy Rose
43426f8fcb
Add tests for CFRefReport's path notes, and fix a few typos and non-standard terminology ('+0 retain counts') caught by the tests.
...
llvm-svn: 135310
2011-07-15 22:17:54 +00:00