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

122 Коммитов

Автор SHA1 Сообщение Дата
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