Commit graph

16 commits

Author SHA1 Message Date
Frits van Bommel
c8b10643f9 Add some missing returns. 2009-05-30 23:48:22 +02:00
Frits van Bommel
a24a2201f1 Teach -dgc2stack to preserve the call graph. This should allow for more
efficient execution by the pass manager.
2009-05-28 02:14:01 +02:00
Benjamin Kramer
46b200a4ed silence a gcc warning 2009-05-16 13:50:44 +02:00
Tomas Lindquist Olsen
f5d635dfc7 Adds explicit alignment information for alloca instructions in general, there's a few cases that still needs to be looked at but this should catch the majority. Fixes ticket #293 . 2009-05-14 13:26:40 +02:00
Frits van Bommel
e4e07baf87 Re-enable consistency check for fixed LLVM versions. 2009-05-11 15:48:33 +02:00
Frits van Bommel
49a2924823 Update for metadata changes in LLVM trunk. 2009-05-11 11:59:22 +02:00
Frits van Bommel
5b82f780f8 Allocate objects on the stack if they (a) don't have a destructor, and
(b) don't override the delete operator (on top of the regular conditions for
stack allocation that also apply to arrays, structs, etc.).
The "no destructor" clause is not strictly necessary, but calling them at the
right time would be tricky to say the least; it would involve, among other
things, "manually" inserting a try-finally block around anything that might
throw exceptions not caught in the current function.

Note: objects with custom new operators are automatically ignored because they
don't use the regular allocation runtime call, so there's no need to pay special
attention to them.
2009-05-09 00:50:15 +02:00
Frits van Bommel
adf1fd4d44 Work around an LLVM bug by not referring to globals from metadata. This was
only used for consistency checking anyway.
For the LLVM bug, see http://llvm.org/PR4180 / http://llvm.org/PR4046
2009-05-08 16:00:44 +02:00
Frits van Bommel
52c22c6c27 Stack-allocate zero-initialized arrays. 2009-05-06 20:27:48 +02:00
Frits van Bommel
ec573df5b2 Some refactoring 2009-05-06 15:58:15 +02:00
Frits van Bommel
c6b6d1874a Postpone (expensive) escape analysis until we're sure it's needed. 2009-05-06 14:11:37 +02:00
Frits van Bommel
f7e54dce10 Don't forget to update the control flow when deleting an invoke.
Fixes #284.
2009-05-04 12:08:30 +02:00
Frits van Bommel
fa79329102 Stack promotion for _d_newarrayvT. Array literals, concatenations (a ~ b) and
such are eligible for stack-allocation now.
2009-05-03 18:01:45 +02:00
Frits van Bommel
67fc0aca20 Remove some overly verbose debug output 2009-05-03 20:19:49 +02:00
Frits van Bommel
c831367b24 Factor out some constants into the header so producers and consumers of
metadata stay in sync (and are more readable).
2009-05-02 20:42:58 +02:00
Frits van Bommel
cff0f1f446 Implement another D-specific pass: -dgc2stack
This one promotes GC allocations to stack memory when it can determine it's safe
to do so.
Not all GC calls are recognized yet (in fact only one *is* recognized for now).
Needs metadata, so disabled for LLVM versions that don't support it.
2009-05-02 11:58:50 +02:00