summaryrefslogtreecommitdiffstats
path: root/clang/CodeGen/CodeGenFunction.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Add support for code generation of builtins.Anders Carlsson2007-08-201-0/+1
| | | | llvm-svn: 41188
* start splitting out aggregate value computation from EmitExpr into EmitAggExpr.Chris Lattner2007-08-111-2/+31
| | | | | | | | 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. llvm-svn: 41014
* now that implicit conversions are explicit, we can eliminate Chris Lattner2007-08-081-3/+0
| | | | | | EmitUsualArithmeticConversions. llvm-svn: 40931
* now that implicit conversions are explicit, we can eliminateChris Lattner2007-08-081-2/+0
| | | | | | EmitExprWithUsualUnaryConversions. llvm-svn: 40929
* Implement codegen for __builtin_choose_expr. For example:Chris Lattner2007-08-041-0/+2
| | | | | | | | | | | | | | | | | | | 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 :) llvm-svn: 40801
* implement codegen support for __builtin_types_compatible_pChris Lattner2007-08-031-0/+3
| | | | llvm-svn: 40788
* Rename AddrLabel and OCUVectorComponent -> AddrLabelExpr and ↵Chris Lattner2007-08-031-14/+14
| | | | | | OCUVectorElementExpr respectively. This is for consistency with other expr nodes end with *Expr. llvm-svn: 40785
* add codegen support for storing into a single-element ocu lvalue, such as:Chris Lattner2007-08-031-0/+1
| | | | | | vec2.x = f; llvm-svn: 40781
* refactor handling of ocuvector lvalue->rvalue codegen into its own method.Chris Lattner2007-08-031-0/+2
| | | | llvm-svn: 40780
* implement lvalue to rvalue conversion for ocuvector components. We can now ↵Chris Lattner2007-08-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 40771
* add support for codegen of an OCUVectorComponent as an lvalue.Chris Lattner2007-08-021-4/+22
| | | | | | | | | | We can now codegen: vec4.xy; as nothing! llvm-svn: 40769
* Implement code generation for __func__, __FUNCTION__ and __PRETTY_FUNCTION__Anders Carlsson2007-07-211-0/+2
| | | | llvm-svn: 40162
* implement codegen support for sizeof/alignofChris Lattner2007-07-181-1/+1
| | | | llvm-svn: 40009
* Implement break and continue. Patch by Anders Carlsson!Chris Lattner2007-07-161-1/+16
| | | | llvm-svn: 39927
* implement codegen support for implicit casts.Chris Lattner2007-07-131-1/+1
| | | | llvm-svn: 39831
* "Codegen for Character Literals and Conditional OperatorChris Lattner2007-07-131-1/+7
| | | | | | | | | | | 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. llvm-svn: 39796
* Implement codegen for + and - with pointers. Patch contributed by Chris Lattner2007-07-131-0/+4
| | | | | | Keith Bauer. llvm-svn: 39793
* implement codegen support for pre/post inc/dec.Chris Lattner2007-07-111-1/+1
| | | | llvm-svn: 39765
* implement codegen support for rvalue-only vector subscripts, such as:Chris Lattner2007-07-101-0/+1
| | | | | | | | | float4 test(void); float test2() { return test()[1]; } llvm-svn: 39725
* Add support for codegen'ing vector subscripts, at least when they are lvalues.Chris Lattner2007-07-101-3/+30
| | | | llvm-svn: 39724
* implement codegen support for FP literalsChris Lattner2007-07-091-0/+2
| | | | llvm-svn: 39718
* add codegen support for <<= and >>=.Chris Lattner2007-06-291-3/+4
| | | | llvm-svn: 39713
* Implement the rest of the compound assignment operators, except shifts.Chris Lattner2007-06-291-6/+6
| | | | llvm-svn: 39712
* refactor some code, implement -=Chris Lattner2007-06-291-3/+9
| | | | llvm-svn: 39711
* Rename ArithAssignBinaryOperator -> CompoundAssignOperator, implementChris Lattner2007-06-291-1/+4
| | | | | | codegen support for +=. llvm-svn: 39710
* implement support for struct and complex returns.Chris Lattner2007-06-221-0/+4
| | | | llvm-svn: 39674
* add some infrastructure for codegen'ing complex numbers. implement additionChris Lattner2007-06-221-1/+19
| | | | | | | | | | | | | | | | | | | | | of complex. We now produce optimal code for: void test(_Complex float *Y) { *Y = *Y + *Y; } $ clang -emit-llvm cg.c | llvm-as | opt -std-compile-opts | llc -march=x86-64 ... _test: movss (%rdi), %xmm0 addss %xmm0, %xmm0 movss 4(%rdi), %xmm1 movss %xmm0, (%rdi) addss %xmm1, %xmm1 movss %xmm1, 4(%rdi) ret llvm-svn: 39673
* remove location tracking for target infoChris Lattner2007-06-221-4/+2
| | | | llvm-svn: 39671
* Build enough support for aggregates to be able to compile this:Chris Lattner2007-06-221-2/+5
| | | | | | | | | | void test(int A, _Complex float Y) { _Complex float X; X = X; } llvm-svn: 39669
* implement codegen of the relational operationsChris Lattner2007-06-201-4/+2
| | | | | | One major FIXME though. llvm-svn: 39666
* Implement the equality operators for simple typesChris Lattner2007-06-201-0/+1
| | | | llvm-svn: 39665
* Refactor CodeGenTypes out to CodeGenModule so it can be used for functionsChris Lattner2007-06-161-2/+5
| | | | | | and globals. llvm-svn: 39661
* Split type analysis out to its own file, now the integer constant expr ↵Chris Lattner2007-06-161-10/+3
| | | | | | | | evaluation is ready. llvm-svn: 39660
* Finally bite the bullet and make the major change: split the clang namespaceChris Lattner2007-06-151-13/+14
| | | | | | | | | | | | | out of the llvm namespace. This makes the clang namespace be a sibling of llvm instead of being a child. The good thing about this is that it makes many things unambiguous. The bad things is that many things in the llvm namespace (notably data structures like smallvector) now require an llvm:: qualifier. IMO, libsystem and libsupport should be split out of llvm into their own namespace in the future, which will fix this issue. llvm-svn: 39659
* implement codegen of calls. We can now compile:Chris Lattner2007-06-151-0/+2
| | | | | | | | | | | | | | | | | double foo( int (*FP)(int, int, int)) { return FP(1, 2, 3); } to: define double @foo(i32 (i32, i32, i32)* %FP) { entry: %call = tail call i32 %FP( i32 1, i32 2, i32 3 ) %conv = sitofp i32 %call to double ret double %conv } llvm-svn: 39658
* Implement support for formal arguments. We can now compile this:Chris Lattner2007-06-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | int test(int X, short Y, float Z) { return (int)(X*Y+Z); } to: define i32 @test(i32 %X, i16 %Y, float %Z) { entry: %promote = sext i16 %Y to i32 ; <i32> [#uses=1] %mul = mul i32 %promote, %X ; <i32> [#uses=1] %promote3 = sitofp i32 %mul to float ; <float> [#uses=1] %add = add float %promote3, %Z ; <float> [#uses=1] %conv = fptosi float %add to i32 ; <i32> [#uses=1] ret i32 %conv } with: $ clang -emit-llvm t.c | llvm-as | opt -std-compile-opts | llvm-dis llvm-svn: 39652
* Convert argument types over, which works for trivial scalars.Chris Lattner2007-06-091-2/+7
| | | | llvm-svn: 39625
* codegen all declarators in a declstmt, allowing us to successfully codegenChris Lattner2007-06-091-2/+3
| | | | | | | | | | | | stuff like: void test() { int *X, Y, *Z[14]; X[Y] = 4; } llvm-svn: 39624
* Implement array subscripts for non-vla types.Chris Lattner2007-06-081-0/+3
| | | | llvm-svn: 39622
* implement codegen of string literals.Chris Lattner2007-06-061-0/+2
| | | | llvm-svn: 39597
* implement support for casts to/from pointers.Chris Lattner2007-06-061-1/+2
| | | | llvm-svn: 39595
* implement codegen of a bunch more loop constructs and most expressionsChris Lattner2007-06-051-18/+92
| | | | llvm-svn: 39593
* implement codegen of while stmts and lvalue evaluation of paren exprs :)Chris Lattner2007-06-051-0/+2
| | | | llvm-svn: 39582
* Implement EmitUsualArithmeticConversions, so we can add shorts to floats andChris Lattner2007-06-031-2/+2
| | | | | | | | | | | ints to long long etc. For int to longlong, we now get: %tmp = load i64* %F ; <i64> [#uses=1] %tmp1 = load i32* %D ; <i32> [#uses=1] %promote = sext i32 %tmp1 to i64 ; <i64> [#uses=1] %tmp2 = add i64 %tmp, %promote ; <i64> [#uses=0] llvm-svn: 39576
* implement a first hack at codegen'ing the usual unary conversions.Chris Lattner2007-06-021-1/+5
| | | | | | | | | | | | | | | | | | | | | | This allows us to compile: int func() { int A[10]; if (!A) { to: define i32 @func() { entry: %A = alloca [10 x i32] ; <[10 x i32]*> [#uses=1] %arraydecay = getelementptr [10 x i32]* %A, i32 0, i32 0 ; <i32*> [#uses=1] %tobool = icmp ne i32* %arraydecay, null ; <i1> [#uses=1] %lnot = xor i1 %tobool, true ; <i1> [#uses=1] br i1 %lnot, label %ifthen, label %ifend -Chris llvm-svn: 39564
* Implement translation of pointer, reference and simple array types. We nowChris Lattner2007-06-021-2/+0
| | | | | | | | | | | | | | | | compile: void foo() { int A[10]; int *P; into: entry: %A = alloca [10 x i32] ; <[10 x i32]*> [#uses=0] %P = alloca i32* ; <i32**> [#uses=0] llvm-svn: 39561
* Refactor EvaluateScalarValueToBool out of if statement emission, so it canChris Lattner2007-06-021-1/+12
| | | | | | | | | | | | | | | | | | | | | | | be shared. Implement infrastructure for unary operator emission. Implement basic logical not support. We now compile: register short X; if (!X) { into: %tmp = load i16* %X ; <i16> [#uses=1] %tobool = icmp ne i16 %tmp, 0 ; <i1> [#uses=1] %lnot = xor i1 %tobool, true ; <i1> [#uses=1] zext i1 %lnot to i32 ; <i32>:0 [#uses=1] %tobool1 = icmp ne i32 %0, 0 ; <i1> [#uses=1] br i1 %tobool1, label %ifthen, label %ifend llvm-svn: 39559
* Implement scaffolding for lvalues. Implement block vardecl lvalues.Chris Lattner2007-06-021-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to translate: int func() { register int X; { int Y; return 1+X+Y; } } into: define i32 @func() { entry: %X = alloca i32 ; <i32*> [#uses=1] %Y = alloca i32 ; <i32*> [#uses=1] %allocapt = bitcast i32 undef to i32 ; <i32> [#uses=0] %tmp = load i32* %X ; <i32> [#uses=1] %tmp1 = add i32 1, %tmp ; <i32> [#uses=1] %tmp2 = load i32* %Y ; <i32> [#uses=1] %tmp3 = add i32 %tmp1, %tmp2 ; <i32> [#uses=1] ret i32 %tmp3 ; No predecessors! ret i32 undef } llvm-svn: 39555
* Add initial support for fixed-size local vardecls. This allows us to compile:Chris Lattner2007-06-021-2/+7
| | | | | | | | | | | | | | | | | | int func() { register int X; { int Y; into: define i32 @func() { entry: %X = alloca i32 ; <i32*> [#uses=0] %Y = alloca i32 ; <i32*> [#uses=0] %allocapt = bitcast i32 undef to i32 ; <i32> [#uses=0] ... llvm-svn: 39553
* Start stubbing out decl codegen.Chris Lattner2007-06-021-0/+18
| | | | llvm-svn: 39550
OpenPOWER on IntegriCloud