summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExprComplex.cpp
AgeCommit message (Collapse)Author
2011-09-27de-tmpify clang.Benjamin Kramer
llvm-svn: 140637
2011-09-23Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie
llvm-svn: 140407
2011-09-23Switch assert(0/false) llvm_unreachable.David Blaikie
llvm-svn: 140367
2011-09-19Add list initialization for complex numbers in C. Essentially, this allows ↵Eli Friedman
"_Complex float x = {1.0f, 2.0f};". See changes to docs/LanguageExtensions.html for a longer description. <rdar://problem/9397672>. llvm-svn: 140090
2011-09-10Rename the ARC cast kinds to start with "ARC".John McCall
llvm-svn: 139466
2011-09-10When converting a block pointer to an Objective-C pointer type, extendJohn McCall
the lifetime of the block by copying it to the heap, or else we'll get a dangling reference because the code working with the non-block-typed object will not know it needs to copy. There is some danger here, e.g. with assigning a block literal to an unsafe variable, but, well, it's an unsafe variable. llvm-svn: 139451
2011-09-09Give conversions of block pointers to ObjC pointers a different cast kindJohn McCall
than conversions of C pointers to ObjC pointers. In order to ensure that we've caught every case, add asserts to CastExpr that strictly determine which cast kind is used for which kind of bit cast. llvm-svn: 139352
2011-09-02blocks: Support capturing complex variable in block.Fariborz Jahanian
// rdar://10033896 llvm-svn: 139041
2011-09-02revert patch in r139020Fariborz Jahanian
llvm-svn: 139029
2011-09-02blocks: Support capturing complex variable in block.Fariborz Jahanian
// rdar://10033896 llvm-svn: 139020
2011-07-18de-constify llvm::Type, patch by David Blaikie!Chris Lattner
llvm-svn: 135370
2011-07-15Create a new expression node, SubstNonTypeTemplateParmExpr,John McCall
to represent a fully-substituted non-type template parameter. This should improve source fidelity, as well as being generically useful for diagnostics and such. llvm-svn: 135243
2011-07-07In ARC, reclaim all return values of retainable type, not just thoseJohn McCall
where we have an immediate need of a retained value. As an exception, don't do this when the call is made as the immediate operand of a __bridge retain. This is more in the way of a workaround than an actual guarantee, so it's acceptable to be brittle here. rdar://problem/9504800 llvm-svn: 134605
2011-06-25Cleanup cast IRGen a bit; no intended functionality change.Eli Friedman
llvm-svn: 133864
2011-04-15C1X: implement generic selectionsPeter Collingbourne
As an extension, generic selection support has been added for all supported languages. The syntax is the same as for C1X. llvm-svn: 129554
2011-03-30Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad
PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128538
2011-02-17Remove the "conditional save" hashtables from IR generation.John McCall
llvm-svn: 125761
2011-02-17Change the representation of GNU ?: expressions to use a different expressionJohn McCall
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
2011-02-16Save a copy expression for non-trivial copy constructions of catch variables.John McCall
llvm-svn: 125661
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-18Fix warnings found by gcc-4.6, from -Wunused-but-set-variable andJeffrey Yasskin
-Wint-to-pointer-cast. llvm-svn: 123719
2011-01-13Ensure an insertion point at the end of a statement-expression.John McCall
Fixes PR8967. llvm-svn: 123360
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-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-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-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-16Teach complex compound assignment IR-generation that the RHS ofJohn McCall
a compound assignment is always already in the computation type. llvm-svn: 119330
2010-11-14Always emit full loads from volatile complex l-values.John McCall
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
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-09-20Implements in IRgen gnu extensions missing LHS forFariborz Jahanian
complex conditionals. Radar 8453812. llvm-svn: 114376
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-07-14Add lvalue-bitcast support for complex numbers.Douglas Gregor
llvm-svn: 108363
2010-07-13Whenever we're creating an expression that is typically an rvalueDouglas Gregor
(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
2010-07-08Reinstate the fix for PR7556. A silly use of isTrivial() wasDouglas Gregor
suppressing copies of objects with trivial copy constructors. llvm-svn: 107857
2010-07-07Revert r107828 and r107827, the fix for PR7556, which seems to beDouglas Gregor
breaking bootstrap on Linux. llvm-svn: 107837
2010-07-07Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect itsDouglas Gregor
newly-narrowed scope. No functionality change. llvm-svn: 107828
2010-06-29IRgen: Assignment to Objective-C properties shouldn't reload the value, forDaniel Dunbar
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
2010-03-23Code gen for compound assignment of complexFariborz Jahanian
types using property syntax to access setter/getters. (also radar 7351147). llvm-svn: 99307
2010-03-23Patch to implement code gen. use of compound assignent onFariborz Jahanian
properties of complex type. Radar 7351147. llvm-svn: 99299
2010-02-15Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96224
2010-01-09refactor pre/postinc logic into CGF and require the caller to pass in theChris Lattner
lvalue to poke, no functionality change. llvm-svn: 93075
2009-12-25Minor optimization; emit proper unsupported messages for a couple of cases.Eli Friedman
llvm-svn: 92153
2009-11-29Simplify code. No functionality change.Benjamin Kramer
llvm-svn: 90087
2009-11-28Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.Benjamin Kramer
llvm-svn: 90044