summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* When producing IR for a lvalue-to-rvalue cast *as an lvalue*, onlyDouglas Gregor2011-01-271-2/+3
| | | | | | | | | non-class prvalues actually require the realization of a temporary. For everything else, we already have an lvalue (or class prvalue) in the subexpression. Note: we're missing some move elision in this case. I'll tackle that next. llvm-svn: 124453
* Fixes an IRgen bug where __block variable isFariborz Jahanian2011-01-261-6/+3
| | | | | | | referenced in the block-literal initializer of that variable. // rdar://8893785 llvm-svn: 124332
* Un-nest the meat of this function.John McCall2011-01-261-54/+53
| | | | llvm-svn: 124310
* Better framework for conditional cleanups; untested as yet.John McCall2011-01-261-15/+16
| | | | | | | | I'm separately committing this because it incidentally changes some block orderings and minor IR issues, like using a phi instead of an unnecessary alloca. llvm-svn: 124277
* Send code generation for xvalues down the same path as lvaluesDouglas Gregor2011-01-221-1/+1
| | | | llvm-svn: 124023
* Replace calls to getTypeSize() and getTypeAlign() with their 'InChars' Ken Dyck2011-01-191-1/+2
| | | | | | counterparts where char units are needed. llvm-svn: 123805
* Fix warnings found by gcc-4.6, from -Wunused-but-set-variable andJeffrey Yasskin2011-01-181-2/+0
| | | | | | -Wint-to-pointer-cast. llvm-svn: 123719
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-061-3/+3
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* __block variables require us to evaluate the RHS of an assignment beforeJohn McCall2010-12-061-3/+3
| | | | | | | | | | the LHS, or else the pointer might be invalid. This is kindof dumb, but go ahead and make sure we're doing that for l-value scalar assignment, which fixes a miscompile of obj-c++.dg/block-seq.mm. Leave a FIXME for how to solve this problem for agg __blocks. llvm-svn: 120992
* Fix a bug in the emission of __real/__imag l-values on scalar operands.John McCall2010-12-051-12/+29
| | | | | | | | | Fix a bug in the emission of complex compound assignment l-values. Introduce a method to emit an expression whose value isn't relevant. Make that method evaluate its operand as an l-value if it is one. Fixes our volatile compliance in C++. llvm-svn: 120931
* More anonymous struct/union redesign. This one deals with anonymous field ↵Francois Pichet2010-12-041-15/+5
| | | | | | | | | | | | | | | | used in a constructor initializer list: struct X { X() : au_i1(123) {} union { int au_i1; float au_f1; }; }; clang will now deal with au_i1 explicitly as an IndirectFieldDecl. llvm-svn: 120900
* Remove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn'tJohn McCall2010-12-041-32/+3
| | | | | | | be required, and then fix up some missing loads on overloaded-operator paths which that exposed. llvm-svn: 120896
* Although we currently have explicit lvalue-to-rvalue conversions, they'reJohn McCall2010-12-041-0/+15
| | | | | | | | | | | | | | | | | | | not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. llvm-svn: 120890
* Test case for the l-value base only being evaluated once.John McCall2010-12-041-16/+0
| | | | | | | | | | Also, move the l-value emission code into CGObjC.cpp and teach it, for completeness, to store away self for a super send. Also, inline the super cases for property gets and sets and make them use the correct result type for implicit getter/setter calls. llvm-svn: 120887
* Kill the KVC l-value kind and calculate the base expression when emittingJohn McCall2010-12-041-48/+20
| | | | | | the l-value. llvm-svn: 120884
* Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall2010-12-021-16/+9
| | | | | | | | ObjCPropertyRefExpr into the latter. llvm-svn: 120643
* Restore the lvalue-to-rvalue conversion patch with a minimal fix.John McCall2010-12-011-2/+2
| | | | llvm-svn: 120555
* L-value to r-value conversion is not ready for prime-time.John McCall2010-11-301-2/+2
| | | | llvm-svn: 120433
* Introduce an r-value to l-value cast kind. I'm not promising anythingJohn McCall2010-11-301-2/+2
| | | | | | about the reliability of this yet. llvm-svn: 120422
* Hide a bunch of symbols.Benjamin Kramer2010-11-251-25/+25
| | | | llvm-svn: 120153
* Switch a lot of call-sites over to using the new value-kind calculations.John McCall2010-11-241-5/+5
| | | | llvm-svn: 120084
* Minor cleanup. No change otherwise.Fariborz Jahanian2010-11-191-2/+4
| | | | llvm-svn: 119814
* Fix a bug where write-barriers for assignment through referenceFariborz Jahanian2010-11-181-1/+1
| | | | | | | types was not being generated for objc pointers. // rdar://8681766. llvm-svn: 119751
* Support compound complex operations as l-values in C++. Add a testJohn McCall2010-11-161-5/+13
| | | | | | | case based on CodeGen/volatile-1.c which tests the current C++ semantics, and note the many, many places we fall short of them. llvm-svn: 119402
* Simplify some complex emission and implement correct semantics forJohn McCall2010-11-161-2/+1
| | | | | | | | | assignment to volatiles in C. This in effect reverts some of mjs's work in and around r72572. Basically, the C++ standard is quite clear, except that it lies about volatile behavior approximating C's, whereas the C standard is almost actively misleading. llvm-svn: 119344
* Kill CK_Unknown and flesh out the documentation for the existing CastKinds.John McCall2010-11-161-1/+0
| | | | llvm-svn: 119331
* Assorted work leading towards the elimination of CK_Unknown.John McCall2010-11-151-2/+8
| | | | llvm-svn: 119138
* Add a few more complex-related cast kinds that arise due to arbitraryJohn McCall2010-11-141-1/+6
| | | | | | | | | | implicit conversions; the last batch was specific to promotions. I think this is the full set we need. I do think dividing the cast kinds into floating and integral is probably a good idea. Annotate a *lot* more C casts with useful cast kinds. llvm-svn: 119036
* Introduce five new cast kinds for various conversions into andJohn McCall2010-11-131-0/+5
| | | | | | between complex types. llvm-svn: 118994
* Introduce a null-to-pointer implicit cast kind.John McCall2010-11-131-0/+1
| | | | llvm-svn: 118966
* Fix miscompilation regarding VLAs; subscription of VLA pointers was incorrect.Argyrios Kyrtzidis2010-11-091-7/+4
| | | | | | Fixes rdar://8644873 & http://llvm.org/PR8567. llvm-svn: 118468
* Restore r117403 (fixing IR gen for bool atomics), this time being less John McCall2010-10-271-14/+25
| | | | | | | aggressive about the form we expect bools to be in. I don't really have time to fix all the sources right now. llvm-svn: 117486
* Revert r117403 as it caused PR8480.Rafael Espindola2010-10-271-22/+14
| | | | llvm-svn: 117456
* Extract procedures to do scalar-to-memory and memory-to-scalar conversionsJohn McCall2010-10-261-14/+22
| | | | | | | in IR gen, and use those to fix a correctness issue with bool atomic intrinsics. rdar://problem/8461234 llvm-svn: 117403
* Trim an unnecessary #include.Dan Gohman2010-10-251-1/+0
| | | | llvm-svn: 117321
* Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall2010-10-151-2/+1
| | | | | | ambiguous context. llvm-svn: 116567
* Experimental TBAA support.Dan Gohman2010-10-141-4/+13
| | | | | | | This enables metadata generation by default, however the TBAA pass in the optimizer is still disabled for now. llvm-svn: 116536
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-141-7/+0
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked aDouglas Gregor2010-10-081-1/+7
| | | | | | bit by me). llvm-svn: 116122
* IRgen for gnu extension's conditional lvalue expressionFariborz Jahanian2010-09-211-5/+17
| | | | | | | with missing LHS. radar 8453812. Executable test is checked into llvm test suite. llvm-svn: 114457
* Fixes IRgen bug in objc++ reference binding of aFariborz Jahanian2010-09-181-1/+9
| | | | | | | getter expression. Fixes // rdar://8437240 llvm-svn: 114299
* Fix a bug with binding l-values to elided temporaries, and leave a coupleJohn McCall2010-09-181-3/+7
| | | | | | helpful asserts behind. llvm-svn: 114250
* one piece of code is responsible for the lifetime of every aggregateJohn McCall2010-09-151-23/+22
| | | | | | | | | | | | | slot. The easiest way to do that was to bundle up the information we care about for aggregate slots into a new structure which demands that its creators at least consider the question. I could probably be convinced that the ObjC 'needs GC' bit should be rolled into this structure. Implement generalized copy elision. The main obstacle here is that IR-generation must be much more careful about making sure that exactly llvm-svn: 113962
* Local static block variable referecned in itsFariborz Jahanian2010-09-071-2/+1
| | | | | | | | block-literal initializer expression causes IRgen to crash. This patch fixes by saving it in StaticLocalDecl map already used for such purposes. (radar 8390455). llvm-svn: 113307
* clean up some formatting.Chris Lattner2010-09-061-14/+14
| | | | llvm-svn: 113129
* Truncate block variable of bool type to i1 when itsFariborz Jahanian2010-09-031-18/+0
| | | | | | | value is used. This matches with non-block variable use of bool type. (Fixes radar 8390062). llvm-svn: 113027
* Cope with llvm's reference to bool type of 'i1' vs. clang'sFariborz Jahanian2010-09-031-0/+17
| | | | | | | type of 'i8' for the same for __block variables of type bool. refixes radar 8382559. llvm-svn: 113015
* Fix IRGen when property-dot syntax used to accessFariborz Jahanian2010-09-011-4/+9
| | | | | | a c++ class object 'ivar'. Fixes radar 8366604. llvm-svn: 112729
* Amusingly, I missed this point of abstraction in all my earlierJohn McCall2010-08-311-9/+8
| | | | | | member-pointer refactoring: dereferencing a member data pointer. llvm-svn: 112640
* Teach IR generation to return 'this' from constructors and destructorsJohn McCall2010-08-311-1/+2
| | | | | | under the ARM ABI. llvm-svn: 112588
OpenPOWER on IntegriCloud