annotate ir/irtype.h @ 1047:6bb04dbee21f

Some calling convention work for x86-64: - Implement x86-64 extern(C), hopefully correctly. - Tried to be a bit smarter about extern(D) while I was there. Interestingly, this code seems to be generating more efficient code than gcc and llvm-gcc in some edge cases, like returning a `{ [7 x i8] }` loaded from a stack slot from an extern(C) function. (gcc generates 7 1-byte loads, while this code generates a 4-byte, a 2-byte and a 1-byte load) I also added some changes to make sure structs being returned from functions or passed in as parameters are stored in memory where the rest of the backend seems to expect them to be. These should be removed when support for first-class aggregates improves.
author Frits van Bommel <fvbommel wxs.nl>
date Fri, 06 Mar 2009 16:00:47 +0100
parents 340acf1535d0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
664
eef8ac26c66c Some missed LLVMDC -> LDC.
Christian Kamm <kamm incasoftware de>
parents: 194
diff changeset
1 #ifndef LDC_IR_IRTYPE_H
eef8ac26c66c Some missed LLVMDC -> LDC.
Christian Kamm <kamm incasoftware de>
parents: 194
diff changeset
2 #define LDC_IR_IRTYPE_H
158
287540c5f05e [svn r174] added file missing from previous commit [173]
ChristianK
parents:
diff changeset
3
173
db9890b3fb64 [svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents: 158
diff changeset
4 #include <set>
158
287540c5f05e [svn r174] added file missing from previous commit [173]
ChristianK
parents:
diff changeset
5
287540c5f05e [svn r174] added file missing from previous commit [173]
ChristianK
parents:
diff changeset
6 namespace llvm {
287540c5f05e [svn r174] added file missing from previous commit [173]
ChristianK
parents:
diff changeset
7 class PATypeHolder;
287540c5f05e [svn r174] added file missing from previous commit [173]
ChristianK
parents:
diff changeset
8 }
287540c5f05e [svn r174] added file missing from previous commit [173]
ChristianK
parents:
diff changeset
9
287540c5f05e [svn r174] added file missing from previous commit [173]
ChristianK
parents:
diff changeset
10 struct IrType
287540c5f05e [svn r174] added file missing from previous commit [173]
ChristianK
parents:
diff changeset
11 {
173
db9890b3fb64 [svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents: 158
diff changeset
12 static std::set<IrType*> list;
db9890b3fb64 [svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents: 158
diff changeset
13 static void resetAll();
db9890b3fb64 [svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents: 158
diff changeset
14
db9890b3fb64 [svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents: 158
diff changeset
15 // overload all of these to make sure
db9890b3fb64 [svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents: 158
diff changeset
16 // the static list is up to date
db9890b3fb64 [svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents: 158
diff changeset
17 IrType();
db9890b3fb64 [svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents: 158
diff changeset
18 IrType(const IrType& s);
db9890b3fb64 [svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents: 158
diff changeset
19 ~IrType();
db9890b3fb64 [svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents: 158
diff changeset
20
db9890b3fb64 [svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents: 158
diff changeset
21 void reset();
db9890b3fb64 [svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents: 158
diff changeset
22
158
287540c5f05e [svn r174] added file missing from previous commit [173]
ChristianK
parents:
diff changeset
23 llvm::PATypeHolder* type;
287540c5f05e [svn r174] added file missing from previous commit [173]
ChristianK
parents:
diff changeset
24 };
287540c5f05e [svn r174] added file missing from previous commit [173]
ChristianK
parents:
diff changeset
25
287540c5f05e [svn r174] added file missing from previous commit [173]
ChristianK
parents:
diff changeset
26 #endif