summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprComplex.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-061-2/+2
| | | | | | 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-1/+1
| | | | | | | | | | 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-7/+8
| | | | | | | | | 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
* Remove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn'tJohn McCall2010-12-041-16/+19
| | | | | | | 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-1/+16
| | | | | | | | | | | | | | | | | | | 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
* Kill the KVC l-value kind and calculate the base expression when emittingJohn McCall2010-12-041-19/+7
| | | | | | the l-value. llvm-svn: 120884
* Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall2010-12-021-4/+0
| | | | | | | | ObjCPropertyRefExpr into the latter. llvm-svn: 120643
* Support compound complex operations as l-values in C++. Add a testJohn McCall2010-11-161-0/+23
| | | | | | | 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-62/+65
| | | | | | | | | 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
* Teach complex compound assignment IR-generation that the RHS ofJohn McCall2010-11-161-3/+7
| | | | | | a compound assignment is always already in the computation type. llvm-svn: 119330
* Always emit full loads from volatile complex l-values.John McCall2010-11-141-10/+3
| | | | | | | | Return the result of a complex assignment with the original values, not by performing a load from the l-value; this is the correct semantics in C, although not in C++. llvm-svn: 119037
* Add a few more complex-related cast kinds that arise due to arbitraryJohn McCall2010-11-141-0/+2
| | | | | | | | | | 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/+2
| | | | | | between complex types. llvm-svn: 118994
* Implements in IRgen gnu extensions missing LHS forFariborz Jahanian2010-09-201-13/+20
| | | | | | complex conditionals. Radar 8453812. llvm-svn: 114376
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-251-2/+2
| | | | | | to the new constants. llvm-svn: 112047
* Add lvalue-bitcast support for complex numbers.Douglas Gregor2010-07-141-5/+16
| | | | llvm-svn: 108363
* Whenever we're creating an expression that is typically an rvalueDouglas Gregor2010-07-131-2/+2
| | | | | | | | | | | | | | | | (e.g., a call, cast, etc.), immediately adjust the expression's type to strip cv-qualifiers off of all non-class types (in C++) or all types (in C). This effectively extends my previous fix for PR7463, which was restricted to calls, to other kinds of expressions within similar characteristics. I've audited every use of getNonReferenceType() in the code base, switching to the newly-renamed getNonLValueExprType() where necessary. Big thanks to Eli for pointing out just how incomplete my original fix for PR7463 actually was. We've been handling cv-qualifiers on rvalues wrong for a very, very long time. Fixes PR7463. llvm-svn: 108253
* Reinstate the fix for PR7556. A silly use of isTrivial() wasDouglas Gregor2010-07-081-1/+1
| | | | | | suppressing copies of objects with trivial copy constructors. llvm-svn: 107857
* Revert r107828 and r107827, the fix for PR7556, which seems to beDouglas Gregor2010-07-071-1/+1
| | | | | | breaking bootstrap on Linux. llvm-svn: 107837
* Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect itsDouglas Gregor2010-07-071-1/+1
| | | | | | newly-narrowed scope. No functionality change. llvm-svn: 107828
* IRgen: Assignment to Objective-C properties shouldn't reload the value, forDaniel Dunbar2010-06-291-38/+36
| | | | | | | | complex values either. Previously we did this properly for regular assignment, but not for compound assignment. - Also, tidy up assignment code a bit to look more like the scalar path. llvm-svn: 107217
* Code gen for compound assignment of complexFariborz Jahanian2010-03-231-2/+7
| | | | | | | types using property syntax to access setter/getters. (also radar 7351147). llvm-svn: 99307
* Patch to implement code gen. use of compound assignent onFariborz Jahanian2010-03-231-6/+19
| | | | | | properties of complex type. Radar 7351147. llvm-svn: 99299
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-151-6/+6
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96224
* refactor pre/postinc logic into CGF and require the caller to pass in theChris Lattner2010-01-091-35/+4
| | | | | | lvalue to poke, no functionality change. llvm-svn: 93075
* Minor optimization; emit proper unsupported messages for a couple of cases.Eli Friedman2009-12-251-2/+9
| | | | llvm-svn: 92153
* Simplify code. No functionality change.Benjamin Kramer2009-11-291-22/+6
| | | | llvm-svn: 90087
* Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.Benjamin Kramer2009-11-281-2/+1
| | | | llvm-svn: 90044
* Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall2009-09-211-10/+10
| | | | | | | | | | | Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. llvm-svn: 82501
* Reflow comments and some minor whitespace fixups.Mike Stump2009-09-091-66/+65
| | | | llvm-svn: 81337
* Using "ObjCImplicitSetterGetterRefExpr" instead of ↵Fariborz Jahanian2009-08-201-2/+2
| | | | | | | | "ObjCImplctSetterGetterRefExpr". A field rename and more comments. llvm-svn: 79537
* Switch to SmallString::str from SmallString::c_str.Daniel Dunbar2009-08-191-4/+11
| | | | | | - Several FIXMEs due to non-Twinification of IRBuilder. llvm-svn: 79455
* Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.Fariborz Jahanian2009-08-181-1/+2
| | | | | | | | Removed an unnecessary loop to get to setters incoming argument. Added DoxyGen comments. Still more work to do in this area (WIP). llvm-svn: 79365
* Update for LLVM API change.Owen Anderson2009-07-311-5/+5
| | | | llvm-svn: 77722
* Canonicalize else spacing.Mike Stump2009-07-301-1/+0
| | | | llvm-svn: 77629
* Update for LLVM API change.Owen Anderson2009-07-271-3/+1
| | | | llvm-svn: 77249
* Switch to using llvm::Value::getName()Daniel Dunbar2009-07-261-2/+2
| | | | llvm-svn: 77147
* Update for LLVM API change.Owen Anderson2009-07-241-1/+1
| | | | llvm-svn: 77012
* Update for LLVM API change, and contextify a bunch of related stuff.Owen Anderson2009-07-141-2/+4
| | | | llvm-svn: 75705
* Update for LLVM API change.Owen Anderson2009-07-131-5/+8
| | | | llvm-svn: 75446
* Update clang for the add ->add/fadd split. Likewise for sub and mul.Chris Lattner2009-06-171-30/+87
| | | | llvm-svn: 73604
* Support complex properties, ivars and message expressions.Daniel Dunbar2009-06-101-6/+42
| | | | llvm-svn: 73158
* Implement VisitCXXExprWithTemporaries for complex expressions.Anders Carlsson2009-05-311-0/+3
| | | | llvm-svn: 72653
* Fixup the rest of the trivial cases of the codegen of volatile. IfMike Stump2009-05-291-22/+108
| | | | | | | any body can spot codegen bugs with volatile, or knows of any in the bug database, let me know. llvm-svn: 72572
* Functions that return references can be rvalues as well.Anders Carlsson2009-05-271-0/+3
| | | | llvm-svn: 72457
* Change compound assignment operators to keep track of both the promoted Eli Friedman2009-03-281-1/+1
| | | | | | | | | | | | | | | | | 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
* Some minor fixes for complex IRGen.Eli Friedman2009-03-231-23/+16
| | | | llvm-svn: 67501
* Minor cleanup for choose expressions: add a helper that returns the Eli Friedman2009-03-041-2/+1
| | | | | | chosen sub-expression, rather than just evaluating the condition. llvm-svn: 66018
* rip out __builtin_overloadChris Lattner2009-02-181-6/+0
| | | | llvm-svn: 64961
* Use EmitVAListRef instead of EmitLValue directly to handle array decayDaniel Dunbar2009-02-111-1/+1
| | | | | | case on x86_64. llvm-svn: 64333
OpenPOWER on IntegriCloud