summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/condition.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-4/+4
| | | | llvm-svn: 230795
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-4/+4
| | | | | | tests fail. llvm-svn: 188447
* Revise cleanup IR generation to fix a major bug with cleanups (PR7686)John McCall2010-07-231-8/+8
| | | | | | | as well as some significant asymptotic inefficiencies with threading multiple jumps through deep cleanups. llvm-svn: 109274
* Teach IR generation how to lazily emit cleanups. This has a lot of advantages,John McCall2010-07-131-0/+1
| | | | | | | | | | | | | | | mostly in avoiding unnecessary work at compile time but also in producing more sensible block orderings. Move the destructor cleanups for local variables over to use lazy cleanups. Eventually all cleanups will do this; for now we have some awkward code duplication. Tell IR generation just to never produce landing pads in -fno-exceptions. This is a much more comprehensive solution to a problem which previously was half-solved by checks in most cleanup-generation spots. llvm-svn: 108270
* Stop testing for specific basic block numbers in this test.John McCall2010-07-061-2/+0
| | | | llvm-svn: 107632
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-28/+94
| | | | | | | | | | | | | | | | | | | | | | | | self-host. Hopefully these results hold up on different platforms. I tried to keep the GNU ObjC runtime happy, but it's hard for me to test. Reimplement how clang generates IR for exceptions. Instead of creating new invoke destinations which sequentially chain to the previous destination, push a more semantic representation of *why* we need the cleanup/catch/filter behavior, then collect that information into a single landing pad upon request. Also reorganizes how normal cleanups (i.e. cleanups triggered by non-exceptional control flow) are generated, since it's actually fairly closely tied in with the former. Remove the need to track which cleanup scope a block is associated with. Document a lot of previously poorly-understood (by me, at least) behavior. The new framework implements the Horrible Hack (tm), which requires every landing pad to have a catch-all so that inlining will work. Clang no longer requires the Horrible Hack just to make exceptions flow correctly within a function, however. The HH is an unfortunate requirement of LLVM's EH IR. llvm-svn: 107631
* When instantiating statements that involve conditions (if, while, do,Douglas Gregor2010-05-081-0/+79
| | | | | | | | | | | | | for, and switch), be careful to construct the full expressions as soon as we perform template instantation, so we don't either forget to call temporary destructors or destroy temporaries at the wrong time. This is the template-instantiation analogue to r103187, during which I hadn't realized that the issue would affect the handling of these constructs differently inside and outside of templates. Fixes a regression in Boost.Function. llvm-svn: 103357
* Fix test for Release-Asserts buildDouglas Gregor2010-05-081-12/+12
| | | | llvm-svn: 103337
* Rework our handling of temporary objects within the conditions ofDouglas Gregor2010-05-061-0/+63
| | | | | | | | | | | | | | | | | | | if/switch/while/do/for statements. Previously, we would end up either: (1) Forgetting to destroy temporaries created in the condition (!), (2) Destroying the temporaries created in the condition *before* converting the condition to a boolean value (or, in the case of a switch statement, to an integral or enumeral value), or (3) In a for statement, destroying the condition's temporaries at the end of the increment expression (!). We now destroy temporaries in conditions at the right times. This required some tweaking of the Parse/Sema interaction, since the parser was building full expressions too early in many places. Fixes PR7067. llvm-svn: 103187
* Update tests in -Asserts mode. These tests really need to be rewritten...Daniel Dunbar2010-02-091-11/+11
| | | | llvm-svn: 95658
* Fix for Release-Asserts.Mike Stump2010-01-131-14/+14
| | | | llvm-svn: 93347
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Implement proper cleanup semantics for condition variables in forDouglas Gregor2009-11-251-1/+6
| | | | | | | | | | statements, e.g., for(; X x = X(); ) { ... } Daniel or Anders, please review! llvm-svn: 89832
* Tweak the code-generation-for-condition-variables test case to get to what ↵Douglas Gregor2009-11-251-3/+3
| | | | | | we want to test llvm-svn: 89818
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-251-0/+14
| | | | | | | | | | | | | | | | | All statements that involve conditions can now hold on to a separate condition declaration (a VarDecl), and will use a DeclRefExpr referring to that VarDecl for the condition expression. ForStmts now have such a VarDecl (I'd missed those in previous commits). Also, since this change reworks the Action interface for if/while/switch/for, use FullExprArg for the full expressions in those expressions, to ensure that we're emitting Note that we are (still) not generating the right cleanups for condition variables in for statements. That will be a follow-on commit. llvm-svn: 89817
* Clean up the AST for while loops and fix several problems withDouglas Gregor2009-11-241-0/+20
| | | | | | | | | | | | | | | | | cleanups for while loops: 1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g., while (shared_ptr<WorkInt> p = getWorkItem()) { // ... } 2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g., while (blah) RAIIObject raii(blah+1); llvm-svn: 89800
* Explicitly store the condition variable within switch statements, andDouglas Gregor2009-11-241-0/+24
| | | | | | | make sure that this variable is destroyed when we exit the switch statement. llvm-svn: 89776
* Introduce cleanup scopes for "if" statements in two places:Douglas Gregor2009-11-241-0/+47
- Outside the "if", to ensure that we destroy the condition variable at the end of the "if" statement rather than at the end of the block containing the "if" statement. - Inside the "then" and "else" branches, so that we emit then- or else-local cleanups at the end of the corresponding block when the block is not a compound statement. To make adding these new cleanup scopes easier (and since switch/do/while will all need the same treatment), added the CleanupScope RAII object to introduce a new cleanup scope and make sure it gets cleaned up. llvm-svn: 89773
OpenPOWER on IntegriCloud