annotate ldc.conf.in @ 1117:4c20fcc4252b

Fun with parameter attributes: For several of the "synthetic" parameters added to D functions, we can apply noalias and nocapture. They are sret parameters, 'nest' pointers passed to nested functions, and _argptr: Nocapture: - Sret and nest are nocapture because they don't represent D-level variables, and thus the callee can't (validly) obtain a pointer to them, let alone keep it around after it returns. - _argptr is nocapture because although the callee has access to it as a pointer, that pointer is invalidated when it returns. All three are noalias because they're function-local variables - Sret and _argptr are noalias because they're freshly alloca'd memory only used for a single function call that's not allowed to keep an aliasing pointer to it around (since the parameter is nocapture). - 'Nest' is noalias because the callee only ever has access to one such pointer per parent function, and every parent function has a different one. This commit also ensures attributes set on sret, _arguments and _argptr are propagated to calls to such functions. It also adds one exception to the general rule that attributes on function types should propagate to calls: the type of a delegate's function pointer has a 'nest' parameter, but this can either be a true 'nest' (for delegates to nested functions) or a 'this' (for delegates to member functions). Since 'this' is neither noalias nor nocapture, and there's generally no way to tell which one it is, we remove these attributes at the call site if the callee is a delegate.
author Frits van Bommel <fvbommel wxs.nl>
date Sat, 14 Mar 2009 22:15:31 +0100
parents 81fd116b5dc9
children 2cd6199488f6
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
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
4 // The default group is required
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
5 default:
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
6 {
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
7 // '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
8 // arguments before they are parsed.
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
9 switches = [
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
10 "-I@RUNTIME_DIR@",
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
11 "-I@RUNTIME_DIR@/lib/common",
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
12 "-L-L@PROJECT_BINARY_DIR@/../lib",
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
13 "-d-version=Tango",
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
14 "-defaultlib=@RUNTIME_AIO@"
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
15 ];
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 986
diff changeset
16 };