Commit Graph

1356 Commits

Author SHA1 Message Date
Tomas Lindquist Olsen
ad142b5fda Erm... Revert the rev [1352] change, the original code was correct ... 2009-05-15 15:30:59 +02:00
Frits van Bommel
41c738f4da Re-apply [1346], which was reverted in [1348], now that padding should no longer
be a problem.
As noted before, this will break ABI-compatibility on x86-64, so recompile old
code before linking with newly-compiled code if you're on x86-64.
As an added bonus, I actually tested it this time :).
2009-05-14 20:40:56 +02:00
Frits van Bommel
287b1278d3 Remove struct padding when passing or returning in registers on x86-64 (extern(D) only) 2009-05-14 20:36:55 +02:00
Tomas Lindquist Olsen
a0678dc9ec Oups, fix assertion condition in disabled code from rev [1351]. 2009-05-14 17:23:55 +02:00
Tomas Lindquist Olsen
b147ecc66d Initial (but disabled) fix for ticket #294 , the actual part that fixes the bug is in a #if 0 block as I'm afraid it will cause regressions. I'm most likely not going to be around tonight, and maybe not tomorrow as well, so I'm pushing it in case someone wants to run some serious testing/investigate the problem noted in llvmhelpers.cpp : realignOffset . 2009-05-14 17:20:17 +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
Christian Kamm
5694ec18ff Use getenv on Windows, closes #248. 2009-05-13 18:08:40 +02:00
Frits van Bommel
72a546af4a Revert [1346] for now, it breaks because of padding :( 2009-05-12 16:53:43 +02:00
Frits van Bommel
35d62be334 Remove some other code that tested for LLVM before r67588. 2009-05-12 16:02:51 +02:00
Frits van Bommel
ec476cc5f1 Remove an old workaround that was kept around for ABI-compatibility on x86-64
between different LLVM versions.
This means LLVM r67588 is required if you want to compile for x86-64, otherwise
the backend will assert when you try to return e.g. struct { int i; char c; }
from a function. (In particular, this is no longer compatible with LLVM 2.5)
It also means that any code returning small structs on x86-64 will probably
need to be recompiled in order to be linkable to code compiled with this change.
2009-05-12 15:50:48 +02:00
Tomas Lindquist Olsen
77cb1c6b8e Added error instead of assertion failure when trying to get !TypeInfo for a forward declared struct. 2009-05-11 20:54:25 +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
Christian Kamm
041a8c4bd3 Fix DtoArrayCopyToSlice by passing length*sizeof(element) instead of just length to _d_array_slice_copy. 2009-05-10 22:26:04 +02:00
Frits van Bommel
57fc3463f6 Run backend without optimizations when no optimization parameters were used,
even when not generating debug info.
2009-05-10 20:22:08 +02:00
Christian Kamm
dfaba71dce Fix the ldcbinarypath config file rewriting. 2009-05-10 18:14:36 +02:00
Christian Kamm
d7c984fbef Explicitly include string.h for strdup. 2009-05-10 18:03:32 +02:00
Christian Kamm
226e85bf30 Automated merge with http://hg.dsource.org/projects/ldc 2009-05-10 17:58:35 +02:00
Christian Kamm
ba95eab71f In config file: replace %%ldcbinarypath%% with the path to the ldc executable. 2009-05-10 17:58:09 +02:00
Tomas Lindquist Olsen
3fb2cb0322 Okay... Fix the assertion as well, since 20 really is enough yet it wanted MORE... Despite the message. 2009-05-10 17:31:56 +02:00
Tomas Lindquist Olsen
0ab77de246 Increased a buffer size in TypeInfo_StaticArray from 10 to 20 to avoid assertion failures! Thanks LeoD. 2009-05-10 17:25:47 +02:00
Tomas Lindquist Olsen
4f59c0cb7b Removed fix from rev [1331] since rev [1333] adds a more general fix that catches more cases! 2009-05-10 15:50:51 +02:00
Christian Kamm
813c650517 Backport D2 CTFE cast behavior to allow cast(char[])char[n] to succeed. 2009-05-10 15:42:23 +02:00
Tomas Lindquist Olsen
ea00a120e9 Added testcase for #288 . 2009-05-10 14:37:30 +02:00
Tomas Lindquist Olsen
c6dca3fb76 Fixed CTFE evaluation on .dup . Fixes ticket #288 . 2009-05-10 14:32:23 +02:00
Tomas Lindquist Olsen
dbe4852b7b Fixed D-style vararg arguments with types that have sizes bigger that pointers, yet are not aligned to pointer sizes. Fixes ticket #276 . 2009-05-10 04:37:03 +02:00
Frits van Bommel
d1f582583b Turn new _d_array_slice_copy runtime call into memcpy when the slice lengths are
equal and alias analysis says it's safe.
2009-05-10 04:18:14 +02:00
Tomas Lindquist Olsen
dfea022a86 Changed array slice copying to call a runtime function when assertions or array bound checks are enabled instead of just doing a memcpy. This makes sure an exception is thrown if the copy is invalid (ie. different lengths or overlap). Fixes ticket #283 . Rebuilding the runtime is necessary. 2009-05-10 02:23:05 +02:00
Tomas Lindquist Olsen
54d9955abc Added reference to DMD bug for latest dstress "regressions" compile/m/mixin_29_E.d and compile/m/mixin_29_F.d . 2009-05-10 00:50:35 +02:00
Tomas Lindquist Olsen
ecc106d7b7 Fixed dmdfe generated class invariant calls. Also insert proper "this !is null" check before it. Fixed invariant* dstress regressions and generally seems like a good idea. Hope I didn't break anything.. minitests run fine! 2009-05-10 00:46:09 +02:00
Christian Kamm
06108db87e Yet another fdiv/fsub special case. 2009-05-09 20:13:05 +02:00
Christian Kamm
883f13dbce Strip metadata for -singleobj as a workaround to a LLVM linking bug. 2009-05-09 18:57:21 +02:00
Christian Kamm
cae1f425a0 Update for LLVM rev > 71348: getTypePaddedSize -> getTypeAllocSize 2009-05-09 18:57:00 +02:00
Tomas Lindquist Olsen
3aeb56abec Fixed compile unit for debug info for array operations, fixed ticket #280 . 2009-05-09 15:27:27 +02:00
Christian Kamm
81858cfc76 Automated merge with http://hg.dsource.org/projects/ldc 2009-05-09 08:58:55 +02:00
Christian Kamm
968e1148d8 Restrict second arg of certain floating-point stores to ST. Fix type postfix
for the two argument form of fistp and fisttp.
2009-05-09 08:58:41 +02:00
Frits van Bommel
634d623b34 Some tweaks to -simplify-drtcalls. 2009-05-09 02:34:27 +02:00
Frits van Bommel
039edd5cd4 Make sure this testcase keeps crashing with -O3.
Recent optimization improvements made LLVM realize the store-to-null was
unavoidable, so it deleted all of main() and replaced it with 'unreachable'.
Because the body of main() no longer even contained a return instruction,
calling it caused random code to be ran instead. This happened to be the code
that links in the ModuleInfo on my machine, which then returned "successfully".
2009-05-09 00:55:47 +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
5c29832ee7 Fix a bug pointed out by valgrind: OutBuffer::write4() was writing 8 bytes on
platforms with 64-bit longs.
2009-05-08 12:21:53 +02:00
Christian Kamm
cde738111c Fix type postfix for fistp/fisttp. Two operand form still broken (is it even legal?). 2009-05-07 21:49:58 +02:00
Frits van Bommel
f5b56ce346 Fix typo in function name 2009-05-07 15:33:06 +02:00
Christian Kamm
b6ad8b69ab Add newline to get rid of warning. 2009-05-07 21:07:50 +02:00
Christian Kamm
2afbfbe8da Automated merge with http://hg.dsource.org/projects/ldc 2009-05-07 21:01:57 +02:00
Christian Kamm
37edd5add6 Fix certain cases of floating point instruction mistranslation. 2009-05-07 21:01:44 +02:00
Tomas Lindquist Olsen
ca4f588c08 Fixed deal breaker bug for more-at-once compilation when any module contained aggregates. Fixes ticket #272 . 2009-05-07 02:10:29 +02:00
Frits van Bommel
7f07cf02ad Automated merge with http://hg.dsource.org/projects/ldc 2009-05-06 20:29:27 +02:00
Frits van Bommel
52c22c6c27 Stack-allocate zero-initialized arrays. 2009-05-06 20:27:48 +02:00
Christian Kamm
108309a579 Ignore short/long prefix of labels instead of ignoring the whole branch
instruction!
2009-05-06 19:56:33 +02:00