summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change the representation of GNU ?: expressions to use a different expressionJohn McCall2011-02-171-42/+39
| | | | | | | | | | | | | | | | | | | | | | class and to bind the shared value using OpaqueValueExpr. This fixes an unnoticed problem with deserialization of these expressions where the deserialized form would lose the vital pointer-equality trait; or rather, it fixes it because this patch also does the right thing for deserializing OVEs. Change OVEs to not be a "temporary object" in the sense that copy elision is permitted. This new representation is not totally unawkward to work with, but I think that's really part and parcel with the semantics we're modelling here. In particular, it's much easier to fix things like the copy elision bug and to make the CFG look right. I've tried to update the analyzer to deal with this in at least some obvious cases, and I think we get a much better CFG out, but the printing of OpaqueValueExprs probably needs some work. llvm-svn: 125744
* Save a copy expression for non-trivial copy constructions of catch variables.John McCall2011-02-161-0/+8
| | | | llvm-svn: 125661
* Assorted cleanup:John McCall2011-02-151-3/+2
| | | | | | | | | - Have CGM precompute a number of commonly-used types - Have CGF copy that during initialization instead of recomputing them - Use TBAA info when initializing a parameter variable - Refactor the scalar ++/-- code llvm-svn: 125562
* update for ConstantVector API change.Chris Lattner2011-02-151-9/+7
| | | | llvm-svn: 125538
* revert my ConstantVector patch, it seems to have made the llvm-gccChris Lattner2011-02-141-7/+9
| | | | | | builders unhappy. llvm-svn: 125505
* update for ConstantVector::get API change.Chris Lattner2011-02-141-9/+7
| | | | llvm-svn: 125488
* For consistency, use llvm::raw_ostream in the rest of the mangle api.Rafael Espindola2011-02-111-2/+4
| | | | llvm-svn: 125360
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-081-30/+39
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-1/+3
| | | | | | | | | | | | | | | | | - BlockDeclRefExprs always store VarDecls - BDREs no longer store copy expressions - BlockDecls now store a list of captured variables, information about how they're captured, and a copy expression if necessary With that in hand, change IR generation to use the captures data in blocks instead of walking the block independently. Additionally, optimize block layout by emitting fields in descending alignment order, with a heuristic for filling in words when alignment of the end of the block header is insufficient for the most aligned field. llvm-svn: 125005
* More capturing of 'this': implicit member expressions. Getting thatJohn McCall2011-02-031-18/+4
| | | | | | | | | | | right for anonymous struct/union members led to me discovering some seemingly broken code in that area of Sema, which I fixed, partly by changing the representation of member pointer constants so that IndirectFieldDecls aren't expanded. This led to assorted cleanups with member pointers in CodeGen, and while I was doing that I saw some random other things to clean up. llvm-svn: 124785
* 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
OpenPOWER on IntegriCloud