Frits van Bommel
adfc5b3ee9
Fix scope(exit) foreach (ref v; arr) foo(v);
2009-05-22 21:38:01 +02:00
Frits van Bommel
59f9b35cea
Count the sret register as well when keeping track of how many integer registers
...
are available for extern(C) functions on x86-64.
Interestingly, llvm-g++ seems to have a very similar bug: http://llvm.org/pr4242
(So this breaks ABI-compatibility with llvm-gcc for this corner case, but gains
it with gcc...)
To clarify, this is about code like this:
{{{
struct S { void*[3] data; }
struct T { void*[2] data; }
// The T should be passed in memory, and p in the last int register.
extern(C) S fail(int, int, int, int, T t, void* p) {
S s;
s.data[0] = t.data[0];
s.data[1] = t.data[1];
s.data[2] = p;
return s;
}
}}}
which should generate code functionally equivalent to this:
{{{
extern(C) S* succeed(S* s, int, int, int, int, T t, void* p) {
s.data[0] = t.data[0];
s.data[1] = t.data[1];
s.data[2] = p;
return s;
}
}}}
(with the same definitions for S and T)
2009-05-22 13:17:06 +02:00
Christian Kamm
86e1457dde
Automated merge with http://hg.dsource.org/projects/ldc
2009-05-22 10:18:04 +02:00
Christian Kamm
c433604243
Fix bug #307 by doing what DMD does: add the arrayop to
...
sc->module->importedFrom instead of sc->module. That way array ops in template
instantiations will be semantic3'ed.
2009-05-22 10:17:47 +02:00
Frits van Bommel
2739cd108c
Let TargetABI::passByValue() know when a parameter is byref (either explicitly
...
or because it's a static array) by giving it the pointer type instead of the
type itself.
This fixes Derelict compilation on x86-64, where the ABI wasn't expecting a
static array to be passed in at all.
2009-05-22 00:19:54 +02:00
Christian Kamm
d537ad0d48
Allow package protected members to be accessed by the declaring module even if
...
it isn't in a package.
2009-05-21 18:08:31 +02:00
Frits van Bommel
2f150ddd62
Oops, didn't mean to change debug info linkage.
2009-05-21 15:26:46 +02:00
Frits van Bommel
a520661667
Now that templates instantiations are no longer emitted for all modules that
...
even blink at them they seem to break due to being linkonce (if compiled with
any optimization level > 0), so let's give them weak linkage instead.
The difference is that unreferenced linkonce symbols can be deleted, while
weak symbols need to be preserved.
2009-05-21 15:23:28 +02:00
Christian Kamm
f675d36cfb
Tentative fix for semantic3 on imported modules and unnecessary template
...
function definition issue. Please test!
Also change linkage of __interfaceInfos to external (same as __Class, __vtbl,
__init). The other change might make this superfluous.
2009-05-21 10:56:04 +02:00
Christian Kamm
8e56fe69a4
Merged xfBuild patch for dependency tree generation. See #286 .
2009-05-20 21:13:41 +02:00
Frits van Bommel
95c35225bb
Don't print the entire declaration of the alliassee when ->toChars() is
...
called on an `AliasDeclaration`; just printing the name will do. This fixes
#305 , which otherwise tries to generate
{{{
class E {
void A() {
alias /* recurse into E->toCBuffer() */ m;
}
}
}}}
by way of an infinite recursion (causing a segfault when the stack runs out).
2009-05-20 16:20:59 +02:00
Frits van Bommel
ea4690128b
Merge some changes from Tango's object.di into the testincludes version.
2009-05-19 22:35:08 +02:00
Frits van Bommel
3164ceba17
Remove some overly verbose logging.
2009-05-19 20:46:33 +02:00
Kelly Wilson
16a2512808
remove extra 'test' instructions and fix 'test' properly
2009-05-19 12:28:44 -06:00
Kelly Wilson
8941b6960c
fix missing 'test' mnemonic and add several variations
2009-05-19 11:58:54 -06:00
Frits van Bommel
727e8f0dfb
Install ldmd too.
2009-05-19 16:40:37 +02:00
Tomas Lindquist Olsen
f733680251
Try to cut down reallocations when building string literals.
2009-05-18 16:01:22 +02:00
Tomas Lindquist Olsen
152db286c0
Added a comment to the ldc.conf.in template about the %%ldcbinarydir%% "macro".
2009-05-18 15:08:46 +02:00
Frits van Bommel
81cf30688a
Patch to allow compiling LDC with MinGW, by mp4 / [1]jaffa (slightly edited).
...
Closes #300 .
2009-05-18 14:02:50 +02:00
Frits van Bommel
1ca2ee5d66
Allow ignored pragmas to have a body; don't ignore the body.
...
Also, ignore errors while trying to make sense of parameters to ignored pragmas
for -v.
2009-05-17 23:33:35 +02:00
Tomas Lindquist Olsen
be25445461
Added simple check for ClassInfo change introduced in DMD 1.045, it must have 12 fields.
2009-05-17 23:15:04 +02:00
Frits van Bommel
827880e467
Don't try to strip metadata if we don't generate any
2009-05-17 22:40:02 +02:00
Tomas Lindquist Olsen
0b8413b4bc
Fixed class -> integer casts.
2009-05-17 22:02:03 +02:00
Tomas Lindquist Olsen
2690f3cfd8
Add debug info for all class fields, including those from super classes...
2009-05-17 17:55:53 +02:00
Tomas Lindquist Olsen
e2ba08388f
Added new FreeBSD and Solaris predefined version identifiers.
2009-05-17 17:10:26 +02:00
Tomas Lindquist Olsen
b64ad3299e
Use RTTIBuilder to build !ModuleInfo, still needs some work.
2009-05-17 17:04:47 +02:00
Tomas Lindquist Olsen
3e4ade93ba
Updated comment in RTTIBuilder.h
2009-05-17 16:31:23 +02:00
Tomas Lindquist Olsen
b1fa43ce24
Increased RTTIBuilder buffer to 14 constants, to be big enough for !ClassInfo as well as !TypeInfo
2009-05-17 16:29:49 +02:00
Tomas Lindquist Olsen
dc4b7e8118
Update !ClassInfo generation to use !RTTIBuilder, slight update of !RTTIBuilder .
2009-05-17 16:27:01 +02:00
Tomas Lindquist Olsen
b6daf3d545
Renamed !TypeInfoBuilder to !RTTIBuilder.
2009-05-17 15:20:58 +02:00
Tomas Lindquist Olsen
0414a5acbb
Fixed filename in array bounds check for mixed in imported template function. Fixes ticket #295 .
2009-05-17 14:56:29 +02:00
Tomas Lindquist Olsen
9be5694168
Added error messages when failed to open files for .bc and .ll output, instead of just trying to write to the stream, pretty similar to the #281 problem.
2009-05-17 14:40:09 +02:00
Tomas Lindquist Olsen
0a77bd9fa6
Add error message when failed to open output stream for native asm output. Fixes ticket #281 .
2009-05-17 14:20:27 +02:00
Frits van Bommel
b52ee2de13
Use %La to hex-format a real instead of pretending it's an integer.
2009-05-17 11:06:14 +02:00
Frits van Bommel
a75ddbf803
Specify a large integer constant more portably.
2009-05-17 10:33:21 +02:00
Tomas Lindquist Olsen
5078019c54
Cleaned up TypeInfo_Tuple generation.
2009-05-17 05:07:51 +02:00
Tomas Lindquist Olsen
d80de9deb3
Cleaned up TypeInfo_Struct.
...
Fixed problem with DtoConstSize_t taking a size_t argument, this is not enough for cross compiling from 32bit host to a 64bit target. It now takes uint64_t. There's probably a lot of similar case around to code ...
2009-05-17 04:41:10 +02:00
Tomas Lindquist Olsen
f3c7278e88
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
2009-05-17 03:10:55 +02:00
Frits van Bommel
371cdb71ba
Remove an incorrect attribute: noalias doesn't apply to struct types, even if
...
we prefer to think of that type as an array :(.
2009-05-17 02:22:21 +02:00
Frits van Bommel
76ae0b0ab6
Fix format-string bugs by adding __attribute__((__format__)) in all applicable
...
places and fixing all warnings my gcc produced.
Among other things, this should fix several segfaults (including one I just
ran into).
2009-05-17 00:15:25 +02:00
Christian Kamm
392a4a850e
Add patch for Tango 0.99.8.
2009-05-16 23:44:27 +02:00
Frits van Bommel
e7e3632d36
Remove a macro-redefinition warning
2009-05-16 23:00:56 +02:00
Tomas Lindquist Olsen
b87acdc36f
Updated DMDFE version id from 1.042 to 1.045 ...
2009-05-16 22:27:31 +02:00
Tomas Lindquist Olsen
6633d696c9
Forgot to set the (ClassInfo.flags & 32) bit added in 1.045.
2009-05-16 22:24:49 +02:00
Tomas Lindquist Olsen
e8780d50e8
Merged DMD 1.045 !!!
2009-05-16 22:21:31 +02:00
Tomas Lindquist Olsen
9beb33770f
Fixed previous aggregate initZ alignment.
...
Added missing IrType::isDelegate method.
2009-05-16 18:37:16 +02:00
Tomas Lindquist Olsen
2e33a6af9f
Added explicit alignment for aggregate __initZ symbols, this is needed for some union types, or the default initializer symbol might be misaligned.
2009-05-16 18:25:01 +02:00
Tomas Lindquist Olsen
c0f2af5afd
Added IrTypeFunction and IrTypeDelegate and eliminated IrDType. This means the Type::ir field can be removed. It's the final part needed for the move to a slightly more sane type system. Now the whole thing just needs to be cleaned up :P
...
Added -v-cg switch, which right now just prints "codegen: module.name (module/name.d)" to stdout, this can really help figuring out where, in some complex build command, things go wrong.
2009-05-16 18:19:52 +02:00
Christian Kamm
61514569ff
Automated merge with http://hg.dsource.org/projects/ldc
2009-05-16 14:22:23 +02:00
Christian Kamm
8c422bde53
Don't always expand aliases to FuncDecls to FuncAliasDecls - breaks for single
...
functions.
2009-05-16 14:22:09 +02:00