mirror of https://git.wuffs.org/MWCC
rename TypeMethod and the struct type enums
This commit is contained in:
parent
a231f5dbb9
commit
5d0bbb19cc
|
@ -407,7 +407,7 @@ static void CABI_AllocateVTable(DeclE *decle, TypeClass *tclass) {
|
|||
CError_ASSERT(714, objbase = decle->objlist[i]);
|
||||
|
||||
if (objbase->otype == OT_OBJECT && OBJECT(objbase)->datatype == DVFUNC) {
|
||||
TypeMethod *tmethod = TYPE_METHOD(OBJECT(objbase)->type);
|
||||
TypeMemberFunc *tmethod = TYPE_METHOD(OBJECT(objbase)->type);
|
||||
Object *baseobj = CABI_FindZeroVirtualBaseMember(tclass, OBJECT(objbase));
|
||||
|
||||
if (baseobj) {
|
||||
|
|
|
@ -300,7 +300,7 @@ void CBrowse_AddClassMemberVar(ObjMemberVar *ivar, SInt32 startOffset, SInt32 en
|
|||
void CBrowse_AddClassMemberFunction(Object *object, SInt32 startOffset, SInt32 endOffset) {
|
||||
SInt32 flags;
|
||||
SInt32 id;
|
||||
TypeMethod *tfunc;
|
||||
TypeMemberFunc *tfunc;
|
||||
|
||||
CError_ASSERT(380, object);
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ Object *CClass_DummyDefaultConstructor(TypeClass *tclass) {
|
|||
FuncArg *args;
|
||||
NameSpaceObjectList *nsol;
|
||||
HashNameNode *name;
|
||||
TypeMethod *tmethod;
|
||||
TypeMemberFunc *tmethod;
|
||||
Object *object;
|
||||
ObjectList list;
|
||||
|
||||
|
@ -267,8 +267,8 @@ Object *CClass_DummyDefaultConstructor(TypeClass *tclass) {
|
|||
return OBJECT(nsol->object);
|
||||
}
|
||||
|
||||
tmethod = galloc(sizeof(TypeMethod));
|
||||
memclrw(tmethod, sizeof(TypeMethod));
|
||||
tmethod = galloc(sizeof(TypeMemberFunc));
|
||||
memclrw(tmethod, sizeof(TypeMemberFunc));
|
||||
|
||||
tmethod->type = TYPEFUNC;
|
||||
tmethod->functype = TYPE(&void_ptr);
|
||||
|
@ -1249,9 +1249,9 @@ static TypeList *CClass_GetCoVariantClassList(TypeList *list, TypeClass *tclass,
|
|||
return list;
|
||||
}
|
||||
|
||||
static TypeMethod *CClass_GetCovariantType(TypeMethod *tmethod, Type *type) {
|
||||
static TypeMemberFunc *CClass_GetCovariantType(TypeMemberFunc *tmethod, Type *type) {
|
||||
TypePointer *tptr;
|
||||
TypeMethod *result;
|
||||
TypeMemberFunc *result;
|
||||
|
||||
CError_ASSERT(1724,
|
||||
IS_TYPE_METHOD(tmethod) &&
|
||||
|
@ -1261,7 +1261,7 @@ static TypeMethod *CClass_GetCovariantType(TypeMethod *tmethod, Type *type) {
|
|||
*tptr = *TYPE_POINTER(tmethod->functype);
|
||||
tptr->target = type;
|
||||
|
||||
result = galloc(sizeof(TypeMethod));
|
||||
result = galloc(sizeof(TypeMemberFunc));
|
||||
*result = *tmethod;
|
||||
result->flags &= ~(FUNC_FLAGS_20 | FUNC_FLAGS_400000);
|
||||
result->functype = TYPE(tptr);
|
||||
|
|
|
@ -1413,7 +1413,7 @@ Object *CDecl_GetFunctionObject(DeclInfo *declinfo, NameSpace *nspace, Boolean *
|
|||
Type *type;
|
||||
NameSpace *nspace2;
|
||||
NameSpaceObjectList *list;
|
||||
TypeMethod tmp;
|
||||
TypeMemberFunc tmp;
|
||||
Boolean outflag;
|
||||
|
||||
r27 = 0;
|
||||
|
@ -3138,11 +3138,11 @@ void CDecl_ExtractClassExportFlags(DeclInfo *declinfo, UInt8 flags) {
|
|||
declinfo->exportflags |= EXPORT_FLAGS_EXPORT;
|
||||
}
|
||||
|
||||
TypeMethod *CDecl_MakeTypeMemberFunc(TypeFunc *tfunc, TypeClass *tclass, Boolean flag) {
|
||||
TypeMethod *method;
|
||||
TypeMemberFunc *CDecl_MakeTypeMemberFunc(TypeFunc *tfunc, TypeClass *tclass, Boolean flag) {
|
||||
TypeMemberFunc *method;
|
||||
|
||||
method = galloc(sizeof(TypeMethod));
|
||||
memclrw(method, sizeof(TypeMethod));
|
||||
method = galloc(sizeof(TypeMemberFunc));
|
||||
memclrw(method, sizeof(TypeMemberFunc));
|
||||
*TYPE_FUNC(method) = *tfunc;
|
||||
method->theclass = tclass;
|
||||
method->x26 = flag;
|
||||
|
@ -3167,7 +3167,7 @@ static void CDecl_MakeFunctionVirtual(TypeClass *tclass, Object *func) {
|
|||
static void CDecl_AddFunctionMember(DeclE *decle, TypeClass *tclass, DeclInfo *declinfo, short access, Boolean flag1, Boolean flag2, Boolean flag3, Boolean flag4) {
|
||||
NameSpaceObjectList *list; // r20
|
||||
Object *obj; // also r20
|
||||
TypeMethod *tfunc; // r19
|
||||
TypeMemberFunc *tfunc; // r19
|
||||
Boolean r31;
|
||||
Boolean outflag;
|
||||
|
||||
|
@ -4200,9 +4200,9 @@ static short getaccesstype(AccessType a, AccessType b, AccessType c) {
|
|||
return ACCESSPUBLIC;
|
||||
}
|
||||
|
||||
static TypeMethod *CDecl_MakeDefaultCtorType(TypeClass *tclass) {
|
||||
TypeMethod *tmeth = galloc(sizeof(TypeMethod));
|
||||
memclrw(tmeth, sizeof(TypeMethod));
|
||||
static TypeMemberFunc *CDecl_MakeDefaultCtorType(TypeClass *tclass) {
|
||||
TypeMemberFunc *tmeth = galloc(sizeof(TypeMemberFunc));
|
||||
memclrw(tmeth, sizeof(TypeMemberFunc));
|
||||
tmeth->type = TYPEFUNC;
|
||||
tmeth->functype = TYPE(&void_ptr);
|
||||
tmeth->flags = FUNC_FLAGS_1000 | FUNC_FLAGS_100 | FUNC_FLAGS_METHOD;
|
||||
|
@ -4220,7 +4220,7 @@ static void CDecl_AddDefArgConstructor(TypeClass *tclass) {
|
|||
// empty
|
||||
}
|
||||
|
||||
static void CDecl_AddMemberFunctionObject(TypeClass *tclass, HashNameNode *name, TypeMethod *tmeth, short access) {
|
||||
static void CDecl_AddMemberFunctionObject(TypeClass *tclass, HashNameNode *name, TypeMemberFunc *tmeth, short access) {
|
||||
Object *obj = CParser_NewCompilerDefFunctionObject();
|
||||
obj->name = name;
|
||||
obj->type = TYPE(tmeth);
|
||||
|
@ -4272,10 +4272,10 @@ static void CDecl_AddDefaultConstructor(DeclE *decle, TypeClass *tclass) {
|
|||
}
|
||||
}
|
||||
|
||||
static TypeMethod *CDecl_MakeCopyCtorType(TypeClass *tclass, Boolean is_const) {
|
||||
static TypeMemberFunc *CDecl_MakeCopyCtorType(TypeClass *tclass, Boolean is_const) {
|
||||
FuncArg *arg;
|
||||
TypeMethod *tmeth = galloc(sizeof(TypeMethod));
|
||||
memclrw(tmeth, sizeof(TypeMethod));
|
||||
TypeMemberFunc *tmeth = galloc(sizeof(TypeMemberFunc));
|
||||
memclrw(tmeth, sizeof(TypeMemberFunc));
|
||||
tmeth->type = TYPEFUNC;
|
||||
tmeth->functype = TYPE(&void_ptr);
|
||||
tmeth->flags = FUNC_FLAGS_1000 | FUNC_FLAGS_100 | FUNC_FLAGS_METHOD;
|
||||
|
@ -4353,10 +4353,10 @@ static void CDecl_AddDefaultCopyConstructor(DeclE *decle, TypeClass *tclass) {
|
|||
}
|
||||
}
|
||||
|
||||
static TypeMethod *CDecl_MakeAssignmentOperatorType(TypeClass *tclass, Boolean is_const) {
|
||||
static TypeMemberFunc *CDecl_MakeAssignmentOperatorType(TypeClass *tclass, Boolean is_const) {
|
||||
FuncArg *arg;
|
||||
TypeMethod *tmeth = galloc(sizeof(TypeMethod));
|
||||
memclrw(tmeth, sizeof(TypeMethod));
|
||||
TypeMemberFunc *tmeth = galloc(sizeof(TypeMemberFunc));
|
||||
memclrw(tmeth, sizeof(TypeMemberFunc));
|
||||
tmeth->type = TYPEFUNC;
|
||||
tmeth->functype = CDecl_NewRefPointerType(TYPE(tclass));
|
||||
tmeth->flags = FUNC_FLAGS_100 | FUNC_FLAGS_METHOD;
|
||||
|
@ -4424,9 +4424,9 @@ static void CDecl_AddDefaultAssignmentOperator(DeclE *decle, TypeClass *tclass)
|
|||
}
|
||||
}
|
||||
|
||||
TypeMethod *CDecl_MakeDefaultDtorType(TypeClass *tclass, Boolean is_virtual) {
|
||||
TypeMethod *tmeth = galloc(sizeof(TypeMethod));
|
||||
memclrw(tmeth, sizeof(TypeMethod));
|
||||
TypeMemberFunc *CDecl_MakeDefaultDtorType(TypeClass *tclass, Boolean is_virtual) {
|
||||
TypeMemberFunc *tmeth = galloc(sizeof(TypeMemberFunc));
|
||||
memclrw(tmeth, sizeof(TypeMemberFunc));
|
||||
tmeth->type = TYPEFUNC;
|
||||
tmeth->functype = (Type *) &void_ptr;
|
||||
tmeth->flags = FUNC_FLAGS_2000 | FUNC_FLAGS_100 | FUNC_FLAGS_METHOD;
|
||||
|
|
|
@ -374,17 +374,17 @@ void CError_BufferAppendType(CErrorBuffer *eb, Type *ty, UInt32 qual) {
|
|||
case STRUCT_TYPE_UNION:
|
||||
CError_BufferAppendString(eb, "union ");
|
||||
break;
|
||||
case STRUCT_TYPE_4:
|
||||
case STRUCT_TYPE_5:
|
||||
case STRUCT_TYPE_6:
|
||||
case STRUCT_TYPE_7:
|
||||
case STRUCT_TYPE_8:
|
||||
case STRUCT_TYPE_9:
|
||||
case STRUCT_TYPE_A:
|
||||
case STRUCT_TYPE_B:
|
||||
case STRUCT_TYPE_C:
|
||||
case STRUCT_TYPE_D:
|
||||
case STRUCT_TYPE_E:
|
||||
case STRUCT_VECTOR_UCHAR:
|
||||
case STRUCT_VECTOR_SCHAR:
|
||||
case STRUCT_VECTOR_BCHAR:
|
||||
case STRUCT_VECTOR_USHORT:
|
||||
case STRUCT_VECTOR_SSHORT:
|
||||
case STRUCT_VECTOR_BSHORT:
|
||||
case STRUCT_VECTOR_UINT:
|
||||
case STRUCT_VECTOR_SINT:
|
||||
case STRUCT_VECTOR_BINT:
|
||||
case STRUCT_VECTOR_FLOAT:
|
||||
case STRUCT_VECTOR_PIXEL:
|
||||
break;
|
||||
default:
|
||||
CError_FATAL(618);
|
||||
|
|
|
@ -950,7 +950,7 @@ ENode *CExpr_MakeNameLookupResultExpr(CScopeParseResult *pr) {
|
|||
|
||||
static Type *CExpr_NewPTMType(EMemberInfo *member, Object *obj) {
|
||||
TypeMemberPointer *ptm;
|
||||
TypeMethod *tmethod;
|
||||
TypeMemberFunc *tmethod;
|
||||
BClassList *path;
|
||||
|
||||
ptm = galloc(sizeof(TypeMemberPointer));
|
||||
|
@ -971,8 +971,8 @@ static Type *CExpr_NewPTMType(EMemberInfo *member, Object *obj) {
|
|||
CError_ASSERT(1308, IS_TYPE_FUNC(obj->type));
|
||||
}
|
||||
|
||||
tmethod = galloc(sizeof(TypeMethod));
|
||||
memclrw(tmethod, sizeof(TypeMethod));
|
||||
tmethod = galloc(sizeof(TypeMemberFunc));
|
||||
memclrw(tmethod, sizeof(TypeMemberFunc));
|
||||
*tmethod = *TYPE_METHOD(obj->type);
|
||||
|
||||
CError_ASSERT(1312, tmethod->args);
|
||||
|
@ -1376,15 +1376,15 @@ static ENode *CExpr_ParseVecStep(void) {
|
|||
CDecl_CompleteType(type);
|
||||
if (IS_TYPE_VECTOR(type)) {
|
||||
switch (TYPE_STRUCT(type)->stype) {
|
||||
case STRUCT_TYPE_4:
|
||||
case STRUCT_TYPE_5:
|
||||
case STRUCT_TYPE_6:
|
||||
case STRUCT_VECTOR_UCHAR:
|
||||
case STRUCT_VECTOR_SCHAR:
|
||||
case STRUCT_VECTOR_BCHAR:
|
||||
value = 16;
|
||||
break;
|
||||
case STRUCT_TYPE_7:
|
||||
case STRUCT_TYPE_8:
|
||||
case STRUCT_TYPE_9:
|
||||
case STRUCT_TYPE_E:
|
||||
case STRUCT_VECTOR_USHORT:
|
||||
case STRUCT_VECTOR_SSHORT:
|
||||
case STRUCT_VECTOR_BSHORT:
|
||||
case STRUCT_VECTOR_PIXEL:
|
||||
value = 8;
|
||||
break;
|
||||
default:
|
||||
|
@ -2013,7 +2013,7 @@ loop:
|
|||
}
|
||||
goto loop;
|
||||
}
|
||||
if (!IS_TYPE_STRUCT(expr->rtype) || TYPE_STRUCT(expr->rtype)->stype > STRUCT_TYPE_3) {
|
||||
if (!IS_TYPE_STRUCT(expr->rtype) || TYPE_STRUCT(expr->rtype)->stype > STRUCT_TYPE_MAX) {
|
||||
if (copts.cplusplus && (subexpr = CExpr_DummyDestr(expr)))
|
||||
return subexpr;
|
||||
CError_ErrorSkip(CErrorStr149);
|
||||
|
@ -2296,7 +2296,7 @@ ENode *getpointertomemberfunc(ENode *expr, Type *type, Boolean flag) {
|
|||
Object *obj;
|
||||
Object *dataobj;
|
||||
Type *ptmtype;
|
||||
TypeMethod *tmethod;
|
||||
TypeMemberFunc *tmethod;
|
||||
OLinkList *olist;
|
||||
SInt32 data[3];
|
||||
|
||||
|
|
|
@ -1810,7 +1810,7 @@ short user_assign_check(ENode *expr, Type *type, UInt32 qual, Boolean flag1, Boo
|
|||
short r14b;
|
||||
TypeFunc *r14c;
|
||||
ENodeList *r14d;
|
||||
TypeMethod *r13;
|
||||
TypeMemberFunc *r13;
|
||||
ENodeList *r13b;
|
||||
short result;
|
||||
FuncArg *arg;
|
||||
|
|
|
@ -900,9 +900,9 @@ static void CInit_InitTypeStruct(CInit_Stuff *s, CInit_Stuff2 *s2, const TypeStr
|
|||
tk = lex();
|
||||
if (IS_TYPESTRUCT_VECTOR(tstruct)) {
|
||||
switch (TYPE_STRUCT(tstruct)->stype) {
|
||||
case STRUCT_TYPE_4:
|
||||
case STRUCT_TYPE_5:
|
||||
case STRUCT_TYPE_6:
|
||||
case STRUCT_VECTOR_UCHAR:
|
||||
case STRUCT_VECTOR_SCHAR:
|
||||
case STRUCT_VECTOR_BCHAR:
|
||||
if (count != 16) {
|
||||
if (count == 1) {
|
||||
UInt8 val, *p;
|
||||
|
@ -915,10 +915,10 @@ static void CInit_InitTypeStruct(CInit_Stuff *s, CInit_Stuff2 *s2, const TypeStr
|
|||
}
|
||||
}
|
||||
break;
|
||||
case STRUCT_TYPE_7:
|
||||
case STRUCT_TYPE_8:
|
||||
case STRUCT_TYPE_9:
|
||||
case STRUCT_TYPE_E:
|
||||
case STRUCT_VECTOR_USHORT:
|
||||
case STRUCT_VECTOR_SSHORT:
|
||||
case STRUCT_VECTOR_BSHORT:
|
||||
case STRUCT_VECTOR_PIXEL:
|
||||
if (count != 8) {
|
||||
if (count == 1) {
|
||||
SInt16 val, *p;
|
||||
|
@ -931,10 +931,10 @@ static void CInit_InitTypeStruct(CInit_Stuff *s, CInit_Stuff2 *s2, const TypeStr
|
|||
}
|
||||
}
|
||||
break;
|
||||
case STRUCT_TYPE_A:
|
||||
case STRUCT_TYPE_B:
|
||||
case STRUCT_TYPE_C:
|
||||
case STRUCT_TYPE_D:
|
||||
case STRUCT_VECTOR_UINT:
|
||||
case STRUCT_VECTOR_SINT:
|
||||
case STRUCT_VECTOR_BINT:
|
||||
case STRUCT_VECTOR_FLOAT:
|
||||
if (count != 4) {
|
||||
if (count == 1) {
|
||||
UInt32 val, *p;
|
||||
|
|
|
@ -95,23 +95,23 @@ static StructMember stVF_float2 = {&stVF_float3, (Type *) &stfloat, NULL, 8, 0};
|
|||
static StructMember stVF_float1 = {&stVF_float2, (Type *) &stfloat, NULL, 4, 0};
|
||||
static StructMember stVF_float0 = {&stVF_float1, (Type *) &stfloat, NULL, 0, 0};
|
||||
|
||||
TypeStruct stvectorunsignedchar = {TYPESTRUCT, 16, NULL, &stVUC_unsignedchar0, STRUCT_TYPE_4, 16};
|
||||
TypeStruct stvectorsignedchar = {TYPESTRUCT, 16, NULL, &stVSC_signedchar0, STRUCT_TYPE_5, 16};
|
||||
TypeStruct stvectorboolchar = {TYPESTRUCT, 16, NULL, &stVSC_signedchar0, STRUCT_TYPE_6, 16};
|
||||
TypeStruct stvectorunsignedchar = {TYPESTRUCT, 16, NULL, &stVUC_unsignedchar0, STRUCT_VECTOR_UCHAR, 16};
|
||||
TypeStruct stvectorsignedchar = {TYPESTRUCT, 16, NULL, &stVSC_signedchar0, STRUCT_VECTOR_SCHAR, 16};
|
||||
TypeStruct stvectorboolchar = {TYPESTRUCT, 16, NULL, &stVSC_signedchar0, STRUCT_VECTOR_BCHAR, 16};
|
||||
|
||||
TypeStruct stvectorunsignedshort = {TYPESTRUCT, 16, NULL, &stVUS_unsignedshort0, STRUCT_TYPE_7, 16};
|
||||
TypeStruct stvectorsignedshort = {TYPESTRUCT, 16, NULL, &stVSS_signedshort0, STRUCT_TYPE_8, 16};
|
||||
TypeStruct stvectorboolshort = {TYPESTRUCT, 16, NULL, &stVSS_signedshort0, STRUCT_TYPE_9, 16};
|
||||
TypeStruct stvectorunsignedshort = {TYPESTRUCT, 16, NULL, &stVUS_unsignedshort0, STRUCT_VECTOR_USHORT, 16};
|
||||
TypeStruct stvectorsignedshort = {TYPESTRUCT, 16, NULL, &stVSS_signedshort0, STRUCT_VECTOR_SSHORT, 16};
|
||||
TypeStruct stvectorboolshort = {TYPESTRUCT, 16, NULL, &stVSS_signedshort0, STRUCT_VECTOR_BSHORT, 16};
|
||||
|
||||
TypeStruct stvectorunsignedlong = {TYPESTRUCT, 16, NULL, &stVUL_unsignedlong0, STRUCT_TYPE_A, 16};
|
||||
TypeStruct stvectorsignedlong = {TYPESTRUCT, 16, NULL, &stVSL_signedlong0, STRUCT_TYPE_B, 16};
|
||||
TypeStruct stvectorboollong = {TYPESTRUCT, 16, NULL, &stVSL_signedlong0, STRUCT_TYPE_C, 16};
|
||||
TypeStruct stvectorunsignedlong = {TYPESTRUCT, 16, NULL, &stVUL_unsignedlong0, STRUCT_VECTOR_UINT, 16};
|
||||
TypeStruct stvectorsignedlong = {TYPESTRUCT, 16, NULL, &stVSL_signedlong0, STRUCT_VECTOR_SINT, 16};
|
||||
TypeStruct stvectorboollong = {TYPESTRUCT, 16, NULL, &stVSL_signedlong0, STRUCT_VECTOR_BINT, 16};
|
||||
|
||||
TypeStruct stvectorfloat = {TYPESTRUCT, 16, NULL, &stVF_float0, STRUCT_TYPE_D, 16};
|
||||
TypeStruct stvectorfloat = {TYPESTRUCT, 16, NULL, &stVF_float0, STRUCT_VECTOR_FLOAT, 16};
|
||||
|
||||
TypeStruct stvectorpixel = {TYPESTRUCT, 16, NULL, &stVUS_unsignedshort0, STRUCT_TYPE_E, 16};
|
||||
TypeStruct stvectorpixel = {TYPESTRUCT, 16, NULL, &stVUS_unsignedshort0, STRUCT_VECTOR_PIXEL, 16};
|
||||
|
||||
TypeStruct stvector = {TYPESTRUCT, 16, NULL, NULL, STRUCT_TYPE_A, 16};
|
||||
TypeStruct stvector = {TYPESTRUCT, 16, NULL, NULL, STRUCT_VECTOR_UINT, 16};
|
||||
|
||||
static SInt32 cmach_structoffset;
|
||||
static UInt8 cmach_structalign;
|
||||
|
@ -217,7 +217,7 @@ SInt32 CMach_AllocationAlignment(Type *type, UInt32 qual) {
|
|||
align = anotheralign;
|
||||
|
||||
if (copts.optimizationlevel > 0) {
|
||||
if (type->type == TYPEARRAY || (type->type == TYPESTRUCT && (TYPE_STRUCT(type)->stype < STRUCT_TYPE_4 || TYPE_STRUCT(type)->stype > STRUCT_TYPE_E)) || type->type == TYPECLASS || (type->type == TYPEMEMBERPOINTER && (UInt32) type->size == 12)) {
|
||||
if (type->type == TYPEARRAY || (type->type == TYPESTRUCT && (TYPE_STRUCT(type)->stype < STRUCT_VECTOR_UCHAR || TYPE_STRUCT(type)->stype > STRUCT_VECTOR_PIXEL)) || type->type == TYPECLASS || (type->type == TYPEMEMBERPOINTER && (UInt32) type->size == 12)) {
|
||||
return (copts.min_struct_alignment > align) ? copts.min_struct_alignment : align;
|
||||
}
|
||||
}
|
||||
|
@ -581,29 +581,29 @@ void CMach_InitVectorMem(Type *type, MWVector128 val, void *mem, Boolean flag) {
|
|||
switch (type->type) {
|
||||
case TYPESTRUCT:
|
||||
switch (TYPE_STRUCT(type)->stype) {
|
||||
case STRUCT_TYPE_4:
|
||||
case STRUCT_TYPE_5:
|
||||
case STRUCT_TYPE_6:
|
||||
case STRUCT_VECTOR_UCHAR:
|
||||
case STRUCT_VECTOR_SCHAR:
|
||||
case STRUCT_VECTOR_BCHAR:
|
||||
for (i = 0; i < 16; i++)
|
||||
uc[i] = val.uc[i];
|
||||
memcpy(mem, uc, 16);
|
||||
break;
|
||||
case STRUCT_TYPE_7:
|
||||
case STRUCT_TYPE_8:
|
||||
case STRUCT_TYPE_9:
|
||||
case STRUCT_TYPE_E:
|
||||
case STRUCT_VECTOR_USHORT:
|
||||
case STRUCT_VECTOR_SSHORT:
|
||||
case STRUCT_VECTOR_BSHORT:
|
||||
case STRUCT_VECTOR_PIXEL:
|
||||
for (i = 0; i < 8; i++)
|
||||
us[i] = val.us[i];
|
||||
memcpy(mem, us, 16);
|
||||
break;
|
||||
case STRUCT_TYPE_A:
|
||||
case STRUCT_TYPE_B:
|
||||
case STRUCT_TYPE_C:
|
||||
case STRUCT_VECTOR_UINT:
|
||||
case STRUCT_VECTOR_SINT:
|
||||
case STRUCT_VECTOR_BINT:
|
||||
for (i = 0; i < 4; i++)
|
||||
ul[i] = val.ul[i];
|
||||
memcpy(mem, ul, 16);
|
||||
break;
|
||||
case STRUCT_TYPE_D:
|
||||
case STRUCT_VECTOR_FLOAT:
|
||||
for (i = 0; i < 4; i++)
|
||||
f[i] = val.f[i];
|
||||
memcpy(mem, f, 16);
|
||||
|
@ -841,7 +841,7 @@ static SInt16 CMach_GetQualifiedStructAlign(const TypeStruct *tstruct, Boolean f
|
|||
SInt32 align;
|
||||
Boolean isFirst;
|
||||
|
||||
if (tstruct->stype >= STRUCT_TYPE_4 && tstruct->stype <= STRUCT_TYPE_E)
|
||||
if (tstruct->stype >= STRUCT_VECTOR_UCHAR && tstruct->stype <= STRUCT_VECTOR_PIXEL)
|
||||
return 16;
|
||||
|
||||
switch (copts.structalignment) {
|
||||
|
@ -1030,7 +1030,7 @@ static SInt16 CMach_GetQualifiedTypeAlign(Type *type, Boolean flag) {
|
|||
Boolean isWin;
|
||||
SInt16 align;
|
||||
|
||||
if (type->type == TYPESTRUCT && TYPE_STRUCT(type)->stype >= STRUCT_TYPE_4 && TYPE_STRUCT(type)->stype <= STRUCT_TYPE_E)
|
||||
if (type->type == TYPESTRUCT && TYPE_STRUCT(type)->stype >= STRUCT_VECTOR_UCHAR && TYPE_STRUCT(type)->stype <= STRUCT_VECTOR_PIXEL)
|
||||
return 16;
|
||||
|
||||
switch (copts.structalignment) {
|
||||
|
@ -1295,7 +1295,7 @@ static Boolean CMach_IsTrivialClass(TypeClass *tclass) {
|
|||
UInt8 CMach_GetFunctionResultClass(TypeFunc *tfunc) {
|
||||
switch (tfunc->functype->type) {
|
||||
case TYPESTRUCT:
|
||||
if (tfunc->functype->type == TYPESTRUCT && TYPE_STRUCT(tfunc->functype)->stype >= STRUCT_TYPE_4 && TYPE_STRUCT(tfunc->functype)->stype <= STRUCT_TYPE_E)
|
||||
if (tfunc->functype->type == TYPESTRUCT && TYPE_STRUCT(tfunc->functype)->stype >= STRUCT_VECTOR_UCHAR && TYPE_STRUCT(tfunc->functype)->stype <= STRUCT_VECTOR_PIXEL)
|
||||
return 0;
|
||||
case TYPECLASS:
|
||||
case TYPEMEMBERPOINTER:
|
||||
|
@ -1308,7 +1308,7 @@ UInt8 CMach_GetFunctionResultClass(TypeFunc *tfunc) {
|
|||
Boolean CMach_PassResultInHiddenArg(Type *type) {
|
||||
switch (type->type) {
|
||||
case TYPESTRUCT:
|
||||
if (TYPE_STRUCT(type)->stype >= STRUCT_TYPE_4 && TYPE_STRUCT(type)->stype <= STRUCT_TYPE_E)
|
||||
if (TYPE_STRUCT(type)->stype >= STRUCT_VECTOR_UCHAR && TYPE_STRUCT(type)->stype <= STRUCT_VECTOR_PIXEL)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
|
|
|
@ -432,37 +432,37 @@ static void CMangler_MangleTypeAppend(Type *type, UInt32 qual) {
|
|||
case TYPESTRUCT:
|
||||
CMangler_MangleQualifier(qual);
|
||||
switch (TYPE_STRUCT(type)->stype) {
|
||||
case STRUCT_TYPE_4:
|
||||
case STRUCT_VECTOR_UCHAR:
|
||||
AppendGListName(&name_mangle_list, "XUc");
|
||||
return;
|
||||
case STRUCT_TYPE_5:
|
||||
case STRUCT_VECTOR_SCHAR:
|
||||
AppendGListName(&name_mangle_list, "Xc");
|
||||
return;
|
||||
case STRUCT_TYPE_6:
|
||||
case STRUCT_VECTOR_BCHAR:
|
||||
AppendGListName(&name_mangle_list, "XC");
|
||||
return;
|
||||
case STRUCT_TYPE_7:
|
||||
case STRUCT_VECTOR_USHORT:
|
||||
AppendGListName(&name_mangle_list, "XUs");
|
||||
return;
|
||||
case STRUCT_TYPE_8:
|
||||
case STRUCT_VECTOR_SSHORT:
|
||||
AppendGListName(&name_mangle_list, "Xs");
|
||||
return;
|
||||
case STRUCT_TYPE_9:
|
||||
case STRUCT_VECTOR_BSHORT:
|
||||
AppendGListName(&name_mangle_list, "XS");
|
||||
return;
|
||||
case STRUCT_TYPE_A:
|
||||
case STRUCT_VECTOR_UINT:
|
||||
AppendGListName(&name_mangle_list, "XUi");
|
||||
return;
|
||||
case STRUCT_TYPE_B:
|
||||
case STRUCT_VECTOR_SINT:
|
||||
AppendGListName(&name_mangle_list, "Xi");
|
||||
return;
|
||||
case STRUCT_TYPE_C:
|
||||
case STRUCT_VECTOR_BINT:
|
||||
AppendGListName(&name_mangle_list, "XI");
|
||||
return;
|
||||
case STRUCT_TYPE_D:
|
||||
case STRUCT_VECTOR_FLOAT:
|
||||
AppendGListName(&name_mangle_list, "Xf");
|
||||
return;
|
||||
case STRUCT_TYPE_E:
|
||||
case STRUCT_VECTOR_PIXEL:
|
||||
AppendGListName(&name_mangle_list, "Xp");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -872,7 +872,7 @@ static TypeFunc *CPrec_GetTypeFuncPatch(TypeFunc *type) {
|
|||
TypeFunc *p = CPrec_AppendAlign();
|
||||
CPrec_NewAddrPatch(type, p);
|
||||
|
||||
CPrec_AppendData(type, (type->flags & FUNC_FLAGS_METHOD) ? sizeof(TypeMethod) : sizeof(TypeFunc));
|
||||
CPrec_AppendData(type, (type->flags & FUNC_FLAGS_METHOD) ? sizeof(TypeMemberFunc) : sizeof(TypeFunc));
|
||||
|
||||
CPrec_NewPointerPatch(&p->functype, CPrec_GetTypePatch(type->functype));
|
||||
if (type->args)
|
||||
|
|
|
@ -1906,7 +1906,7 @@ Type *CTemplTool_DeduceTypeCopy(TypeDeduce *deduce, Type *type, UInt32 *resultQu
|
|||
case TYPEFUNC:
|
||||
if (TYPE_FUNC(type)->flags & FUNC_FLAGS_METHOD) {
|
||||
qual2 = 0;
|
||||
deduced = galloc(sizeof(TypeMethod));
|
||||
deduced = galloc(sizeof(TypeMemberFunc));
|
||||
*TYPE_METHOD(deduced) = *TYPE_METHOD(type);
|
||||
TYPE_METHOD(deduced)->x22 = 0;
|
||||
TYPE_METHOD(deduced)->theclass = TYPE_CLASS(CTemplTool_DeduceTypeQualCopy(deduce, TYPE(TYPE_METHOD(type)->theclass), &qual2));
|
||||
|
|
|
@ -1969,17 +1969,17 @@ ENode *CodeGen_HandleTypeCast(ENode *expr, Type *type, UInt32 qual) {
|
|||
flags = qual & ENODE_FLAG_QUALS;
|
||||
if (IS_TYPE_STRUCT(type) && IS_TYPE_STRUCT(expr->rtype) && expr->flags == flags) {
|
||||
switch (TYPE_STRUCT(type)->stype) {
|
||||
case STRUCT_TYPE_4:
|
||||
case STRUCT_TYPE_5:
|
||||
case STRUCT_TYPE_6:
|
||||
case STRUCT_TYPE_7:
|
||||
case STRUCT_TYPE_8:
|
||||
case STRUCT_TYPE_9:
|
||||
case STRUCT_TYPE_A:
|
||||
case STRUCT_TYPE_B:
|
||||
case STRUCT_TYPE_C:
|
||||
case STRUCT_TYPE_D:
|
||||
case STRUCT_TYPE_E:
|
||||
case STRUCT_VECTOR_UCHAR:
|
||||
case STRUCT_VECTOR_SCHAR:
|
||||
case STRUCT_VECTOR_BCHAR:
|
||||
case STRUCT_VECTOR_USHORT:
|
||||
case STRUCT_VECTOR_SSHORT:
|
||||
case STRUCT_VECTOR_BSHORT:
|
||||
case STRUCT_VECTOR_UINT:
|
||||
case STRUCT_VECTOR_SINT:
|
||||
case STRUCT_VECTOR_BINT:
|
||||
case STRUCT_VECTOR_FLOAT:
|
||||
case STRUCT_VECTOR_PIXEL:
|
||||
expr = makemonadicnode(expr, ETYPCON);
|
||||
expr->rtype = type;
|
||||
expr->flags = flags;
|
||||
|
@ -2026,9 +2026,9 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
escan = escan->data.diadic.left;
|
||||
}
|
||||
switch (TYPE_STRUCT(type)->stype) {
|
||||
case STRUCT_TYPE_4:
|
||||
case STRUCT_TYPE_5:
|
||||
case STRUCT_TYPE_6:
|
||||
case STRUCT_VECTOR_UCHAR:
|
||||
case STRUCT_VECTOR_SCHAR:
|
||||
case STRUCT_VECTOR_BCHAR:
|
||||
if (i < 15) {
|
||||
PPCError_Error(110, type, 0);
|
||||
} else if (i > 15) {
|
||||
|
@ -2046,7 +2046,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
}
|
||||
|
||||
if (copts.pedantic) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_4) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UCHAR) {
|
||||
if (!CInt64_IsInURange(v, 1))
|
||||
PPCError_Warning(113, type, 0);
|
||||
} else {
|
||||
|
@ -2062,7 +2062,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
if (ENODE_IS(escan, EINTCONST)) {
|
||||
CInt64 v = escan->data.intval;
|
||||
if (copts.pedantic) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_4) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UCHAR) {
|
||||
if (!CInt64_IsInURange(v, 1))
|
||||
PPCError_Warning(113, type, 0);
|
||||
} else {
|
||||
|
@ -2079,10 +2079,10 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
}
|
||||
break;
|
||||
|
||||
case STRUCT_TYPE_7:
|
||||
case STRUCT_TYPE_8:
|
||||
case STRUCT_TYPE_9:
|
||||
case STRUCT_TYPE_E:
|
||||
case STRUCT_VECTOR_USHORT:
|
||||
case STRUCT_VECTOR_SSHORT:
|
||||
case STRUCT_VECTOR_BSHORT:
|
||||
case STRUCT_VECTOR_PIXEL:
|
||||
if (i < 7) {
|
||||
PPCError_Error(110, type, 0);
|
||||
} else if (i > 7) {
|
||||
|
@ -2099,7 +2099,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
}
|
||||
|
||||
if (copts.pedantic) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_7 || TYPE_STRUCT(type)->stype == STRUCT_TYPE_E) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_USHORT || TYPE_STRUCT(type)->stype == STRUCT_VECTOR_PIXEL) {
|
||||
if (!CInt64_IsInURange(v, 2))
|
||||
PPCError_Warning(113, type, 0);
|
||||
} else {
|
||||
|
@ -2115,7 +2115,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
if (ENODE_IS(escan, EINTCONST)) {
|
||||
CInt64 v = escan->data.intval;
|
||||
if (copts.pedantic) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_7 || TYPE_STRUCT(type)->stype == STRUCT_TYPE_E) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_USHORT || TYPE_STRUCT(type)->stype == STRUCT_VECTOR_PIXEL) {
|
||||
if (!CInt64_IsInURange(v, 2))
|
||||
PPCError_Warning(113, type, 0);
|
||||
} else {
|
||||
|
@ -2132,9 +2132,9 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
}
|
||||
break;
|
||||
|
||||
case STRUCT_TYPE_A:
|
||||
case STRUCT_TYPE_B:
|
||||
case STRUCT_TYPE_C:
|
||||
case STRUCT_VECTOR_UINT:
|
||||
case STRUCT_VECTOR_SINT:
|
||||
case STRUCT_VECTOR_BINT:
|
||||
if (i < 3) {
|
||||
PPCError_Error(110, type, 0);
|
||||
} else if (i > 3) {
|
||||
|
@ -2152,7 +2152,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
}
|
||||
|
||||
if (copts.pedantic) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_A) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UINT) {
|
||||
if (!CInt64_IsInURange(v, 4))
|
||||
PPCError_Warning(113, type, 0);
|
||||
} else {
|
||||
|
@ -2168,7 +2168,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
if (ENODE_IS(escan, EINTCONST)) {
|
||||
CInt64 v = escan->data.intval;
|
||||
if (copts.pedantic) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_A) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UINT) {
|
||||
if (!CInt64_IsInURange(v, 4))
|
||||
PPCError_Warning(113, type, 0);
|
||||
} else {
|
||||
|
@ -2185,7 +2185,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
}
|
||||
break;
|
||||
|
||||
case STRUCT_TYPE_D:
|
||||
case STRUCT_VECTOR_FLOAT:
|
||||
if (i < 3) {
|
||||
PPCError_Error(110, type, 0);
|
||||
} else if (i > 3) {
|
||||
|
@ -2228,13 +2228,13 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
} else if (ENODE_IS(expr, EINTCONST)) {
|
||||
int i = 0;
|
||||
switch (TYPE_STRUCT(type)->stype) {
|
||||
case STRUCT_TYPE_4:
|
||||
case STRUCT_TYPE_5:
|
||||
case STRUCT_TYPE_6:
|
||||
case STRUCT_VECTOR_UCHAR:
|
||||
case STRUCT_VECTOR_SCHAR:
|
||||
case STRUCT_VECTOR_BCHAR:
|
||||
{
|
||||
CInt64 v = expr->data.intval;
|
||||
if (copts.pedantic) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_4) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UCHAR) {
|
||||
if (!CInt64_IsInURange(v, 1))
|
||||
PPCError_Warning(113, type, 0);
|
||||
} else {
|
||||
|
@ -2247,14 +2247,14 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
result = 1;
|
||||
break;
|
||||
}
|
||||
case STRUCT_TYPE_7:
|
||||
case STRUCT_TYPE_8:
|
||||
case STRUCT_TYPE_9:
|
||||
case STRUCT_TYPE_E:
|
||||
case STRUCT_VECTOR_USHORT:
|
||||
case STRUCT_VECTOR_SSHORT:
|
||||
case STRUCT_VECTOR_BSHORT:
|
||||
case STRUCT_VECTOR_PIXEL:
|
||||
{
|
||||
CInt64 v = expr->data.intval;
|
||||
if (copts.pedantic) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_7 || TYPE_STRUCT(type)->stype == STRUCT_TYPE_E) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_USHORT || TYPE_STRUCT(type)->stype == STRUCT_VECTOR_PIXEL) {
|
||||
if (!CInt64_IsInURange(v, 2))
|
||||
PPCError_Warning(113, type, 0);
|
||||
} else {
|
||||
|
@ -2267,13 +2267,13 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
result = 1;
|
||||
break;
|
||||
}
|
||||
case STRUCT_TYPE_A:
|
||||
case STRUCT_TYPE_B:
|
||||
case STRUCT_TYPE_C:
|
||||
case STRUCT_VECTOR_UINT:
|
||||
case STRUCT_VECTOR_SINT:
|
||||
case STRUCT_VECTOR_BINT:
|
||||
{
|
||||
CInt64 v = expr->data.intval;
|
||||
if (copts.pedantic) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_A) {
|
||||
if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UINT) {
|
||||
if (!CInt64_IsInURange(v, 4))
|
||||
PPCError_Warning(113, type, 0);
|
||||
} else {
|
||||
|
@ -2286,7 +2286,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
result = 1;
|
||||
break;
|
||||
}
|
||||
case STRUCT_TYPE_D:
|
||||
case STRUCT_VECTOR_FLOAT:
|
||||
{
|
||||
Float fv;
|
||||
if (!CInt64_IsInRange(expr->data.intval, 4)) {
|
||||
|
@ -2307,7 +2307,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
|
|||
default:
|
||||
PPCError_Error(112);
|
||||
break;
|
||||
case STRUCT_TYPE_D:
|
||||
case STRUCT_VECTOR_FLOAT:
|
||||
{
|
||||
Float fv;
|
||||
i = 0;
|
||||
|
|
|
@ -711,17 +711,17 @@ static int StabTypeID(Type *type) {
|
|||
case TYPESTRUCT:
|
||||
if (IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(type))) {
|
||||
switch (TYPE_STRUCT(type)->stype) {
|
||||
case STRUCT_TYPE_4: return StabType_VectorUChar;
|
||||
case STRUCT_TYPE_5: return StabType_VectorSChar;
|
||||
case STRUCT_TYPE_6: return StabType_VectorBChar;
|
||||
case STRUCT_TYPE_7: return StabType_VectorUShort;
|
||||
case STRUCT_TYPE_8: return StabType_VectorSShort;
|
||||
case STRUCT_TYPE_9: return StabType_VectorBShort;
|
||||
case STRUCT_TYPE_A: return StabType_VectorUInt;
|
||||
case STRUCT_TYPE_B: return StabType_VectorSInt;
|
||||
case STRUCT_TYPE_C: return StabType_VectorBInt;
|
||||
case STRUCT_TYPE_D: return StabType_VectorFloat;
|
||||
case STRUCT_TYPE_E: return StabType_VectorPixel;
|
||||
case STRUCT_VECTOR_UCHAR: return StabType_VectorUChar;
|
||||
case STRUCT_VECTOR_SCHAR: return StabType_VectorSChar;
|
||||
case STRUCT_VECTOR_BCHAR: return StabType_VectorBChar;
|
||||
case STRUCT_VECTOR_USHORT: return StabType_VectorUShort;
|
||||
case STRUCT_VECTOR_SSHORT: return StabType_VectorSShort;
|
||||
case STRUCT_VECTOR_BSHORT: return StabType_VectorBShort;
|
||||
case STRUCT_VECTOR_UINT: return StabType_VectorUInt;
|
||||
case STRUCT_VECTOR_SINT: return StabType_VectorSInt;
|
||||
case STRUCT_VECTOR_BINT: return StabType_VectorBInt;
|
||||
case STRUCT_VECTOR_FLOAT: return StabType_VectorFloat;
|
||||
case STRUCT_VECTOR_PIXEL: return StabType_VectorPixel;
|
||||
}
|
||||
} else {
|
||||
id = local_struct(type);
|
||||
|
|
|
@ -576,37 +576,37 @@ void IRO_SpellType(Type *type, char *buf) {
|
|||
case TYPESTRUCT:
|
||||
if (IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(type))) {
|
||||
switch (TYPE_STRUCT(type)->stype) {
|
||||
case STRUCT_TYPE_4:
|
||||
case STRUCT_VECTOR_UCHAR:
|
||||
strcpy(buf, "vector unsigned char ");
|
||||
break;
|
||||
case STRUCT_TYPE_5:
|
||||
case STRUCT_VECTOR_SCHAR:
|
||||
strcpy(buf, "vector signed char ");
|
||||
break;
|
||||
case STRUCT_TYPE_6:
|
||||
case STRUCT_VECTOR_BCHAR:
|
||||
strcpy(buf, "vector bool char ");
|
||||
break;
|
||||
case STRUCT_TYPE_7:
|
||||
case STRUCT_VECTOR_USHORT:
|
||||
strcpy(buf, "vector unsigned short ");
|
||||
break;
|
||||
case STRUCT_TYPE_8:
|
||||
case STRUCT_VECTOR_SSHORT:
|
||||
strcpy(buf, "vector signed short ");
|
||||
break;
|
||||
case STRUCT_TYPE_9:
|
||||
case STRUCT_VECTOR_BSHORT:
|
||||
strcpy(buf, "vector bool short ");
|
||||
break;
|
||||
case STRUCT_TYPE_A:
|
||||
case STRUCT_VECTOR_UINT:
|
||||
strcpy(buf, "vector unsigned long ");
|
||||
break;
|
||||
case STRUCT_TYPE_B:
|
||||
case STRUCT_VECTOR_SINT:
|
||||
strcpy(buf, "vector signed long ");
|
||||
break;
|
||||
case STRUCT_TYPE_C:
|
||||
case STRUCT_VECTOR_BINT:
|
||||
strcpy(buf, "vector bool long ");
|
||||
break;
|
||||
case STRUCT_TYPE_D:
|
||||
case STRUCT_VECTOR_FLOAT:
|
||||
strcpy(buf, "vector float ");
|
||||
break;
|
||||
case STRUCT_TYPE_E:
|
||||
case STRUCT_VECTOR_PIXEL:
|
||||
strcpy(buf, "vector pixel ");
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -2308,9 +2308,9 @@ CW_INLINE void PointsToFunction_RemoveByLocationSet(PointsToFunction *pointsToFu
|
|||
PointsToFunction *prev;
|
||||
PointsToFunction *tmp;
|
||||
|
||||
IRO_ASSERT(3170, pointsToFunc != NULL);
|
||||
IRO_ASSERT(3171, ls != NULL);
|
||||
IRO_ASSERT(3172, !LocationSet_IsUnknown(ls));
|
||||
IRO_ASSERT(3818, pointsToFunc != NULL);
|
||||
IRO_ASSERT(3819, ls != NULL);
|
||||
IRO_ASSERT(3820, !LocationSet_IsUnknown(ls));
|
||||
|
||||
prev = NULL;
|
||||
while (pointsToFunc && pointsToFunc->pte) {
|
||||
|
|
|
@ -632,21 +632,21 @@ void Coerce_to_v_register(Operand *op, Type *type, short output_reg) {
|
|||
case OpndType_Absolute:
|
||||
reg = output_reg ? output_reg : used_virtual_registers[RegClass_VR]++;
|
||||
switch (TYPE_STRUCT(type)->stype) {
|
||||
case STRUCT_TYPE_4:
|
||||
case STRUCT_TYPE_5:
|
||||
case STRUCT_TYPE_6:
|
||||
case STRUCT_VECTOR_UCHAR:
|
||||
case STRUCT_VECTOR_SCHAR:
|
||||
case STRUCT_VECTOR_BCHAR:
|
||||
emitpcode(PC_VSPLTISB, reg, op->immediate);
|
||||
break;
|
||||
case STRUCT_TYPE_7:
|
||||
case STRUCT_TYPE_8:
|
||||
case STRUCT_TYPE_9:
|
||||
case STRUCT_TYPE_E:
|
||||
case STRUCT_VECTOR_USHORT:
|
||||
case STRUCT_VECTOR_SSHORT:
|
||||
case STRUCT_VECTOR_BSHORT:
|
||||
case STRUCT_VECTOR_PIXEL:
|
||||
emitpcode(PC_VSPLTISH, reg, op->immediate);
|
||||
break;
|
||||
case STRUCT_TYPE_A:
|
||||
case STRUCT_TYPE_B:
|
||||
case STRUCT_TYPE_C:
|
||||
case STRUCT_TYPE_D:
|
||||
case STRUCT_VECTOR_UINT:
|
||||
case STRUCT_VECTOR_SINT:
|
||||
case STRUCT_VECTOR_BINT:
|
||||
case STRUCT_VECTOR_FLOAT:
|
||||
emitpcode(PC_VSPLTISW, reg, op->immediate);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -194,7 +194,7 @@ void assign_register_by_type(Object *obj) {
|
|||
vi->rclass = RegClass_GPR;
|
||||
} else if (ty->type == TYPEFLOAT) {
|
||||
vi->rclass = RegClass_FPR;
|
||||
} else if ((ty->type == TYPESTRUCT) && (TYPE_STRUCT(ty)->stype >= STRUCT_TYPE_4) && (TYPE_STRUCT(ty)->stype <= STRUCT_TYPE_E)) {
|
||||
} else if ((ty->type == TYPESTRUCT) && (TYPE_STRUCT(ty)->stype >= STRUCT_VECTOR_UCHAR) && (TYPE_STRUCT(ty)->stype <= STRUCT_VECTOR_PIXEL)) {
|
||||
vi->rclass = RegClass_VR;
|
||||
} else {
|
||||
return;
|
||||
|
|
|
@ -521,37 +521,37 @@ static void spell(Type *type, char *buf) {
|
|||
case TYPESTRUCT:
|
||||
if (IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(type))) {
|
||||
switch (TYPE_STRUCT(type)->stype) {
|
||||
case STRUCT_TYPE_4:
|
||||
case STRUCT_VECTOR_UCHAR:
|
||||
strcpy(buf, "vector unsigned char ");
|
||||
break;
|
||||
case STRUCT_TYPE_5:
|
||||
case STRUCT_VECTOR_SCHAR:
|
||||
strcpy(buf, "vector signed char ");
|
||||
break;
|
||||
case STRUCT_TYPE_6:
|
||||
case STRUCT_VECTOR_BCHAR:
|
||||
strcpy(buf, "vector bool char ");
|
||||
break;
|
||||
case STRUCT_TYPE_7:
|
||||
case STRUCT_VECTOR_USHORT:
|
||||
strcpy(buf, "vector unsigned short ");
|
||||
break;
|
||||
case STRUCT_TYPE_8:
|
||||
case STRUCT_VECTOR_SSHORT:
|
||||
strcpy(buf, "vector signed short ");
|
||||
break;
|
||||
case STRUCT_TYPE_9:
|
||||
case STRUCT_VECTOR_BSHORT:
|
||||
strcpy(buf, "vector bool short ");
|
||||
break;
|
||||
case STRUCT_TYPE_A:
|
||||
case STRUCT_VECTOR_UINT:
|
||||
strcpy(buf, "vector unsigned int ");
|
||||
break;
|
||||
case STRUCT_TYPE_B:
|
||||
case STRUCT_VECTOR_SINT:
|
||||
strcpy(buf, "vector signed int ");
|
||||
break;
|
||||
case STRUCT_TYPE_C:
|
||||
case STRUCT_VECTOR_BINT:
|
||||
strcpy(buf, "vector bool int ");
|
||||
break;
|
||||
case STRUCT_TYPE_D:
|
||||
case STRUCT_VECTOR_FLOAT:
|
||||
strcpy(buf, "vector float ");
|
||||
break;
|
||||
case STRUCT_TYPE_E:
|
||||
case STRUCT_VECTOR_PIXEL:
|
||||
strcpy(buf, "vector pixel ");
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -117,14 +117,14 @@ extern void scanenum(DeclInfo *declinfo);
|
|||
extern void CDecl_ScanStructDeclarator(BigDeclInfo *bde);
|
||||
extern void scanstruct(DeclInfo *declinfo, short structtype);
|
||||
extern void CDecl_ExtractClassExportFlags(DeclInfo *declinfo, UInt8 flags);
|
||||
extern TypeMethod *CDecl_MakeTypeMemberFunc(TypeFunc *tfunc, TypeClass *tclass, Boolean flag);
|
||||
extern TypeMemberFunc *CDecl_MakeTypeMemberFunc(TypeFunc *tfunc, TypeClass *tclass, Boolean flag);
|
||||
extern void CDecl_PackDeclInfo(PackedDeclInfo *packed, DeclInfo *declinfo);
|
||||
extern void CDecl_UnpackDeclInfo(DeclInfo *declinfo, PackedDeclInfo *packed);
|
||||
extern void CDecl_AddFriend(TypeClass *tclass, Object *friendfunc, TypeClass *friendclass);
|
||||
extern void CDecl_CheckCtorIntegrity(FuncArg *args, TypeClass *tclass);
|
||||
extern void CDecl_MakeVBaseList(TypeClass *tclass);
|
||||
extern Boolean CDecl_CheckNewBase(TypeClass *tclass, TypeClass *baseclass, Boolean is_virtual);
|
||||
extern TypeMethod *CDecl_MakeDefaultDtorType(TypeClass *tclass, Boolean is_virtual);
|
||||
extern TypeMemberFunc *CDecl_MakeDefaultDtorType(TypeClass *tclass, Boolean is_virtual);
|
||||
extern void CDecl_CompleteClass(DeclE *decle, TypeClass *tclass);
|
||||
extern TypeClass *CDecl_DefineClass(NameSpace *nspace, HashNameNode *name, TypeClass *tclass, short mode, Boolean flag2, Boolean flag3);
|
||||
extern void CDecl_ParseClassDeclSpec(UInt8 *declspec);
|
||||
|
|
|
@ -198,7 +198,7 @@ typedef struct TypeFunc TypeFunc;
|
|||
typedef struct TypeIntegral TypeIntegral;
|
||||
typedef struct TypeList TypeList;
|
||||
typedef struct TypeMemberPointer TypeMemberPointer;
|
||||
typedef struct TypeMethod TypeMethod;
|
||||
typedef struct TypeMemberFunc TypeMemberFunc;
|
||||
typedef struct TypeObjCID TypeObjCID;
|
||||
typedef struct TypePointer TypePointer;
|
||||
typedef struct TypeStruct TypeStruct;
|
||||
|
|
|
@ -100,34 +100,19 @@ enum {
|
|||
STRUCT_TYPE_STRUCT = 0,
|
||||
STRUCT_TYPE_UNION = 1,
|
||||
STRUCT_TYPE_CLASS = 2,
|
||||
STRUCT_TYPE_3 = 3,
|
||||
STRUCT_TYPE_4 = 4,
|
||||
STRUCT_TYPE_5 = 5,
|
||||
STRUCT_TYPE_6 = 6,
|
||||
STRUCT_TYPE_7 = 7,
|
||||
STRUCT_TYPE_8 = 8,
|
||||
STRUCT_TYPE_9 = 9,
|
||||
STRUCT_TYPE_A = 10,
|
||||
STRUCT_TYPE_B = 11,
|
||||
STRUCT_TYPE_C = 12,
|
||||
STRUCT_TYPE_D = 13,
|
||||
STRUCT_TYPE_E = 14
|
||||
STRUCT_TYPE_MAX = 3,
|
||||
STRUCT_VECTOR_UCHAR = 4,
|
||||
STRUCT_VECTOR_SCHAR = 5,
|
||||
STRUCT_VECTOR_BCHAR = 6,
|
||||
STRUCT_VECTOR_USHORT = 7,
|
||||
STRUCT_VECTOR_SSHORT = 8,
|
||||
STRUCT_VECTOR_BSHORT = 9,
|
||||
STRUCT_VECTOR_UINT = 10,
|
||||
STRUCT_VECTOR_SINT = 11,
|
||||
STRUCT_VECTOR_BINT = 12,
|
||||
STRUCT_VECTOR_FLOAT = 13,
|
||||
STRUCT_VECTOR_PIXEL = 14
|
||||
};
|
||||
//const char STRUCT_TYPE_STRUCT = 0;
|
||||
//const char STRUCT_TYPE_UNION = 1;
|
||||
//const char STRUCT_TYPE_CLASS = 2;
|
||||
//const char STRUCT_TYPE_3 = 3;
|
||||
//const char STRUCT_TYPE_4 = 4;
|
||||
//const char STRUCT_TYPE_5 = 5;
|
||||
//const char STRUCT_TYPE_6 = 6;
|
||||
//const char STRUCT_TYPE_7 = 7;
|
||||
//const char STRUCT_TYPE_8 = 8;
|
||||
//const char STRUCT_TYPE_9 = 9;
|
||||
//const char STRUCT_TYPE_A = 10;
|
||||
//const char STRUCT_TYPE_B = 11;
|
||||
//const char STRUCT_TYPE_C = 12;
|
||||
//const char STRUCT_TYPE_D = 13;
|
||||
//const char STRUCT_TYPE_E = 14;
|
||||
|
||||
|
||||
struct ClassList { // checked via CPrec
|
||||
|
@ -283,7 +268,7 @@ enum {
|
|||
|
||||
// This is actually called TypeMemberFunc...
|
||||
// There seems to be a version of this which adds a class pointer at the end
|
||||
struct TypeMethod {
|
||||
struct TypeMemberFunc {
|
||||
TypeType type;
|
||||
SInt32 size;
|
||||
FuncArg *args;
|
||||
|
@ -398,7 +383,7 @@ struct TypeList {
|
|||
#define TYPE_STRUCT(ty) ((TypeStruct *) (ty))
|
||||
#define TYPE_CLASS(ty) ((TypeClass *) (ty))
|
||||
#define TYPE_FUNC(ty) ((TypeFunc *) (ty))
|
||||
#define TYPE_METHOD(ty) ((TypeMethod *) (ty))
|
||||
#define TYPE_METHOD(ty) ((TypeMemberFunc *) (ty))
|
||||
#define TYPE_BITFIELD(ty) ((TypeBitfield *) (ty))
|
||||
#define TYPE_TEMPLATE(ty) ((TypeTemplDep *) (ty))
|
||||
#define TYPE_MEMBER_POINTER(ty) ((TypeMemberPointer *) (ty))
|
||||
|
@ -433,7 +418,7 @@ struct TypeList {
|
|||
#define IS_TYPE_ARRAY(ty) ( (ty)->type == TYPEARRAY )
|
||||
#define IS_TYPE_BITFIELD(ty) ( (ty)->type == TYPEBITFIELD )
|
||||
#define IS_TYPE_TEMPLDEPEXPR(ty) ( (ty)->type == TYPETEMPLDEPEXPR )
|
||||
#define IS_TYPESTRUCT_VECTOR(ty) ( (ty)->stype >= STRUCT_TYPE_4 && (ty)->stype <= STRUCT_TYPE_E )
|
||||
#define IS_TYPESTRUCT_VECTOR(ty) ( (ty)->stype >= STRUCT_VECTOR_UCHAR && (ty)->stype <= STRUCT_VECTOR_PIXEL )
|
||||
#define IS_TYPE_VECTOR(ty) ( (ty)->type == TYPESTRUCT && IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(ty)) )
|
||||
#define IS_TYPE_NONVECTOR_STRUCT(ty) ( (ty)->type == TYPESTRUCT && !IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(ty)) )
|
||||
#define IS_TYPE_MEMBERPOINTER(ty) ( (ty)->type == TYPEMEMBERPOINTER )
|
||||
|
|
Loading…
Reference in New Issue