summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Update for LLVM API change.Owen Anderson2009-07-241-6/+7
| | | | llvm-svn: 77012
* Detect when the current generation point is unreachable after emittingDaniel Dunbar2009-07-191-3/+12
| | | | | | | | | | expressions. - This generally catches the important case of noreturn functions. - With the last two changes, we are down to 152 unreachable blocks emitted on 403.gcc, vs the 1805 we started with. llvm-svn: 76364
* Fix thinko.Daniel Dunbar2009-07-191-0/+7
| | | | llvm-svn: 76362
* Avoid generation of dead code in a few more situations.Daniel Dunbar2009-07-191-8/+19
| | | | | | | | | | | | | - Emit variable declarations as "simple", we want to avoid forcing the creation of a dummy basic block, but still need to make the variable available for later use. - With that, we can now skip IRgen for other unreachable statements (which don't define a label). - Anders, I added two fixmes on calls to EmitVLASize, can you check them? llvm-svn: 76361
* Update for LLVM API change.Owen Anderson2009-07-161-5/+5
| | | | llvm-svn: 76090
* Add IRGen support for return statements in functions with reference Eli Friedman2009-05-271-0/+4
| | | | | | type. llvm-svn: 72459
* Fixup codegen for volatile structs in the trivial cases (a a=a and a=a=a).Mike Stump2009-05-261-1/+1
| | | | llvm-svn: 72439
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-1/+1
| | | | llvm-svn: 72210
* "Fix" a problem with debug info in the presence of always_inlineChris Lattner2009-05-041-2/+9
| | | | | | | | | | | | | | | | | | | function calls. For a program like this: #include <stdio.h> static __inline__ __attribute__((always_inline)) int bar(int x) { return 4; } int main() { int X = bar(4); printf("%d\n", X); } clang was not outputing any debug info for the body of main(). This is because the backend is getting confused by the region_start/end that clang is emitting for block scopes. For now, just disable these (matching llvm-gcc), this stuff is in progress of rework anyway. llvm-svn: 70889
* Remove unnecessary copy of constraint info.Daniel Dunbar2009-05-041-1/+1
| | | | llvm-svn: 70835
* Remove unnecessary push_back (at least, I think it's unnecessary); Eli Friedman2009-05-041-2/+0
| | | | | | hopefully, this fixes PR4144 without any regressions. llvm-svn: 70823
* look at the right operand when increasing the size of an asm output,Chris Lattner2009-05-031-3/+1
| | | | | | this fixes http://llvm.org/bugs/show_bug.cgi?id=3373#c20 llvm-svn: 70685
* don't shadow 'i'Chris Lattner2009-05-031-5/+7
| | | | llvm-svn: 70680
* add support for tying asm operands where the result is smaller thanChris Lattner2009-05-031-15/+64
| | | | | | the input. This is part of PR3373. llvm-svn: 70677
* implement support for asm outputs targetting non-simple lvalue destinationsChris Lattner2009-05-031-11/+13
| | | | | | like bitfields. incidentally llvm-gcc crashes on this sort of thing also. :) llvm-svn: 70675
* handle codegen of asms where a small input is tied to a large output.Chris Lattner2009-05-031-0/+22
| | | | llvm-svn: 70672
* refactor some code to get the input/output constraint info beforeChris Lattner2009-05-031-15/+27
| | | | | | processing the outputs, no functionality change. llvm-svn: 70671
* Don't use indirect memory destinations for inline asm. Fixes 6841383.Anders Carlsson2009-05-011-15/+27
| | | | llvm-svn: 70523
* pull operands names "[foo]" into ConstraintInfo.Chris Lattner2009-04-261-14/+11
| | | | llvm-svn: 70136
* pull the constraint string into the ConstraintInfo structChris Lattner2009-04-261-6/+4
| | | | | | instead of passing it around in addition to it. llvm-svn: 70135
* change TargetInfo::ConstraintInfo to be a struct that containsChris Lattner2009-04-261-6/+4
| | | | | | the enum along with some other data. llvm-svn: 70114
* Minor simplification.Eli Friedman2009-04-131-6/+1
| | | | llvm-svn: 68992
* Fix a subtle bug where the cleanup scope entries had a dangling block referenceDaniel Dunbar2009-04-011-14/+27
| | | | | | | | | - <rdar://problem/6732143> Crash when generating @synchronize for zero-cost exception - Thanks to Anders for helping track down the problem. llvm-svn: 68186
* introduce a new -fheinous-gnu-extensions flag that enables reallyChris Lattner2009-03-131-1/+6
| | | | | | | | | | | really horrible extensions that are disabled by default but that can be accepted by -fheinous-gnu-extensions (but which always emit a warning when enabled). As our first instance of this, implement PR3788/PR3794, which allows non-lvalues in inline asms in contexts where lvalues are required. bleh. llvm-svn: 66910
* add plumbing to report diagnostics back through sema for malformed asmstrings.Chris Lattner2009-03-101-1/+2
| | | | llvm-svn: 66598
* move the asm string analysis code out of codegen into common Chris Lattner2009-03-101-112/+15
| | | | | | code where Sema can get to it. No functionality change. llvm-svn: 66596
* Fix PR3682 by just disabling a broken assertion. This check should beChris Lattner2009-03-101-3/+2
| | | | | | | | done in sema, and is reflected by the existing PR3258. In the meantime, fix PR3682 by disabling a bogus assertion (which doesn't account for + operands). llvm-svn: 66533
* reduce duplication of parsing code between %0 and %x0 andChris Lattner2009-03-101-19/+18
| | | | | | add support for modifiers on named references, like %c[foo]. llvm-svn: 66532
* move matching of named operands into AsmStmt class. At the sameChris Lattner2009-03-101-24/+5
| | | | | | | time handle + operands in operand counting, fixing asm.c:t7 to expand into $2 instead of $1. llvm-svn: 66531
OpenPOWER on IntegriCloud