mirror of
https://github.com/cc65/cc65.git
synced 2025-01-12 02:30:44 +00:00
Changed "IsTypeStruct() || IsTypeUnion()" expressions into shorter "IsClassStruct()" expressions.
Type-classes are groups of types that can be handled in the same way (similar syntax).
This commit is contained in:
parent
ee208aecd6
commit
fd0a6955da
@ -396,7 +396,7 @@ static unsigned FunctionParamList (FuncDesc* Func, int IsFastcall)
|
||||
}
|
||||
|
||||
/* Handle struct/union specially */
|
||||
if (IsTypeStruct (Expr.Type) || IsTypeUnion (Expr.Type)) {
|
||||
if (IsClassStruct (Expr.Type)) {
|
||||
/* Use the replacement type */
|
||||
Flags |= TypeOf (GetStructReplacementType (Expr.Type));
|
||||
} else {
|
||||
@ -658,7 +658,7 @@ static void FunctionCall (ExprDesc* Expr)
|
||||
ReturnType = GetFuncReturn (Expr->Type);
|
||||
|
||||
/* Handle struct/union specially */
|
||||
if (IsTypeStruct (ReturnType) || IsTypeUnion (ReturnType)) {
|
||||
if (IsClassStruct (ReturnType)) {
|
||||
/* If there is no replacement type, then it is just the address */
|
||||
if (ReturnType == GetStructReplacementType (ReturnType)) {
|
||||
/* Dereference it */
|
||||
|
@ -477,7 +477,7 @@ void NewFunc (SymEntry* Func)
|
||||
Flags = CF_PTR;
|
||||
} else {
|
||||
/* Handle struct/union specially */
|
||||
if (IsTypeStruct (D->LastParam->Type) || IsTypeUnion (D->LastParam->Type)) {
|
||||
if (IsClassStruct (D->LastParam->Type)) {
|
||||
Flags = TypeOf (GetStructReplacementType (D->LastParam->Type)) | CF_FORCECHAR;
|
||||
} else {
|
||||
Flags = TypeOf (D->LastParam->Type) | CF_FORCECHAR;
|
||||
@ -506,7 +506,7 @@ void NewFunc (SymEntry* Func)
|
||||
|
||||
/* Check if we need copy for struct/union type */
|
||||
RType = Param->Type;
|
||||
if (IsTypeStruct (RType) || IsTypeUnion (RType)) {
|
||||
if (IsClassStruct (RType)) {
|
||||
RType = GetStructReplacementType (RType);
|
||||
|
||||
/* If there is no replacement type, then it is just the address.
|
||||
|
@ -329,7 +329,7 @@ static void ReturnStatement (void)
|
||||
TypeConversion (&Expr, F_GetReturnType (CurrentFunc));
|
||||
|
||||
/* Load the value into the primary */
|
||||
if (IsTypeStruct (Expr.Type) || IsTypeUnion (Expr.Type)) {
|
||||
if (IsClassStruct (Expr.Type)) {
|
||||
/* Handle struct/union specially */
|
||||
ReturnType = GetStructReplacementType (Expr.Type);
|
||||
if (ReturnType == Expr.Type) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user