Removed RefineFuncDesc() as an unnecessary wrapper.

This commit is contained in:
acqn 2024-01-01 15:04:50 +08:00
parent 4e820677ee
commit 88246f852d
3 changed files with 5 additions and 36 deletions

View File

@ -741,7 +741,7 @@ static int HandleSymRedefinition (SymEntry* Sym, const Type* T, unsigned Flags)
/* Refine the existing composite prototype with this new
** one.
*/
RefineFuncDesc (Sym->Type, T);
TypeComposition (Sym->Type, T);
}
}

View File

@ -427,10 +427,6 @@ void TypeComposition (Type* lhs, const Type* rhs)
** type or this fails with a critical check.
*/
{
FuncDesc* F1;
FuncDesc* F2;
long LeftCount, RightCount;
/* Compose two types */
while (lhs->C != T_END) {
@ -445,8 +441,8 @@ void TypeComposition (Type* lhs, const Type* rhs)
/* Check for special type elements */
if (IsTypeFunc (lhs)) {
/* Compose the function descriptors */
F1 = GetFuncDesc (lhs);
F2 = GetFuncDesc (rhs);
FuncDesc* F1 = GetFuncDesc (lhs);
FuncDesc* F2 = GetFuncDesc (rhs);
/* If F1 has an empty parameter list (which does also mean, it is
** not a function definition, because the flag is reset in this
@ -470,8 +466,8 @@ void TypeComposition (Type* lhs, const Type* rhs)
}
} else if (IsTypeArray (lhs)) {
/* Check member count */
LeftCount = GetElementCount (lhs);
RightCount = GetElementCount (rhs);
long LeftCount = GetElementCount (lhs);
long RightCount = GetElementCount (rhs);
/* Set composite type if it is requested */
if (LeftCount != UNSPECIFIED) {
@ -485,28 +481,4 @@ void TypeComposition (Type* lhs, const Type* rhs)
++lhs;
++rhs;
}
return;
}
FuncDesc* RefineFuncDesc (Type* OldType, const Type* NewType)
/* Refine the existing function descriptor with a new one */
{
FuncDesc* Old = GetFuncDesc (OldType);
FuncDesc* New = GetFuncDesc (NewType);
CHECK (Old != 0 && New != 0);
if ((New->Flags & FD_EMPTY) == 0) {
if ((Old->Flags & FD_EMPTY) == 0) {
TypeComposition (OldType, NewType);
} else {
TypeCopy (OldType, NewType);
Old->Flags &= ~FD_EMPTY;
}
}
return Old;
}

View File

@ -63,9 +63,6 @@ void TypeComposition (Type* lhs, const Type* rhs);
** type or this fails with a critical check.
*/
FuncDesc* RefineFuncDesc (Type* OldType, const Type* NewType);
/* Refine the existing function descriptor with a new one */
/* End of typeconv.h */