summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExprScalar.cpp
AgeCommit message (Collapse)Author
2009-04-02Remove -ftrapu.Mike Stump
llvm-svn: 68330
2009-04-02Fixup -ftrapv to be more gcc compatible. -ftrapu (for want of aMike Stump
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
2009-04-01Add -ftrapv support, patch from David Chisnall; well all except theMike Stump
clang option code that is and two bug fixes. llvm-svn: 68240
2009-04-01Revert r68221, -ftrapv support, which causes several regressions inDouglas Gregor
Clang's test suite. llvm-svn: 68230
2009-04-01Add -ftrapv support, patch from David Chisnall; well all except theMike Stump
clang option code that is. llvm-svn: 68221
2009-03-28Trivial cleanup.Eli Friedman
llvm-svn: 67899
2009-03-28Misc small fixes/cleanups/comment changes.Eli Friedman
llvm-svn: 67895
2009-03-28Change compound assignment operators to keep track of both the promoted Eli Friedman
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
2009-03-23Fix a subtle bug in CodeGen for the increment of a bitfield.Eli Friedman
llvm-svn: 67499
2009-03-18fix PR3809, codegen for inc/dec of function pointers.Chris Lattner
llvm-svn: 67165
2009-03-16Almost complete implementation of rvalue references. One bug, and a few ↵Sebastian Redl
unclear areas. Maybe Doug can shed some light on some of the fixmes. llvm-svn: 67059
2009-03-07Back out the patch in r66302, and re-fix it properly. We assume for Eli Friedman
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
2009-03-07Codegen support for copy helpers for block literals.Mike Stump
llvm-svn: 66319
2009-03-06Fixed a bug where generation of read-barriers causedFariborz Jahanian
crash in ir-gen. llvm-svn: 66302
2009-03-04Minor cleanup for choose expressions: add a helper that returns the Eli Friedman
chosen sub-expression, rather than just evaluating the condition. llvm-svn: 66018
2009-03-04Attempt to fix PR3709: when converting from an integer to a pointer, Eli Friedman
first extend the integer to the correct width. llvm-svn: 66009
2009-02-28First cut CodeGen support for __block variables.Mike Stump
llvm-svn: 65688
2009-02-27Change the AST generated for offsetof a bit so that it looks like a Eli Friedman
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
2009-02-25CodeGen support for copied BlockDeclRefExprs.Mike Stump
llvm-svn: 65487
2009-02-24first wave of fixes for @encode sema support. This is part of PR3648.Chris Lattner
The big difference here is that (like string literal) @encode has array type, not pointer type. llvm-svn: 65391
2009-02-22Cleanp code with some recent suggestions.Mike Stump
llvm-svn: 65285
2009-02-21Add CodeGen support for the helper for BlockDeclRefExprs. The easierMike Stump
stuff is mostly done. Move BlockHasCopyDispose up. llvm-svn: 65242
2009-02-19More codegen for blocks. The type of block literals should be better.Mike Stump
The size calculation is improved. llvm-svn: 64994
2009-02-18rip out __builtin_overloadChris Lattner
llvm-svn: 64961
2009-02-14Generate the helper function for blocks. Now basic codegen isMike Stump
starting to work for blocks. llvm-svn: 64570
2009-02-13fix rdar://6586493, a bug in codegen of the GNU Chris Lattner
missing-?:-true-value extension. llvm-svn: 64505
2009-02-13Condense all the blocks code into CGBlocks.cpp.Mike Stump
llvm-svn: 64457
2009-02-12Initial codegen for block literals. This is a work in progress. I'veMike Stump
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
2009-02-11Use EmitVAListRef instead of EmitLValue directly to handle array decayDaniel Dunbar
case on x86_64. llvm-svn: 64333
2009-02-11Fix rdar://6518463, increment of a bool is always true, due toChris Lattner
subtle and non-obvious promotion rules. We already handle += and +1 correctly. llvm-svn: 64296
2009-02-11finish off codegen support for sub of pointer to functions, Chris Lattner
finishing off rdar://6520707 llvm-svn: 64295
2009-02-05Follow Eli's advice and store the VLA size with the native size_t type. ↵Anders Carlsson
Fixes PR3491. llvm-svn: 63879
2009-01-30Make sure to cast the VLA size of array to the type of size_t. Fixes PR3442.Anders Carlsson
llvm-svn: 63394
2009-01-29Make CodeGen produce an error if we come across a non-constant initializer ↵Douglas Gregor
list that involves the GNU array-range designator extension llvm-svn: 63327
2009-01-29Introduce a new expression node, ImplicitValueInitExpr, thatDouglas Gregor
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
2009-01-28Code generation support for C99 designated initializers.Douglas Gregor
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
2009-01-24Fix for PR2910: implement CodeGen for non-constant offsetof.Eli Friedman
Note that there are still other issues in this area; see PR3396. llvm-svn: 62942
2009-01-24Refactor sizeof handling to use constant folding logic for constant Eli Friedman
sizeof expressions. llvm-svn: 62941
2009-01-24remove a bunch of alignment handling code out of CGExprScalar, sinceChris Lattner
alignment must always be a constant. Just let the constant folder do it. llvm-svn: 62933
2009-01-23Handle pointer arithmetic on function pointers.Daniel Dunbar
- <rdar://problem/6518844> Clang-generated bitcode crashes LLVM while compiling function pointer addition expression llvm-svn: 62857
2009-01-20Slight cleanup, and fix for va_arg on architectures where va_list is a Eli Friedman
struct. llvm-svn: 62585
2009-01-18Vector codegen improvementsNate Begeman
llvm-svn: 62458
2009-01-16Changed the API yet again.Fariborz Jahanian
llvm-svn: 62335
2009-01-16Used a more suitable api to get to the type of a recordFariborz Jahanian
in code gen. llvm-svn: 62326
2009-01-16Implemented code gen for sizeof(objc class interface).Fariborz Jahanian
llvm-svn: 62289
2009-01-11make ScalarExprEmitter::EmitCompare() emit the expression with the correct ↵Nuno Lopes
type instead of always zext it to an int this fixes codegen of simple exprs in C++ like 'if (x != 0)' llvm-svn: 62060
2009-01-09Emit more refined "unsupported" error for block expressions.Daniel Dunbar
llvm-svn: 61993
2008-12-21Add codegen support for __nullAnders Carlsson
llvm-svn: 61314
2008-12-21Implement alignof for vla types.Anders Carlsson
llvm-svn: 61305
2008-12-21Make sure to emit the size expression for sizeof(type)Anders Carlsson
llvm-svn: 61301