Merge DMD r301: a little refactor and harmonize

---
 dmd/declaration.h |    1 +
 dmd/func.c        |   30 ++++++++++++++++++++++++++++++
 dmd/mtype.c       |   51 +++++++++++++++++++++++++++++++++++++--------------
 3 files changed, 68 insertions(+), 14 deletions(-)
This commit is contained in:
Leandro Lucarella
2010-01-06 15:18:21 -03:00
parent 2cdf1f6679
commit 072ac6c4e3
3 changed files with 68 additions and 14 deletions
+30
View File
@@ -850,6 +850,7 @@ void FuncDeclaration::semantic3(Scope *sc)
}
#endif
#if 0
// Propagate storage class from tuple parameters to their element-parameters.
if (f->parameters)
{
@@ -867,6 +868,7 @@ void FuncDeclaration::semantic3(Scope *sc)
}
}
}
#endif
/* Declare all the function parameters as variables
* and install them in parameters[]
@@ -2491,6 +2493,34 @@ Lyes:
}
#endif
/*********************************************
* Return the function's parameter list, and whether
* it is variadic or not.
*/
Parameters *FuncDeclaration::getParameters(int *pvarargs)
{ Parameters *fparameters;
int fvarargs;
if (type)
{
assert(type->ty == Tfunction);
TypeFunction *fdtype = (TypeFunction *)type;
fparameters = fdtype->parameters;
fvarargs = fdtype->varargs;
}
else // Constructors don't have type's
{ CtorDeclaration *fctor = isCtorDeclaration();
assert(fctor);
fparameters = fctor->arguments;
fvarargs = fctor->varargs;
}
if (pvarargs)
*pvarargs = fvarargs;
return fparameters;
}
/****************************** FuncAliasDeclaration ************************/
// Used as a way to import a set of functions from another scope into this one.