Mercurial > projects > ldc
annotate ir/irtype.cpp @ 1170:e40c65bd8c5d
Allow specific optimization passes to be requested from the command line.
Now you can run "`ldc test.d -c -mem2reg -simplifycfg`" if you feel the urge.
The -O<N> options are still supported, and are inserted in the passes list in
the position where they appear on the command line.
(so -simplifycfg -O1 -instcombine does the "right thing")
One small change: -inline is renamed to -enable-inlining due to a naming
conflict with the option to add the -inline pass. -inline now inserts the
inlining pass in the position specified, not in the middle of -O<N>.
(ldmd has been updated to translate -inline to -enable-inlining)
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sun, 29 Mar 2009 15:46:55 +0200 |
parents | 340acf1535d0 |
children |
rev | line source |
---|---|
173
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
1 #include "gen/llvm.h" |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
2 #include "ir/ir.h" |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
3 #include "ir/irtype.h" |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
4 |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
5 std::set<IrType*> IrType::list; |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
6 |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
7 void IrType::resetAll() |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
8 { |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
9 std::set<IrType*>::iterator it; |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
10 for(it = list.begin(); it != list.end(); ++it) |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
11 (*it)->reset(); |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
12 } |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
13 |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
14 IrType::IrType() |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
15 { |
174
16e676ae5ab4
[svn r190] Fixed array concatenation for some broken cases.
lindquist
parents:
173
diff
changeset
|
16 assert(list.insert(this).second); |
173
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
17 reset(); |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
18 } |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
19 |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
20 IrType::IrType(const IrType& s) |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
21 { |
174
16e676ae5ab4
[svn r190] Fixed array concatenation for some broken cases.
lindquist
parents:
173
diff
changeset
|
22 assert(list.insert(this).second); |
173
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
23 type = s.type; |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
24 } |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
25 |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
26 IrType::~IrType() |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
27 { |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
28 list.erase(this); |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
29 } |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
30 |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
31 void IrType::reset() |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
32 { |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
33 type = NULL; |
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
diff
changeset
|
34 } |