mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-09-18 03:17:05 +02:00
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:
+30
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user