summaryrefslogtreecommitdiffstats
path: root/clang/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* A significant refactoring of the type size stuff to also Chris Lattner2007-07-145-18/+23
| | | | | | compute type alignment. This info is needed for struct layout. llvm-svn: 39850
* Implement trivial integer initializers, like 'int X = 4;' for globalChris Lattner2007-07-141-5/+10
| | | | | | vars. Approach suggested by Keith. llvm-svn: 39849
* In "int X,Y;", compile both X and Y.Chris Lattner2007-07-143-1/+8
| | | | llvm-svn: 39848
* add a fixmeChris Lattner2007-07-141-0/+2
| | | | llvm-svn: 39847
* implement _Complex * == and !=Gabor Greif2007-07-131-3/+33
| | | | llvm-svn: 39841
* Move getSize() out of type, into ASTContext, where it has target info, andChris Lattner2007-07-132-1/+2
| | | | | | where ASTContext can manage caches for struct layout, etc. llvm-svn: 39835
* implement codegen support for implicit casts.Chris Lattner2007-07-132-7/+11
| | | | llvm-svn: 39831
* silence a bogus gcc warning.Chris Lattner2007-07-131-0/+2
| | | | llvm-svn: 39824
* "Codegen for Character Literals and Conditional OperatorChris Lattner2007-07-132-2/+54
| | | | | | | | | | | 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 support for basic codegen of global variables with no initializers.Chris Lattner2007-07-134-3/+43
| | | | llvm-svn: 39795
* "Someone typed "PtrToInt" where they meant "IntToPtr".Chris Lattner2007-07-131-1/+1
| | | | | | | | | I've added a tests/CodeGen directory, and a test for this case that used to fail and now passes." Patch by Keith Bauer llvm-svn: 39794
* Implement codegen for + and - with pointers. Patch contributed by Chris Lattner2007-07-133-9/+82
| | | | | | Keith Bauer. llvm-svn: 39793
* Fix "no newline at end of file" warnings. Patch contributed byChris Lattner2007-07-121-1/+1
| | | | | | Benoit Boissinot! llvm-svn: 39780
* Evaluate the initializer for automatic variables.Chris Lattner2007-07-121-1/+3
| | | | llvm-svn: 39771
* implement codegen support for pre/post inc/dec.Chris Lattner2007-07-112-8/+52
| | | | llvm-svn: 39765
* implement codegen support for the "default argument promotions" (C99 6.5.2.2p6).Chris Lattner2007-07-101-3/+34
| | | | | | | Not having this prevented promoting float arguments to double when passed into printf, for example. llvm-svn: 39727
* implement codegen support for rvalue-only vector subscripts, such as:Chris Lattner2007-07-102-3/+26
| | | | | | | | | 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-103-26/+84
| | | | llvm-svn: 39724
* Add support for vector formal arguments.Chris Lattner2007-07-101-1/+2
| | | | llvm-svn: 39721
* implement support for llvm codegen of vectors. That was much easier thanChris Lattner2007-07-101-0/+5
| | | | | | I expected :) llvm-svn: 39720
* implement codegen support for FP literalsChris Lattner2007-07-092-0/+8
| | | | llvm-svn: 39718
* add codegen support for <<= and >>=.Chris Lattner2007-06-292-22/+44
| | | | llvm-svn: 39713
* Implement the rest of the compound assignment operators, except shifts.Chris Lattner2007-06-292-41/+75
| | | | llvm-svn: 39712
* refactor some code, implement -=Chris Lattner2007-06-292-60/+83
| | | | llvm-svn: 39711
* Rename ArithAssignBinaryOperator -> CompoundAssignOperator, implementChris Lattner2007-06-292-6/+52
| | | | | | codegen support for +=. llvm-svn: 39710
* fix codegen of void return functionsChris Lattner2007-06-271-1/+1
| | | | llvm-svn: 39694
* fix codegen of void-returning functionsChris Lattner2007-06-271-1/+1
| | | | llvm-svn: 39693
* implement support for struct and complex returns.Chris Lattner2007-06-224-3/+26
| | | | llvm-svn: 39674
* add some infrastructure for codegen'ing complex numbers. implement additionChris Lattner2007-06-223-4/+76
| | | | | | | | | | | | | | | | | | | | | 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
* Split complex types out from being members of BuiltinType to being their ownChris Lattner2007-06-222-24/+11
| | | | | | types. llvm-svn: 39672
* remove location tracking for target infoChris Lattner2007-06-228-37/+31
| | | | llvm-svn: 39671
* Don't forget to set thisChris Lattner2007-06-221-0/+1
| | | | llvm-svn: 39670
* Build enough support for aggregates to be able to compile this:Chris Lattner2007-06-224-15/+69
| | | | | | | | | | void test(int A, _Complex float Y) { _Complex float X; X = X; } llvm-svn: 39669
* implement lowering of complex typesChris Lattner2007-06-221-3/+16
| | | | llvm-svn: 39668
* fix naming of aggregate arguments.Chris Lattner2007-06-221-5/+1
| | | | llvm-svn: 39667
* implement codegen of the relational operationsChris Lattner2007-06-202-22/+40
| | | | | | One major FIXME though. llvm-svn: 39666
* Implement the equality operators for simple typesChris Lattner2007-06-202-1/+31
| | | | llvm-svn: 39665
* assert, don't crash, on int[]Chris Lattner2007-06-201-1/+1
| | | | llvm-svn: 39664
* Hook up global function and variable handling. We can now compile:Chris Lattner2007-06-204-10/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | int X, bar(int,int,int); short Y; double foo() { return bar(X, Y, 3); } into: @X = external global i32 ; <i32*> [#uses=1] @Y = external global i16 ; <i16*> [#uses=1] define double @foo() { entry: %tmp = load i32* @X ; <i32> [#uses=1] %tmp1 = load i16* @Y ; <i16> [#uses=1] %promote = sext i16 %tmp1 to i32 ; <i32> [#uses=1] %call = tail call i32 @bar( i32 %tmp, i32 %promote, i32 3 ) ; <i32> [#uses=1] %conv = sitofp i32 %call to double ; <double> [#uses=1] ret double %conv } declare i32 @bar(i32, i32, i32) llvm-svn: 39663
* Refactor CodeGenTypes out to CodeGenModule so it can be used for functionsChris Lattner2007-06-164-6/+17
| | | | | | and globals. llvm-svn: 39661
* Split type analysis out to its own file, now the integer constant expr ↵Chris Lattner2007-06-165-121/+194
| | | | | | | | evaluation is ready. llvm-svn: 39660
* Finally bite the bullet and make the major change: split the clang namespaceChris Lattner2007-06-158-114/+116
| | | | | | | | | | | | | 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-152-0/+29
| | | | | | | | | | | | | | | | | 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
* Don't generate code for prototypesChris Lattner2007-06-151-1/+4
| | | | llvm-svn: 39656
* Fix a nasty bug which caused infinite recursionChris Lattner2007-06-151-3/+3
| | | | llvm-svn: 39655
* Implement implicit conversions in return stmts.Chris Lattner2007-06-131-5/+13
| | | | llvm-svn: 39653
* Implement support for formal arguments. We can now compile this:Chris Lattner2007-06-134-13/+57
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Emit codegen of enum literals.Chris Lattner2007-06-111-1/+6
| | | | llvm-svn: 39646
* Convert argument types over, which works for trivial scalars.Chris Lattner2007-06-092-6/+22
| | | | llvm-svn: 39625
* codegen all declarators in a declstmt, allowing us to successfully codegenChris Lattner2007-06-093-7/+11
| | | | | | | | | | | | stuff like: void test() { int *X, Y, *Z[14]; X[Y] = 4; } llvm-svn: 39624
OpenPOWER on IntegriCloud