annotate ldc.conf.in @ 1410:cc2d8a7388c7

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)
author Frits van Bommel <fvbommel wxs.nl>
date Fri, 22 May 2009 13:17:06 +0200
parents 193ab3969920
children e16ea850ff81
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1103
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
1 // This configuration file uses libconfig.
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
2 // See http://www.hyperrealm.com/libconfig/ for syntax details.
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
3
1394
193ab3969920 Added a comment to the ldc.conf.in template about the %%ldcbinarydir%% "macro".
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents: 1340
diff changeset
4 // Special macros:
193ab3969920 Added a comment to the ldc.conf.in template about the %%ldcbinarydir%% "macro".
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents: 1340
diff changeset
5 // %%ldcbinarydir%%
193ab3969920 Added a comment to the ldc.conf.in template about the %%ldcbinarydir%% "macro".
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents: 1340
diff changeset
6 // - is replaced with the path to the directory holding the ldc executable
193ab3969920 Added a comment to the ldc.conf.in template about the %%ldcbinarydir%% "macro".
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents: 1340
diff changeset
7
1103
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
8 // The default group is required
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
9 default:
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
10 {
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
11 // 'switches' holds array of string that are appends to the command line
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
12 // arguments before they are parsed.
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
13 switches = [
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
14 "-I@RUNTIME_DIR@",
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
15 "-I@RUNTIME_DIR@/lib/common",
1340
206329112670 Fix the ldcbinarypath config file rewriting.
Christian Kamm <kamm incasoftware de>
parents: 1337
diff changeset
16 "-L-L%%ldcbinarypath%%/../lib",
1103
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
17 "-d-version=Tango",
1119
2cd6199488f6 Fix -g with default ldc.conf
Frits van Bommel <fvbommel wxs.nl>
parents: 1104
diff changeset
18 "-defaultlib=@RUNTIME_AIO@",
2cd6199488f6 Fix -g with default ldc.conf
Frits van Bommel <fvbommel wxs.nl>
parents: 1104
diff changeset
19 "-debuglib=@RUNTIME_AIO@"
1103
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
20 ];
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
21 };