summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExpr.cpp
AgeCommit message (Collapse)Author
2011-01-26Un-nest the meat of this function.John McCall
llvm-svn: 124310
2011-01-26Better framework for conditional cleanups; untested as yet.John McCall
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
2011-01-22Send code generation for xvalues down the same path as lvaluesDouglas Gregor
llvm-svn: 124023
2011-01-19Replace calls to getTypeSize() and getTypeAlign() with their 'InChars' Ken Dyck
counterparts where char units are needed. llvm-svn: 123805
2011-01-18Fix warnings found by gcc-4.6, from -Wunused-but-set-variable andJeffrey Yasskin
-Wint-to-pointer-cast. llvm-svn: 123719
2010-12-06Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall
reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
2010-12-06__block variables require us to evaluate the RHS of an assignment beforeJohn McCall
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
2010-12-05Fix a bug in the emission of __real/__imag l-values on scalar operands.John McCall
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
2010-12-04More anonymous struct/union redesign. This one deals with anonymous field ↵Francois Pichet
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
2010-12-04Remove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn'tJohn McCall
be required, and then fix up some missing loads on overloaded-operator paths which that exposed. llvm-svn: 120896
2010-12-04Although we currently have explicit lvalue-to-rvalue conversions, they'reJohn McCall
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
2010-12-04Test case for the l-value base only being evaluated once.John McCall
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
2010-12-04Kill the KVC l-value kind and calculate the base expression when emittingJohn McCall
the l-value. llvm-svn: 120884
2010-12-02Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall
ObjCPropertyRefExpr into the latter. llvm-svn: 120643
2010-12-01Restore the lvalue-to-rvalue conversion patch with a minimal fix.John McCall
llvm-svn: 120555
2010-11-30L-value to r-value conversion is not ready for prime-time.John McCall
llvm-svn: 120433
2010-11-30Introduce an r-value to l-value cast kind. I'm not promising anythingJohn McCall
about the reliability of this yet. llvm-svn: 120422
2010-11-25Hide a bunch of symbols.Benjamin Kramer
llvm-svn: 120153
2010-11-24Switch a lot of call-sites over to using the new value-kind calculations.John McCall
llvm-svn: 120084
2010-11-19Minor cleanup. No change otherwise.Fariborz Jahanian
llvm-svn: 119814
2010-11-18Fix a bug where write-barriers for assignment through referenceFariborz Jahanian
types was not being generated for objc pointers. // rdar://8681766. llvm-svn: 119751
2010-11-16Support compound complex operations as l-values in C++. Add a testJohn McCall
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
2010-11-16Simplify some complex emission and implement correct semantics forJohn McCall
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
2010-11-16Kill CK_Unknown and flesh out the documentation for the existing CastKinds.John McCall
llvm-svn: 119331
2010-11-15Assorted work leading towards the elimination of CK_Unknown.John McCall
llvm-svn: 119138
2010-11-14Add a few more complex-related cast kinds that arise due to arbitraryJohn McCall
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
2010-11-13Introduce five new cast kinds for various conversions into andJohn McCall
between complex types. llvm-svn: 118994
2010-11-13Introduce a null-to-pointer implicit cast kind.John McCall
llvm-svn: 118966
2010-11-09Fix miscompilation regarding VLAs; subscription of VLA pointers was incorrect.Argyrios Kyrtzidis
Fixes rdar://8644873 & http://llvm.org/PR8567. llvm-svn: 118468
2010-10-27Restore r117403 (fixing IR gen for bool atomics), this time being less John McCall
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
2010-10-27Revert r117403 as it caused PR8480.Rafael Espindola
llvm-svn: 117456
2010-10-26Extract procedures to do scalar-to-memory and memory-to-scalar conversionsJohn McCall
in IR gen, and use those to fix a correctness issue with bool atomic intrinsics. rdar://problem/8461234 llvm-svn: 117403
2010-10-25Trim an unnecessary #include.Dan Gohman
llvm-svn: 117321
2010-10-15Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall
ambiguous context. llvm-svn: 116567
2010-10-14Experimental TBAA support.Dan Gohman
This enables metadata generation by default, however the TBAA pass in the optimizer is still disabled for now. llvm-svn: 116536
2010-10-14Eliminate usage of ObjCSuperExpr used forFariborz Jahanian
'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
2010-10-08Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked aDouglas Gregor
bit by me). llvm-svn: 116122
2010-09-21IRgen for gnu extension's conditional lvalue expressionFariborz Jahanian
with missing LHS. radar 8453812. Executable test is checked into llvm test suite. llvm-svn: 114457
2010-09-18Fixes IRgen bug in objc++ reference binding of aFariborz Jahanian
getter expression. Fixes // rdar://8437240 llvm-svn: 114299
2010-09-18Fix a bug with binding l-values to elided temporaries, and leave a coupleJohn McCall
helpful asserts behind. llvm-svn: 114250
2010-09-15one piece of code is responsible for the lifetime of every aggregateJohn McCall
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
2010-09-07Local static block variable referecned in itsFariborz Jahanian
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
2010-09-06clean up some formatting.Chris Lattner
llvm-svn: 113129
2010-09-03Truncate block variable of bool type to i1 when itsFariborz Jahanian
value is used. This matches with non-block variable use of bool type. (Fixes radar 8390062). llvm-svn: 113027
2010-09-03Cope with llvm's reference to bool type of 'i1' vs. clang'sFariborz Jahanian
type of 'i8' for the same for __block variables of type bool. refixes radar 8382559. llvm-svn: 113015
2010-09-01Fix IRGen when property-dot syntax used to accessFariborz Jahanian
a c++ class object 'ivar'. Fixes radar 8366604. llvm-svn: 112729
2010-08-31Amusingly, I missed this point of abstraction in all my earlierJohn McCall
member-pointer refactoring: dereferencing a member data pointer. llvm-svn: 112640
2010-08-31Teach IR generation to return 'this' from constructors and destructorsJohn McCall
under the ARM ABI. llvm-svn: 112588
2010-08-25GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall
to the new constants. llvm-svn: 112047
2010-08-23fix rdar://8340348, a miscompile of boost that was exposed by r109848.Chris Lattner
That revision started classifying truly empty structs like "Y" and "X" as being NoClass/NoClass and turning them into 'ignore'. The call code turns around and allocates space for the ignored argument with GetUndefRValue. The bug is that GetUndefRValue would return the address as undef, instead of returning an object with a defined address but undefined contents. llvm-svn: 111794