Mercurial > projects > ldc
annotate ir/ir.cpp @ 1150:2a687353c84d
Added missing new files.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Fri, 27 Mar 2009 23:24:47 +0100 |
parents | |
children |
rev | line source |
---|---|
1150
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
1 #include "llvm/Target/TargetData.h" |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
2 |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
3 #include "gen/irstate.h" |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
4 #include "gen/tollvm.h" |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
5 #include "gen/functions.h" |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
6 |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
7 #include "ir/ir.h" |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
8 #include "ir/irfunction.h" |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
9 |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
10 |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
11 unsigned GetTypeAlignment(Ir* ir, Type* t) |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
12 { |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
13 return gTargetData->getABITypeAlignment(DtoType(t)); |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
14 } |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
15 |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
16 Ir::Ir() |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
17 : irs(NULL) |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
18 { |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
19 } |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
20 |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
21 void Ir::addFunctionBody(IrFunction * f) |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
22 { |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
23 functionbodies.push_back(f); |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
24 } |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
25 |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
26 void Ir::emitFunctionBodies() |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
27 { |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
28 while (!functionbodies.empty()) |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
29 { |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
30 IrFunction* irf = functionbodies.front(); |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
31 functionbodies.pop_front(); |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
32 DtoDefineFunction(irf->decl); |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
33 } |
2a687353c84d
Added missing new files.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
diff
changeset
|
34 } |