Граф коммитов

179 Коммитов

Автор SHA1 Сообщение Дата
Chris Lattner 47f7dbf7c0 eliminate some VC++ warnings, patch contributed by Hartmut Kaiser
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41692 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-04 02:34:27 +00:00
Chris Lattner b2d963f527 add stmtexpr support for aggregates
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41662 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-31 22:54:14 +00:00
Chris Lattner 7e20d098a8 add support for complex stmtexpr's
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41661 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-31 22:51:38 +00:00
Chris Lattner 9b65551d0b Generalize RValue to handle complex better, generalize EmitCompoundStmt to
support any sort of expr, add a new EmitAnyExpr routine.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41660 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-31 22:49:20 +00:00
Chris Lattner 3379320c10 implement code generation for scalar stmt expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41656 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-31 22:09:40 +00:00
Chris Lattner c5e940fa55 Implement codegen support for lowering "library builtins" like __builtin_isinf
to their corresponding library routines (e.g. isinf).  This allows us to handle
all the stuff in macos math.h, and other stuff as it's added to *Builtins.def.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41634 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-31 04:44:06 +00:00
Chris Lattner bef20ac367 add the ability to get the llvm function corresponding to a library builtin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41633 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-31 04:31:45 +00:00
Steve Naroff fb22d96692 Fix the following redefinition errors submitted by Keith Bauer...
[dylan:~/llvm/tools/clang] admin% cat tentative_decls.c 
// incorrectly generates redefinition error
extern int array[3];
int array[3];

// incorrectly generates a redefinition error
extern void nup(int a[3]);
void nup(int a[3]) {}

It turns out that this exposed a fairly major flaw in the type system,
array types were never getting uniqued! This is because all array types
contained an expression, which aren't unique.

To solve this, we now have 2 array types, ConstantArrayType and
VariableArrayType. ConstantArrayType's are unique, VAT's aren't.

This is a fairly extensive set of fundamental changes. Fortunately,
all the tests pass. Nevertheless, there may be some collateral damage:-)
If so, let me know!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41592 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-30 01:06:46 +00:00
Chris Lattner 1d40060a37 remove some ugly code now that implicit defs are being generated in this case, thanks Steve!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41560 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-29 06:38:44 +00:00
Chris Lattner e00b18cfc3 Change EnumDecl to store its corresponding integer type
directly in it.  Remove TargetInfo::getEnumPolicy, as there is only
one policy that we support right now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41548 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-28 18:24:31 +00:00
Chris Lattner 314e7839e4 teach codegen to lay out enum types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41501 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-27 17:44:34 +00:00
Chris Lattner bfc0c1ae4b move EmitAggregateCopy into AggExprEmitter
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41472 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 23:13:56 +00:00
Chris Lattner d8d1936798 remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41470 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 23:02:57 +00:00
Chris Lattner 0e7d53c3fb remove dead protos
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41469 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 23:01:23 +00:00
Chris Lattner 1e4d21ea58 eliminate EmitAnyExpr, inlining it and simplifying it into its only caller.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41468 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 22:58:05 +00:00
Chris Lattner 660ac12137 eliminate use of EmitAnyExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41467 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 22:55:13 +00:00
Chris Lattner 6b5d0bf42f implement a fixme
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41466 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 22:47:40 +00:00
Chris Lattner 04dc76496e Implement compound assignment operators whose LHS is scalar but RHS is complex.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41464 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 22:37:40 +00:00
Chris Lattner ab340c22fe implement codegen of compound assignment operators for complex.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41463 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 22:09:01 +00:00
Chris Lattner 3ccf774256 compound assignment operators are of type CompoundAssignOperator
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41460 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 21:41:21 +00:00
Chris Lattner 612c40c214 update fixme's
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41458 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 21:27:07 +00:00
Chris Lattner 3219c5d2d9 implement complex division
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41457 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 21:24:19 +00:00
Chris Lattner 3420d0de2c fix a typo noticed by Gordon Henriksen
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41451 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 17:25:57 +00:00
Chris Lattner abe471bb29 llvmgcc is right :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41450 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 16:54:05 +00:00
Chris Lattner a3e7bfbb9f compound assignmetns work for scalars.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41449 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 16:52:57 +00:00
Chris Lattner ed70f0a536 implement conversions of complex to bool.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41448 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 16:52:28 +00:00
Chris Lattner 9069fa2244 remove ConvertScalarValueToBool.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41447 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 16:46:58 +00:00
Chris Lattner 9abc84e7ac reimplement ConvertScalarValueToBool in CGExprScalar.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41446 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 16:42:57 +00:00
Chris Lattner 4f1a7b3808 refactor some code to expose compex->scalar conversion to CGF
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41445 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 16:34:22 +00:00
Chris Lattner 190dbe203c be slightly more volatile correct
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41444 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 16:22:13 +00:00
Chris Lattner 8b2f3b72c0 these fixme's are easy :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41442 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 07:30:49 +00:00
Chris Lattner d31beb195e implement a fixme, add a couple more :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41441 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 07:29:23 +00:00
Chris Lattner 58a2e944fa there are no conversions from aggregates to scalars.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41440 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 07:26:12 +00:00
Chris Lattner cf289083ab implement conversions from complex to scalar types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41439 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 07:21:11 +00:00
Chris Lattner 10b00cfe64 Omit EmitConversion
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41438 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 07:16:41 +00:00
Chris Lattner 4b0029d5f8 Fix return of aggregate and return of complex.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41437 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 07:14:44 +00:00
Chris Lattner e72608b785 these implicit conversions are now explicit :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41436 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 07:09:42 +00:00
Chris Lattner e937712379 remove uses of EmitConversion
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41435 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 07:08:39 +00:00
Chris Lattner abe6719793 implicit casts take care of this code, remove it now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41434 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 07:06:24 +00:00
Chris Lattner 3707b255f8 refactor scalar conversions out into CGExprScalar.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41433 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 06:48:56 +00:00
Chris Lattner d272ff0e0a Implement casts from scalar -> complex and complex->complex.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41429 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 05:57:57 +00:00
Chris Lattner 36f8406db8 implement codegen of __imag of a scalar. Our impl doesn't suffer from
GCC bug PR33192.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41427 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 05:29:21 +00:00
Chris Lattner 9a19edfbcd Make initialization of complex vars work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41426 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 05:13:54 +00:00
Chris Lattner e936cc8890 fix codegen of pre/post inc/dec of a pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41425 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 05:10:16 +00:00
Chris Lattner 7013c8c2f8 tolerate unimplemented codegen better
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41424 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 05:06:40 +00:00
Chris Lattner 78e30fb5d9 int X[] isn't a VLA. This improves support for stdio.h on darwin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41423 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 05:02:07 +00:00
Chris Lattner 2bbb4a1424 implement rudimentary union layout support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41421 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 04:50:19 +00:00
Chris Lattner 6de93ff81c Don't make unknown builtins fatal errors yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41419 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 04:17:05 +00:00
Chris Lattner 11e6616c41 remove a bunch of dead code
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41418 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 04:13:58 +00:00
Chris Lattner db68f1bc5a implement codegen for complex literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41414 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 03:51:12 +00:00
Chris Lattner 3b44b57423 The new correct compound assignment operators exposed a bug in codegen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41405 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-25 21:56:20 +00:00
Chris Lattner 46f93d021a implement codegen for real/imag. TODO: imag of non-complex.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41376 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24 21:20:17 +00:00
Chris Lattner 1f1ded9629 Teach emit-llvm for scalars to properly handle compound assignment
operators in all their glory :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41373 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24 21:00:35 +00:00
Chris Lattner dfce2a51a7 print the computation type for compound assignment operators in dumps.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41361 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24 16:24:49 +00:00
Chris Lattner 7f02f721d4 completely refactor codegen of scalar expressions out into its own 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-24 05:35:26 +00:00
Chris Lattner 566b6ce741 rename two files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41350 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24 02:22:53 +00:00
Chris Lattner d0b1203b1c implement codegen of builtin_choose_expr for complex.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41349 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24 02:18:47 +00:00
Chris Lattner 4f5d414b61 stub out complex -> bool conversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41347 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24 00:01:20 +00:00
Chris Lattner 6bc1adec84 implement complex subtraction
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41345 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-23 23:46:33 +00:00
Chris Lattner 23b1cdb0b5 implement passing of complex and aggregates through call args.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41344 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-23 23:43:33 +00:00
Chris Lattner 419d25ef8c add support for codegen of calls returning complex.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41336 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-23 21:38:16 +00:00
Chris Lattner e73e8e212e add some fixme's, implement complex struct members.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41256 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 22:33:41 +00:00
Chris Lattner 3070f98910 implement codegen for --/++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41255 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 22:25:29 +00:00
Chris Lattner e98a11c704 implement __extension__ and unary~ for complex.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41249 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 20:41:44 +00:00
Chris Lattner fa2b9c9103 implement codegen for complex unary +/-
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41247 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 20:08:23 +00:00
Chris Lattner 776c64990e minor nicities.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41244 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 18:51:13 +00:00
Chris Lattner 8bcd723ea5 implement support for complex subscripts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41240 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 18:03:58 +00:00
Chris Lattner 76e8033b82 allow support for volatile lvalues even though it's still not right.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41239 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 18:02:02 +00:00
Anders Carlsson 5508518a27 Implement parsing and code generation of Objective-C string literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41238 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 17:43:55 +00:00
Chris Lattner 5083a53697 add a new builder ivar.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41237 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 17:39:38 +00:00
Chris Lattner 46d7d9fac9 move EmitLoadOfComplex/EmitStoreOfComplex into ComplexExprEmitter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41236 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 17:28:34 +00:00
Chris Lattner 756a4d8845 implement comma for complex.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41235 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 17:15:50 +00:00
Chris Lattner 4034edbf86 and/or/xor are invalid for complex, even integer complex apparently.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41234 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 17:12:50 +00:00
Chris Lattner 32e32e7782 simplify code slightly
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41233 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 17:03:38 +00:00
Chris Lattner 58dee10ed2 reimplement support for complex comparisons, add support for integer complex compares.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41231 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 16:57:55 +00:00
Chris Lattner 2823c195ee reimplement complex mul
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41226 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 16:34:16 +00:00
Chris Lattner 05ba49cc45 update some comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41218 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 05:54:53 +00:00
Chris Lattner b6ef18a2b0 Split complex arithmetic codegen out from aggregate codegen.
This means that we get rid of tons of intermediate allocas.  For
example:

void foo(double _Complex a, double _Complex b) {
   a = b+a+a;
}

this used to have 4 temporary allocas, now it has zero of them.
This also simplifies the individual visitor methods because they
now can all operate on real/imag pairs instead of having to 
load/store all over the place.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41217 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 05:54:00 +00:00
Chris Lattner c748f27f40 simplify this a bit to remove indirection
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41216 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 05:02:10 +00:00
Chris Lattner ee755f9118 reimplement addition of complex numbers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41215 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 04:59:27 +00:00
Chris Lattner 03d6fb9922 Add the ability to visit binary operators without having to
match on binop then explicitly switching again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41214 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 04:43:17 +00:00
Chris Lattner 9c03356918 switch aggregate expr codegen to use a visitor to localize most of the nasty
details in its own file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41213 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 04:25:47 +00:00
Anders Carlsson c9e2091efc Implement code generation for constant CFStrings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41206 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 00:21:21 +00:00
Chris Lattner 7016a706c9 Fix array->pointer decay. This unbreaks test/CodeGen/array.c
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41202 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20 22:37:10 +00:00
Anders Carlsson 022012e6e5 Add support for code generation of builtins.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41188 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20 18:05:56 +00:00
Ted Kremenek 2324512285 Modified ArraySubscriptExpr to have accessors getLHS and getRHS in addition
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-20 16:18:38 +00:00
Anders Carlsson 4e533287e6 Add preliminary support for converting struct types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41145 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-17 22:00:32 +00:00
Chris Lattner 883f6a7cc7 start splitting out aggregate value computation from EmitExpr into EmitAggExpr.
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-11 00:04:45 +00:00
Chris Lattner af6f528b2b New file, just a placeholder for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41002 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 20:13:28 +00:00
Chris Lattner cf60cd291e fix a codegen bug handling ocuvector element exprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40995 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 17:10:08 +00:00
Chris Lattner cc666af7d4 implement initial codegen for aggregate return functions. This implements
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-10 17:02:28 +00:00
Chris Lattner 461766a5c0 Fix a bug handling function -> pointer decay and avoid emitting a noop
bitcast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40992 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 16:33:59 +00:00
Chris Lattner 6c216160b6 now that implicit conversions are explicit, we can eliminate
EmitUsualArithmeticConversions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40931 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 17:49:18 +00:00
Chris Lattner d4f0802277 now that implicit conversions are explicit, we can eliminate
EmitExprWithUsualUnaryConversions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40929 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 17:43:05 +00:00
Chris Lattner 94f05e3648 Implement codegen for __builtin_choose_expr. For example:
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-04 00:20:15 +00:00
Chris Lattner 30bf3ae03f implement codegen support for __builtin_types_compatible_p
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40788 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 17:51:03 +00:00
Chris Lattner 6481a57fef Rename AddrLabel and OCUVectorComponent -> AddrLabelExpr and 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-03 17:31:20 +00:00
Chris Lattner 7e6b51b673 implement codegen for multidest ocuvector expressions, like:
vec2.yx = vec2; // reverse
 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40782 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 16:37:04 +00:00
Chris Lattner 017d6aa8e6 add codegen support for storing into a single-element ocu lvalue, such as:
vec2.x = f;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40781 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 16:28:33 +00:00
Chris Lattner 34cdc86af5 refactor handling of ocuvector lvalue->rvalue codegen into its own method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40780 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 16:18:34 +00:00