mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-06-02 15:06:00 +02:00
Merged the last bits of dmdfe 2.059
This commit is contained in:
55
dmd2/func.c
55
dmd2/func.c
@@ -190,6 +190,11 @@ void FuncDeclaration::semantic(Scope *sc)
|
||||
semanticRun = PASSsemantic;
|
||||
}
|
||||
|
||||
if (scope)
|
||||
{ sc = scope;
|
||||
scope = NULL;
|
||||
}
|
||||
|
||||
unsigned dprogress_save = Module::dprogress;
|
||||
|
||||
foverrides.setDim(0); // reset in case semantic() is being retried for this function
|
||||
@@ -2895,6 +2900,9 @@ int FuncDeclaration::isImportedSymbol()
|
||||
|
||||
int FuncDeclaration::isVirtual()
|
||||
{
|
||||
if (toAliasFunc() != this)
|
||||
return toAliasFunc()->isVirtual();
|
||||
|
||||
Dsymbol *p = toParent();
|
||||
#if 0
|
||||
printf("FuncDeclaration::isVirtual(%s)\n", toChars());
|
||||
@@ -2915,6 +2923,9 @@ int FuncDeclaration::isVirtual()
|
||||
|
||||
int FuncDeclaration::isVirtualMethod()
|
||||
{
|
||||
if (toAliasFunc() != this)
|
||||
return toAliasFunc()->isVirtualMethod();
|
||||
|
||||
//printf("FuncDeclaration::isVirtualMethod() %s\n", toChars());
|
||||
if (!isVirtual())
|
||||
return 0;
|
||||
@@ -2928,6 +2939,9 @@ int FuncDeclaration::isVirtualMethod()
|
||||
|
||||
int FuncDeclaration::isFinal()
|
||||
{
|
||||
if (toAliasFunc() != this)
|
||||
return toAliasFunc()->isFinal();
|
||||
|
||||
ClassDeclaration *cd;
|
||||
#if 0
|
||||
printf("FuncDeclaration::isFinal(%s), %x\n", toChars(), Declaration::isFinal());
|
||||
@@ -3444,6 +3458,11 @@ void CtorDeclaration::semantic(Scope *sc)
|
||||
TypeFunction *tf = (TypeFunction *)type;
|
||||
assert(tf && tf->ty == Tfunction);
|
||||
|
||||
if (scope)
|
||||
{ sc = scope;
|
||||
scope = NULL;
|
||||
}
|
||||
|
||||
sc = sc->push();
|
||||
sc->stc &= ~STCstatic; // not a static constructor
|
||||
sc->flags |= SCOPEctor;
|
||||
@@ -3563,6 +3582,10 @@ void PostBlitDeclaration::semantic(Scope *sc)
|
||||
//printf("PostBlitDeclaration::semantic() %s\n", toChars());
|
||||
//printf("ident: %s, %s, %p, %p\n", ident->toChars(), Id::dtor->toChars(), ident, Id::dtor);
|
||||
//printf("stc = x%llx\n", sc->stc);
|
||||
if (scope)
|
||||
{ sc = scope;
|
||||
scope = NULL;
|
||||
}
|
||||
parent = sc->parent;
|
||||
Dsymbol *parent = toParent();
|
||||
StructDeclaration *ad = parent->isStructDeclaration();
|
||||
@@ -3636,6 +3659,10 @@ void DtorDeclaration::semantic(Scope *sc)
|
||||
{
|
||||
//printf("DtorDeclaration::semantic() %s\n", toChars());
|
||||
//printf("ident: %s, %s, %p, %p\n", ident->toChars(), Id::dtor->toChars(), ident, Id::dtor);
|
||||
if (scope)
|
||||
{ sc = scope;
|
||||
scope = NULL;
|
||||
}
|
||||
parent = sc->parent;
|
||||
Dsymbol *parent = toParent();
|
||||
AggregateDeclaration *ad = parent->isAggregateDeclaration();
|
||||
@@ -3728,6 +3755,11 @@ void StaticCtorDeclaration::semantic(Scope *sc)
|
||||
{
|
||||
//printf("StaticCtorDeclaration::semantic()\n");
|
||||
|
||||
if (scope)
|
||||
{ sc = scope;
|
||||
scope = NULL;
|
||||
}
|
||||
|
||||
if (!type)
|
||||
type = new TypeFunction(NULL, Type::tvoid, FALSE, LINKd);
|
||||
|
||||
@@ -3856,6 +3888,11 @@ Dsymbol *StaticDtorDeclaration::syntaxCopy(Dsymbol *s)
|
||||
|
||||
void StaticDtorDeclaration::semantic(Scope *sc)
|
||||
{
|
||||
if (scope)
|
||||
{ sc = scope;
|
||||
scope = NULL;
|
||||
}
|
||||
|
||||
ClassDeclaration *cd = sc->scopesym->isClassDeclaration();
|
||||
|
||||
if (!type)
|
||||
@@ -3983,6 +4020,10 @@ Dsymbol *InvariantDeclaration::syntaxCopy(Dsymbol *s)
|
||||
|
||||
void InvariantDeclaration::semantic(Scope *sc)
|
||||
{
|
||||
if (scope)
|
||||
{ sc = scope;
|
||||
scope = NULL;
|
||||
}
|
||||
parent = sc->parent;
|
||||
Dsymbol *parent = toParent();
|
||||
AggregateDeclaration *ad = parent->isAggregateDeclaration();
|
||||
@@ -4063,6 +4104,10 @@ Dsymbol *UnitTestDeclaration::syntaxCopy(Dsymbol *s)
|
||||
|
||||
void UnitTestDeclaration::semantic(Scope *sc)
|
||||
{
|
||||
if (scope)
|
||||
{ sc = scope;
|
||||
scope = NULL;
|
||||
}
|
||||
#if IN_LLVM
|
||||
if (global.params.useUnitTests && sc->module->isRoot)
|
||||
#else
|
||||
@@ -4150,6 +4195,11 @@ void NewDeclaration::semantic(Scope *sc)
|
||||
{
|
||||
//printf("NewDeclaration::semantic()\n");
|
||||
|
||||
if (scope)
|
||||
{ sc = scope;
|
||||
scope = NULL;
|
||||
}
|
||||
|
||||
parent = sc->parent;
|
||||
Dsymbol *parent = toParent();
|
||||
ClassDeclaration *cd = parent->isClassDeclaration();
|
||||
@@ -4234,6 +4284,11 @@ void DeleteDeclaration::semantic(Scope *sc)
|
||||
{
|
||||
//printf("DeleteDeclaration::semantic()\n");
|
||||
|
||||
if (scope)
|
||||
{ sc = scope;
|
||||
scope = NULL;
|
||||
}
|
||||
|
||||
parent = sc->parent;
|
||||
Dsymbol *parent = toParent();
|
||||
ClassDeclaration *cd = parent->isClassDeclaration();
|
||||
|
||||
Reference in New Issue
Block a user