summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix 'for' loop variables' scope.Devang Patel2010-08-251-6/+6
| | | | llvm-svn: 112002
* Detabify.Eli Friedman2010-08-221-2/+2
| | | | llvm-svn: 111768
* Slightly revised handling of mult-alt constraints, to avoid an assert, until ↵John Thompson2010-08-101-1/+9
| | | | | | we have the full fix. llvm-svn: 110706
* Revise cleanup IR generation to fix a major bug with cleanups (PR7686)John McCall2010-07-231-26/+31
| | | | | | | as well as some significant asymptotic inefficiencies with threading multiple jumps through deep cleanups. llvm-svn: 109274
* Keep track of artificial scopes introduced by line directives. For example,Devang Patel2010-07-221-0/+1
| | | | | | | | | | | | #line 41 "bar.c" dummy (1, i); #line 24 "bar.h" i = f2 (i); #line 44 "bar.c" This is tested by step-line.exp in gdb testsuite. llvm-svn: 109189
* Remove unused argument.Devang Patel2010-07-201-5/+5
| | | | llvm-svn: 108946
* Fix for PR3800: make sure not to evaluate the expression for a read-writeEli Friedman2010-07-161-16/+27
| | | | | | asm operand twice. llvm-svn: 108489
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-130/+138
| | | | | | | | | | | | | | | | | | | | | | | | 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
* finally get around to doing a significant cleanup to irgen:Chris Lattner2010-06-271-3/+2
| | | | | | | | have CGF create and make accessible standard int32,int64 and intptr types. This fixes a ton of 80 column violations introduced by LLVMContextification and cleans up stuff a lot. llvm-svn: 106977
* Change EmitReferenceBindingToExpr to take a decl instead of a boolean.Anders Carlsson2010-06-261-1/+1
| | | | llvm-svn: 106949
* Add a comment for r104472.Benjamin Kramer2010-05-231-0/+3
| | | | llvm-svn: 104473
* PR5863: Don't erase unreachable BBs which have an associated cleanup size.Benjamin Kramer2010-05-231-1/+1
| | | | | | | This works around a crash where malloc reused the memory of an erased BB for a new BB leaving old cleanup information pointing at the new block. llvm-svn: 104472
* Don't remove the break/continue scope of a for loop until after we'veDouglas Gregor2010-05-211-4/+2
| | | | | | | | emitted the increment expression. Fixes PR7189. If someone knows how to write a useful test for this, I'd be grateful. llvm-svn: 104335
* Ensure that destructors are called for NRVO'd objects when theDouglas Gregor2010-05-171-0/+8
| | | | | | | function does not return. Thanks to Eli for pointing out this corner case. llvm-svn: 103941
* Implement a simple form of the C++ named return value optimization forDouglas Gregor2010-05-151-1/+6
| | | | | | | | | return statements. We perform NRVO only when all of the return statements in the function return the same variable. Fixes some link failures in Boost.Interprocess (which is relying on NRVO), and probably improves performance for some C++ applications. llvm-svn: 103867
* Use end location of DeclStmt to mark stop point. Devang Patel2010-05-121-1/+4
| | | | | | This is meaningful for blocks. This patch fixes bunch of test failures in gdb testsuite. llvm-svn: 103533
* Fix a place in inline asm lowering which was creating a TruncInst with aDan Gohman2010-04-241-3/+8
| | | | | | | pointer operand. This fixes an abort on MultiSource/Applications/ClamAV/libclamav_mbox.c. llvm-svn: 102238
* Implement PR6845. We allow matching constraints to have differentChris Lattner2010-04-231-18/+23
| | | | | | | | input and output types when the smaller value isn't mentioned in the asm string. Extend this support from integers to also allowing fp values to be mismatched (if not mentioned in the asm string). llvm-svn: 102188
* I failed to notice that my last patch wasn't doing as much as it couldJohn McCall2010-04-211-2/+4
| | | | | | | because EmitBranch actually clears the insert point. This version actually accomplishes what I initially wanted. llvm-svn: 101998
* Teach EmitBlock to put the target block immediately after the current blockJohn McCall2010-04-211-1/+6
| | | | | | | | | | | (if there's a current block). The chief advantage of doing this is that it lets us pick blocks (e.g. EH blocks) to push to the end of the function so that fallthrough happens consistently --- i.e. it gives us the flexibility of ordering blocks as we please without having to change the order in which we generate code. There are standard (?) optimization passes which can do some of that for us, but better to generate reasonable code to begin with. llvm-svn: 101997
* Fix debug info for cleanup block.Devang Patel2010-04-131-1/+1
| | | | llvm-svn: 101100
* a ridiculous amount of propagation through the backend later, Chris Lattner2010-04-071-2/+9
| | | | | | | | | | | | | | | | have the code generate slap a srcloc metadata on inline asm nodes. This allows us to diagnose invalid inline asms with such nice diagnostics as: <inline asm>:1:2: error: unrecognized instruction abc incl %eax ^ asm.c:2:12: note: generated from here __asm__ ("abc incl %0" : "+r" (X)); ^ 2 diagnostics generated. llvm-svn: 100608
* When returning from a function that has a reference return type, useDouglas Gregor2010-03-241-1/+2
| | | | | | | | EmitReferenceBindingToExpr() rather than assuming we have an lvalue. This is just the lowest hanging fruit for PR6024, which still requires a bit of work. llvm-svn: 99447
* fix PR6475, we were doing side-effecting stuff in an assert.Chris Lattner2010-03-031-6/+5
| | | | llvm-svn: 97669
* Reapply r95393, without the change to CGExpr. I was wrong in assuming that theDaniel Dunbar2010-02-081-3/+2
| | | | | | element type always matched the converted LLVM type for ExprType. llvm-svn: 95596
* Revert r95393, which broke Clang's self-host.Douglas Gregor2010-02-051-2/+3
| | | | llvm-svn: 95430
* IRgen: Use hasAggregateLLVMType instead of isSingleValueType() for cases thatDaniel Dunbar2010-02-051-3/+2
| | | | | | | | need to deal with aggregates specially; this is consistent with the rest of IRgen. Also, simplify EmitParmDecl and don't worry about using Decl::getNameAsString. llvm-svn: 95393
* More asm cleanup.Anders Carlsson2010-01-301-6/+6
| | | | llvm-svn: 94920
* Yay for more StringRefs.Anders Carlsson2010-01-301-3/+2
| | | | llvm-svn: 94917
* Implement proper cleanup semantics for condition variables in forDouglas Gregor2009-11-251-11/+34
| | | | | | | | | | statements, e.g., for(; X x = X(); ) { ... } Daniel or Anders, please review! llvm-svn: 89832
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-251-0/+10
| | | | | | | | | | | | | | | | | 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-8/+46
| | | | | | | | | | | | | | | | | 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/+5
| | | | | | | 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-12/+16
| | | | | | | | | | | | | | | | - 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
* Explicitly track the condition variable within an "if" statement,Douglas Gregor2009-11-231-0/+2
| | | | | | | | | rather than burying it in a CXXConditionDeclExpr (that occassionally hides behind implicit conversions). Similar changes for switch, while, and do-while will follow, then the removal of CXXConditionDeclExpr. This commit is the canary. llvm-svn: 89717
* Wherein the TargetInfo argument to Preprocessor is made 'const' and propogated.Daniel Dunbar2009-11-131-1/+1
| | | | llvm-svn: 87087
* "Attach debug info with llvm instructions" mode was enabled a month ago. ↵Devang Patel2009-11-121-14/+0
| | | | | | Now make it permanent and remove old way of inserting intrinsics to encode debug info for locations and types. llvm-svn: 87007
* update comment, pointed out by GaborChris Lattner2009-11-061-3/+1
| | | | llvm-svn: 86263
* indirectbr seems to work! Rip out the old code.Chris Lattner2009-11-061-5/+0
| | | | llvm-svn: 86256
* Implement clang support for indirect branch and address of labelChris Lattner2009-10-281-0/+5
| | | | | | | | using the new LLVM support for this. This is temporarily hiding behind horrible and ugly #ifdefs until the time when the optimizer is stable (hopefully a week or so). Until then, lets make it "opt in" :) llvm-svn: 85446
* reimplement codegen for indirect goto with the following advantages:Chris Lattner2009-10-131-5/+12
| | | | | | | | | | | | | 1. CGF now has fewer bytes of state (one pointer instead of a vector). 2. The generated code is determinstic, instead of getting labels in 'map order' based on pointer addresses. 3. Clang now emits one 'indirect goto switch' for each function, instead of one for each indirect goto. This fixes an M*N = N^2 IR size issue when there are lots of address-taken labels and lots of indirect gotos. 4. This also makes the default cause do something useful, reducing the size of the jump table needed (by one). llvm-svn: 83952
* Add support to attach debug info to an instruction.Devang Patel2009-10-061-10/+24
| | | | | | This is not yet enabled. llvm-svn: 83399
* CodeGen for try statements. (We just emit the body for now).Anders Carlsson2009-09-271-0/+4
| | | | llvm-svn: 82910
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-103/+103
| | | | llvm-svn: 81346
* Update for LLVM API change.Owen Anderson2009-08-131-7/+7
| | | | llvm-svn: 78946
* Update for LLVM API change.Owen Anderson2009-08-051-1/+1
| | | | llvm-svn: 78259
* Revert the fix for PR3800, it broke things.Anders Carlsson2009-08-041-2/+5
| | | | llvm-svn: 78084
* Remove old code that was causing the new test to fail.Anders Carlsson2009-08-021-3/+0
| | | | llvm-svn: 77862
* Don't evaluate inout constraints twice. Fixes PR3800.Anders Carlsson2009-08-021-2/+2
| | | | llvm-svn: 77854
* Canonicalize else spacing.Mike Stump2009-07-301-1/+0
| | | | llvm-svn: 77629
OpenPOWER on IntegriCloud