aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CGExpr.cpp
AgeCommit message (Collapse)Author
2007-08-26implicit casts take care of this code, remove it now.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41434 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26refactor scalar conversions out into CGExprScalar.cppChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41433 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26tolerate unimplemented codegen betterChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41424 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24Teach emit-llvm for scalars to properly handle compound assignment Chris Lattner
operators in all their glory :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41373 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24completely refactor codegen of scalar expressions out into its own ↵Chris Lattner
CGExprScalar.cpp file. This patch temporarily breaks compound assignment operators, but greatly simplifies many things. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41355 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24stub out complex -> bool conversion.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41347 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-23implement passing of complex and aggregates through call args.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41344 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21Implement parsing and code generation of Objective-C string literals.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41238 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21move EmitLoadOfComplex/EmitStoreOfComplex into ComplexExprEmitter.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41236 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21implement comma for complex.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41235 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21and/or/xor are invalid for complex, even integer complex apparently.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41234 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21simplify code slightlyChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41233 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21reimplement support for complex comparisons, add support for integer complex ↵Chris Lattner
compares. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41231 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21reimplement complex mulChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41226 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21reimplement addition of complex numbers.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41215 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20Fix array->pointer decay. This unbreaks test/CodeGen/array.cChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41202 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20Add support for code generation of builtins.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41188 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20Modified ArraySubscriptExpr to have accessors getLHS and getRHS in additionTed Kremenek
to getBase and getIdx. getBase and getIdx now return a "normalized" view of the expression (e.g., always "A[4]" instead of possibly "4[A]"). getLHS and getRHS return the expressions with syntactic fidelity to the original source code. Also modified client code of ArraySubscriptExpr, including the AST dumper and pretty printer, the return-stack value checker, and the LLVM code generator. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41180 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-11start splitting out aggregate value computation from EmitExpr into EmitAggExpr.Chris Lattner
aggregate value and scalar expression computation are very different, this gets them away from each other. This causes a temporary regression on some complex number examples. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41014 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10fix a codegen bug handling ocuvector element exprs.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40995 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10implement initial codegen for aggregate return functions. This implementsChris Lattner
codegen for: _Complex double bar(int); void test(_Complex double*); void test2(int c) { _Complex double X; X = bar(1); test(&X); } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40993 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10Fix a bug handling function -> pointer decay and avoid emitting a noopChris Lattner
bitcast. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40992 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08now that implicit conversions are explicit, we can eliminate Chris Lattner
EmitUsualArithmeticConversions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40931 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08now that implicit conversions are explicit, we can eliminateChris Lattner
EmitExprWithUsualUnaryConversions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40929 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04Implement codegen for __builtin_choose_expr. For example:Chris Lattner
struct X { int A; }; void foo() { struct X s; int i; i = __builtin_choose_expr(0, s, i); } compiles to: %tmp = load i32* %i ; <i32> [#uses=1] store i32 %tmp, i32* %i wow :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40801 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03implement codegen support for __builtin_types_compatible_pChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40788 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03Rename AddrLabel and OCUVectorComponent -> AddrLabelExpr and ↵Chris Lattner
OCUVectorElementExpr respectively. This is for consistency with other expr nodes end with *Expr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40785 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03implement codegen for multidest ocuvector expressions, like:Chris Lattner
vec2.yx = vec2; // reverse git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40782 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03add codegen support for storing into a single-element ocu lvalue, such as:Chris Lattner
vec2.x = f; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40781 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03refactor handling of ocuvector lvalue->rvalue codegen into its own method.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40780 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03In the common case where we are shuffling a vector, emit anChris Lattner
llvm vector shuffle instead of a bunch of insert/extract operations. For: vec4 = vec4.yyyy; // splat Emit: %tmp1 = shufflevector <4 x float> %tmp, <4 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > instead of: %tmp1 = extractelement <4 x float> %tmp, i32 1 %tmp2 = insertelement <4 x float> undef, float %tmp1, i32 0 %tmp3 = extractelement <4 x float> %tmp, i32 1 %tmp4 = insertelement <4 x float> %tmp2, float %tmp3, i32 1 %tmp5 = extractelement <4 x float> %tmp, i32 1 %tmp6 = insertelement <4 x float> %tmp4, float %tmp5, i32 2 %tmp7 = extractelement <4 x float> %tmp, i32 1 %tmp8 = insertelement <4 x float> %tmp6, float %tmp7, i32 3 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40779 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03Add support for scalar-returning element accesses like V.xChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40777 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03implement lvalue to rvalue conversion for ocuvector components. We can now ↵Chris Lattner
compile stuff like this: typedef __attribute__(( ocu_vector_type(4) )) float float4; float4 test1(float4 V) { return V.wzyx+V; } to: _test1: pshufd $27, %xmm0, %xmm1 addps %xmm0, %xmm1 movaps %xmm1, %xmm0 ret and: _test1: mfspr r2, 256 oris r3, r2, 4096 mtspr 256, r3 li r3, lo16(LCPI1_0) lis r4, ha16(LCPI1_0) lvx v3, r4, r3 vperm v3, v2, v2, v3 vaddfp v2, v3, v2 mtspr 256, r2 blr git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40771 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02add support for codegen of an OCUVectorComponent as an lvalue.Chris Lattner
We can now codegen: vec4.xy; as nothing! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40769 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01update this to build with LLVM ToTChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40665 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-21Implement code generation for __func__, __FUNCTION__ and __PRETTY_FUNCTION__Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40162 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-18implement codegen support for sizeof/alignofChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40009 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16Add a hack (mirroring llvm-gcc) to pointer difference Chris Lattner
codegen to compile: int test(int *A, int *B) { return A-B; } into: _test: movl 4(%esp), %eax subl 8(%esp), %eax sarl $2, %eax ret instead of: _test: movl 4(%esp), %eax subl 8(%esp), %eax movl %eax, %ecx sarl $31, %ecx shrl $30, %ecx addl %ecx, %eax sarl $2, %eax ret git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39902 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15Refactor code so that isIntegerConstantExpr has an ASTContext available.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39884 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14add FIXME and un-XFAIL testGabor Greif
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39858 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14A significant refactoring of the type size stuff to also Chris Lattner
compute type alignment. This info is needed for struct layout. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39850 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14add a fixmeChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39847 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13implement _Complex * == and !=Gabor Greif
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39841 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13Move getSize() out of type, into ASTContext, where it has target info, andChris Lattner
where ASTContext can manage caches for struct layout, etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39835 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13implement codegen support for implicit casts.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39831 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13"Codegen for Character Literals and Conditional OperatorChris Lattner
Both in one patch, and the test case that Chris didn't commit last time is in there too... I'll split the patch up if somebody wants it split." Patch by Keith Bauer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39796 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13"Someone typed "PtrToInt" where they meant "IntToPtr".Chris Lattner
I've added a tests/CodeGen directory, and a test for this case that used to fail and now passes." Patch by Keith Bauer git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39794 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13Implement codegen for + and - with pointers. Patch contributed by Chris Lattner
Keith Bauer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39793 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-11implement codegen support for pre/post inc/dec.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39765 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-11Stage two of getting CFE top correct.Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39734 91177308-0d34-0410-b5e6-96231b3b80d8