summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixup blocks codegen for { __block i; i = rhs(); }, we want the rhsMike Stump2009-05-211-1/+3
| | | | | | | evaluated first. This can also improve codegen just a bit as we might have another register to play with for the evaluation of the rhs. llvm-svn: 72226
* Don't always zext the result of the not unary operator to an int.Anders Carlsson2009-05-191-2/+2
| | | | llvm-svn: 72117
* Have AggExprEmitter::VisitCXXConstructExpr make new variables if necessary. ↵Anders Carlsson2009-05-191-0/+5
| | | | | | Stub out VisitCXXExprWithTemporaries. llvm-svn: 72103
* Fix pointer addressing and array subscripting of Objective-C interfaceDaniel Dunbar2009-04-251-2/+29
| | | | | | | | | | | types. - I broke this in the switch to representing interfaces with opaque types. - <rdar://problem/6822660> clang crashes on subscript of interface in 32-bit mode llvm-svn: 70009
* Clang part of r69947. Reverting back 69574 as it is no longer needed.Sanjiv Gupta2009-04-241-10/+4
| | | | llvm-svn: 69949
* PR3247: Handle a couple of cases where we weren't emitting VLA sizes (and Eli Friedman2009-04-201-1/+5
| | | | | | subsequently crashed). llvm-svn: 69567
* PR3248: Make sure the evaluate the operand of a sizeof when it has a VLA type.Eli Friedman2009-04-201-0/+4
| | | | | | Adapted from patch by Tim Northover. llvm-svn: 69566
* Support code generation of 'this' exprsAnders Carlsson2009-04-141-0/+5
| | | | llvm-svn: 69050
* Make sure value is initialized when built w/o asserts.Daniel Dunbar2009-04-081-0/+1
| | | | llvm-svn: 68615
* Pointer width on targets like PIC16 is 16-bit, while the valid index size to ↵Sanjiv Gupta2009-04-081-4/+10
| | | | | | GEP is only 32 or 64. So promote index to 32 in such cases. llvm-svn: 68590
* Remove -ftrapu.Mike Stump2009-04-021-57/+28
| | | | llvm-svn: 68330
* Fixup -ftrapv to be more gcc compatible. -ftrapu (for want of aMike Stump2009-04-021-3/+17
| | | | | | | | | | better name) is the option that SmallTalk can use to intercept all overflows, including unsigned. I added some testcases so we don't break anything. Also included is another patch from David for += and friends. llvm-svn: 68267
* Add -ftrapv support, patch from David Chisnall; well all except theMike Stump2009-04-011-2/+115
| | | | | | clang option code that is and two bug fixes. llvm-svn: 68240
* Revert r68221, -ftrapv support, which causes several regressions inDouglas Gregor2009-04-011-111/+0
| | | | | | Clang's test suite. llvm-svn: 68230
* Add -ftrapv support, patch from David Chisnall; well all except theMike Stump2009-04-011-0/+111
| | | | | | clang option code that is. llvm-svn: 68221
* Trivial cleanup.Eli Friedman2009-03-281-2/+2
| | | | llvm-svn: 67899
* Misc small fixes/cleanups/comment changes.Eli Friedman2009-03-281-20/+28
| | | | llvm-svn: 67895
* Change compound assignment operators to keep track of both the promoted Eli Friedman2009-03-281-62/+17
| | | | | | | | | | | | | | | | | LHS type and the computation result type; this encodes information into the AST which is otherwise non-obvious. Fix Sema to always come up with the right answer for both of these types. Fix IRGen and the analyzer to account for these changes. This fixes PR2601. The approach is inspired by PR2601 comment 2. Note that this changes real *= complex in CodeGen from a silent miscompilation to an explicit error. I'm not really sure that the analyzer changes are correct, or how to test them... someone more familiar with the analyzer should check those changes. llvm-svn: 67889
* Fix a subtle bug in CodeGen for the increment of a bitfield.Eli Friedman2009-03-231-5/+7
| | | | llvm-svn: 67499
* fix PR3809, codegen for inc/dec of function pointers.Chris Lattner2009-03-181-3/+11
| | | | llvm-svn: 67165
* Almost complete implementation of rvalue references. One bug, and a few ↵Sebastian Redl2009-03-161-0/+1
| | | | | | unclear areas. Maybe Doug can shed some light on some of the fixmes. llvm-svn: 67059
* Back out the patch in r66302, and re-fix it properly. We assume for Eli Friedman2009-03-071-3/+0
| | | | | | | | performance that the type of the returned llvm::Value for an expression matches the converted type of the clang::Expr; mismatches will cause all sorts of errors and silent miscompilations. llvm-svn: 66321
* Codegen support for copy helpers for block literals.Mike Stump2009-03-071-2/+1
| | | | llvm-svn: 66319
* Fixed a bug where generation of read-barriers causedFariborz Jahanian2009-03-061-0/+3
| | | | | | crash in ir-gen. llvm-svn: 66302
* Minor cleanup for choose expressions: add a helper that returns the Eli Friedman2009-03-041-3/+1
| | | | | | chosen sub-expression, rather than just evaluating the condition. llvm-svn: 66018
* Attempt to fix PR3709: when converting from an integer to a pointer, Eli Friedman2009-03-041-1/+8
| | | | | | first extend the integer to the correct width. llvm-svn: 66009
* First cut CodeGen support for __block variables.Mike Stump2009-02-281-32/+3
| | | | llvm-svn: 65688
* Change the AST generated for offsetof a bit so that it looks like a Eli Friedman2009-02-271-40/+2
| | | | | | | | normal expression, and change Evaluate and IRGen to evaluate it like a normal expression. This simplifies the code significantly, and fixes PR3396. llvm-svn: 65622
* CodeGen support for copied BlockDeclRefExprs.Mike Stump2009-02-251-7/+3
| | | | llvm-svn: 65487
* first wave of fixes for @encode sema support. This is part of PR3648.Chris Lattner2009-02-241-17/+4
| | | | | | | The big difference here is that (like string literal) @encode has array type, not pointer type. llvm-svn: 65391
* Cleanp code with some recent suggestions.Mike Stump2009-02-221-7/+1
| | | | llvm-svn: 65285
* Add CodeGen support for the helper for BlockDeclRefExprs. The easierMike Stump2009-02-211-0/+45
| | | | | | stuff is mostly done. Move BlockHasCopyDispose up. llvm-svn: 65242
* More codegen for blocks. The type of block literals should be better.Mike Stump2009-02-191-4/+1
| | | | | | The size calculation is improved. llvm-svn: 64994
* rip out __builtin_overloadChris Lattner2009-02-181-6/+0
| | | | llvm-svn: 64961
* Generate the helper function for blocks. Now basic codegen isMike Stump2009-02-141-1/+1
| | | | | | starting to work for blocks. llvm-svn: 64570
* fix rdar://6586493, a bug in codegen of the GNU Chris Lattner2009-02-131-9/+19
| | | | | | missing-?:-true-value extension. llvm-svn: 64505
* Condense all the blocks code into CGBlocks.cpp.Mike Stump2009-02-131-132/+1
| | | | llvm-svn: 64457
* Initial codegen for block literals. This is a work in progress. I'veMike Stump2009-02-121-6/+142
| | | | | | | | tried to put FIXMEs on the most important things to fix up. Lots left to do including more codegen, more documentation and cleaning code and style cleanups. llvm-svn: 64390
* Use EmitVAListRef instead of EmitLValue directly to handle array decayDaniel Dunbar2009-02-111-1/+0
| | | | | | case on x86_64. llvm-svn: 64333
* Fix rdar://6518463, increment of a bool is always true, due toChris Lattner2009-02-111-0/+7
| | | | | | | subtle and non-obvious promotion rules. We already handle += and +1 correctly. llvm-svn: 64296
* finish off codegen support for sub of pointer to functions, Chris Lattner2009-02-111-2/+7
| | | | | | finishing off rdar://6520707 llvm-svn: 64295
* Follow Eli's advice and store the VLA size with the native size_t type. ↵Anders Carlsson2009-02-051-3/+1
| | | | | | Fixes PR3491. llvm-svn: 63879
* Make sure to cast the VLA size of array to the type of size_t. Fixes PR3442.Anders Carlsson2009-01-301-1/+4
| | | | llvm-svn: 63394
* Make CodeGen produce an error if we come across a non-constant initializer ↵Douglas Gregor2009-01-291-0/+4
| | | | | | list that involves the GNU array-range designator extension llvm-svn: 63327
* Introduce a new expression node, ImplicitValueInitExpr, thatDouglas Gregor2009-01-291-0/+3
| | | | | | | | | | | | | represents an implicit value-initialization of a subobject of a particular type. This replaces the (ab)use of CXXZeroValueInitExpr within initializer lists for the "holes" that occur due to the use of C99 designated initializers. The new test case is currently XFAIL'd, because CodeGen's ConstExprEmitter (in lib/CodeGen/CGExprConstant.cpp) needs to be taught to value-initialize when it sees ImplicitValueInitExprs. llvm-svn: 63317
* Code generation support for C99 designated initializers.Douglas Gregor2009-01-281-5/+0
| | | | | | | | | | | | | | | | | | | | The approach I've taken in this patch is relatively straightforward, although the code itself is non-trivial. Essentially, as we process an initializer list we build up a fully-explicit representation of the initializer list, where each of the subobject initializations occurs in order. Designators serve to "fill in" subobject initializations in a non-linear way. The fully-explicit representation makes initializer lists (both with and without designators) easy to grok for codegen and later semantic analyses. We keep the syntactic form of the initializer list linked into the AST for those clients interested in exactly what the user wrote. Known limitations: - Designating a member of a union that isn't the first member may result in bogus initialization (we warn about this) - GNU array-range designators are not supported (we warn about this) llvm-svn: 63242
* Fix for PR2910: implement CodeGen for non-constant offsetof.Eli Friedman2009-01-241-7/+42
| | | | | | Note that there are still other issues in this area; see PR3396. llvm-svn: 62942
* Refactor sizeof handling to use constant folding logic for constant Eli Friedman2009-01-241-36/+14
| | | | | | sizeof expressions. llvm-svn: 62941
* remove a bunch of alignment handling code out of CGExprScalar, sinceChris Lattner2009-01-241-20/+18
| | | | | | | alignment must always be a constant. Just let the constant folder do it. llvm-svn: 62933
* Handle pointer arithmetic on function pointers.Daniel Dunbar2009-01-231-5/+28
| | | | | | - <rdar://problem/6518844> Clang-generated bitcode crashes LLVM while compiling function pointer addition expression llvm-svn: 62857
OpenPOWER on IntegriCloud