summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/temp-obj-dtors-cfg-output.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change subexpressions to be visited in the CFG from left-to-right.Ted Kremenek2013-02-051-85/+85
| | | | | | | | | | | | | | | | | This is a more natural order of evaluation, and it is very important for visualization in the static analyzer. Within Xcode, the arrows will not jump from right to left, which looks very visually jarring. It also provides a more natural location for dataflow-based diagnostics. Along the way, we found a case in the analyzer diagnostics where we needed to indicate that a variable was "captured" by a block. -fsyntax-only timings on sqlite3.c show no visible performance change, although this is just one test case. Fixes <rdar://problem/13016513> llvm-svn: 174447
* Comment parsing: actually check for a block command after "\param x"Dmitri Gribenko2013-01-261-0/+1
| | | | | | This fixes PR15068. llvm-svn: 173539
* Remove useless 'XPASS: *' from testsDmitri Gribenko2013-01-251-1/+0
| | | | llvm-svn: 173511
* [analyzer] For now, don't inline C++ standard library functions.Jordan Rose2012-09-101-1/+1
| | | | | | | | | | | | | | | | This is a (heavy-handed) solution to PR13724 -- until we know we can do a good job inlining the STL, it's best to be consistent and not generate more false positives than we did before. We can selectively whitelist certain parts of the 'std' namespace that are known to be safe. This is controlled by analyzer config option 'c++-stdlib-inlining', which can be set to "true" or "false". This commit also adds control for whether or not to inline any templated functions (member or non-member), under the config option 'c++-template-inlining'. This option is currently on by default. llvm-svn: 163548
* [analyzer] Always include destructors in the analysis CFG.Jordan Rose2012-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | While destructors will continue to not be inlined (unless the analyzer config option 'c++-inlining' is set to 'destructors'), leaving them out of the CFG is an incomplete model of the behavior of an object, and can cause false positive warnings (like PR13751, now working). Destructors for temporaries are still not on by default, since (a) we haven't actually checked this code to be sure it's fully correct (in particular, we probably need to be very careful with regard to lifetime-extension when a temporary is bound to a reference, C++11 [class.temporary]p5), and (b) ExprEngine doesn't actually do anything when it sees a temporary destructor in the CFG -- not even invalidate the object region. To enable temporary destructors, set the 'cfg-temporary-dtors' analyzer config option to '1'. The old -cfg-add-implicit-dtors cc1 option, which controlled all implicit destructors, has been removed. llvm-svn: 163264
* [analyzer] Turn -cfg-add-initializers on by default, and remove the flag.Jordan Rose2012-07-311-1/+1
| | | | llvm-svn: 161060
* Refine CFG so that '&&' and '||' don't lead to extra confluence points when ↵Ted Kremenek2012-07-141-62/+143
| | | | | | | | | | | | | | | | | | used in a branch, but instead push the terminator for the branch down into the basic blocks of the subexpressions of '&&' and '||' respectively. This eliminates some artifical control-flow from the CFG and results in a more compact CFG. Note that this patch only alters the branches 'while', 'if' and 'for'. This was complex enough for one patch. The remaining branches (e.g., do...while) can be handled in a separate patch, but they weren't immediately tackled because they were less important. It is possible that this patch introduces some subtle bugs, particularly w.r.t. to destructor placement. I've tried to audit these changes, but it is also known that the destructor logic needs some refinement in the area of '||' and '&&' regardless (i.e., their are known bugs). llvm-svn: 160218
* Add elidable CXXConstructExpr as block-level expr. It converts an lvalue to ↵Zhongxing Xu2012-01-111-641/+657
| | | | | | a rvalue, which is a useful step during AST evaluation. llvm-svn: 147918
* Colorize and condense CFG pretty-printing.Ted Kremenek2011-12-221-667/+642
| | | | llvm-svn: 147203
* Per an offline conversation with John McCall, have StmtPrinter actually ↵Ted Kremenek2011-11-301-6/+7
| | | | | | print out the source expression for OpaqueValueExpr. llvm-svn: 145524
* Added missing ImplicitCastExpr around conversion operator call.Abramo Bagnara2011-11-161-41/+55
| | | | llvm-svn: 144850
* Per discussion with John McCall, don't add OpaqueValueExprs to the CFG.Ted Kremenek2011-11-051-27/+22
| | | | llvm-svn: 143766
* [analyzer] Overhaul how the static analyzer expects CFGs by forcing CFGs to ↵Ted Kremenek2011-07-281-483/+658
| | | | | | | | | | | | 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
* [analyzer] Use the new registration mechanism for the debugging info "checks".Argyrios Kyrtzidis2011-02-171-1/+1
| | | | | | | | | | The relative checker package is 'debug': '-dump-live-variables' is replaced by '-analyzer-checker=debug.DumpLiveVars' '-cfg-view' is replaced by '-analyzer-checker=debug.ViewCFG' '-cfg-dump' is replaced by '-analyzer-checker=debug.DumpCFG' llvm-svn: 125780
* Change the representation of GNU ?: expressions to use a different expressionJohn McCall2011-02-171-51/+77
| | | | | | | | | | | | | | | | | | | | | | class and to bind the shared value using OpaqueValueExpr. This fixes an unnoticed problem with deserialization of these expressions where the deserialized form would lose the vital pointer-equality trait; or rather, it fixes it because this patch also does the right thing for deserializing OVEs. Change OVEs to not be a "temporary object" in the sense that copy elision is permitted. This new representation is not totally unawkward to work with, but I think that's really part and parcel with the semantics we're modelling here. In particular, it's much easier to fix things like the copy elision bug and to make the CFG look right. I've tried to update the analyzer to deal with this in at least some obvious cases, and I think we get a much better CFG out, but the printing of OpaqueValueExprs probably needs some work. llvm-svn: 125744
* Revert r118991.Zhongxing Xu2010-11-141-3/+12
| | | | | | | | | Elidable CXXConstructExpr should inhibit calling destructor for temporary that is copied, not the one created. This is because eliding copy constructor means that the object that was to be copied will be constructed directly in memory the copy would be constructed in. llvm-svn: 119044
* Do not add implicit dtors for CXXBindTemporaryExpr with elidable Zhongxing Xu2010-11-131-12/+3
| | | | | | CXXConstructExpr. llvm-svn: 118991
* fix test case.Zhongxing Xu2010-11-031-473/+457
| | | | llvm-svn: 118166
* Added generating destructors for temporary objects. Two cases I know of, ↵Marcin Swiderski2010-11-031-0/+581
that are not handled properly: 1. For statement: const C& c = C(0) ?: C(1) destructors generated for condition will not differ from those generated for case without prolonged lifetime of temporary, 2. There will be no destructor for constant reference member bound to temporary at the exit from constructor. llvm-svn: 118158
OpenPOWER on IntegriCloud