diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-01-20 11:56:38 +0000 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-01-20 11:56:38 +0000 |
commit | 0905072b3ccfcb394b1dca2405a55cff4e2b9271 (patch) | |
tree | c7c6f87ecf257c4e7b6a92355e75030165731371 /includes | |
parent | 7d986adf37220e1981a707745b784b078de4e3bc (diff) | |
download | MWCC-0905072b3ccfcb394b1dca2405a55cff4e2b9271.tar.gz MWCC-0905072b3ccfcb394b1dca2405a55cff4e2b9271.zip |
tons more renaming of stuff
Diffstat (limited to 'includes')
-rw-r--r-- | includes/compiler/CABI.h | 2 | ||||
-rw-r--r-- | includes/compiler/CClass.h | 7 | ||||
-rw-r--r-- | includes/compiler/CDecl.h | 20 | ||||
-rw-r--r-- | includes/compiler/CExpr.h | 2 | ||||
-rw-r--r-- | includes/compiler/CScope.h | 33 | ||||
-rw-r--r-- | includes/compiler/CTemplateClass.h | 2 | ||||
-rw-r--r-- | includes/compiler/common.h | 14 | ||||
-rw-r--r-- | includes/compiler/objects.h | 18 | ||||
-rw-r--r-- | includes/compiler/templates.h | 57 | ||||
-rw-r--r-- | includes/compiler/types.h | 121 |
10 files changed, 115 insertions, 161 deletions
diff --git a/includes/compiler/CABI.h b/includes/compiler/CABI.h index 6e190d5..fb56d79 100644 --- a/includes/compiler/CABI.h +++ b/includes/compiler/CABI.h @@ -22,7 +22,7 @@ extern SInt16 CABI_StructSizeAlignValue(Type *type, SInt32 size); extern void CABI_ReverseBitField(TypeBitfield *tbitfield); extern void CABI_AddVTable(TypeClass *tclass); extern SInt32 CABI_GetVTableOffset(TypeClass *tclass); -extern void CABI_LayoutClass(DeclE *decle, TypeClass *tclass); +extern void CABI_LayoutClass(ClassLayout *layout, TypeClass *tclass); extern void CABI_MakeDefaultArgConstructor(TypeClass *tclass, Object *func); extern ENode *CABI_MakeThisExpr(TypeClass *tclass, SInt32 offset); extern SInt32 CABI_GetCtorOffsetOffset(TypeClass *tclass, TypeClass *base); diff --git a/includes/compiler/CClass.h b/includes/compiler/CClass.h index bb952de..aa3cc89 100644 --- a/includes/compiler/CClass.h +++ b/includes/compiler/CClass.h @@ -7,13 +7,6 @@ #pragma options align=mac68k #endif -/*typedef struct VTableObjectLink { - struct VTableObjectLink *next; - Object *methodobj; - SInt32 offset; - SInt32 xC; -} VTableObjectLink;*/ - extern void CClass_Init(void); extern void CClass_GenThunks(void); extern UInt8 CClass_GetOverrideKind(TypeFunc *a, TypeFunc *b, Boolean errorflag); diff --git a/includes/compiler/CDecl.h b/includes/compiler/CDecl.h index e4537f8..97501fa 100644 --- a/includes/compiler/CDecl.h +++ b/includes/compiler/CDecl.h @@ -10,12 +10,12 @@ #endif // named because it's 0xE bytes big (hurr) -struct DeclE { +struct ClassLayout { ObjBase **objlist; ObjMemberVar *vtable_ivar; - unsigned short x8; // lex_order_count? - unsigned short xA; - Boolean xC; + UInt16 lex_order_count; + UInt16 xA; + Boolean has_vtable; }; // what the fuck am I? @@ -41,8 +41,7 @@ struct DeclInfo { DeclFucker *fucker34; TemplateFunction *x38; UInt8 x3C; // related to template nindex - Boolean x3D; - short x3E; + short operator_token; // when an operator name like "operator +" is scanned, this is the token short storageclass; UInt8 section; UInt8 exportflags; @@ -54,9 +53,9 @@ struct DeclInfo { Boolean x49; Boolean x4A; // objc related Boolean x4B; - Boolean x4C; + Boolean in_friend_decl; // set to 1 when parsing a 'friend' declaration Boolean x4D; - Boolean x4E; // is_extern_c? + Boolean is_extern_c; Boolean x4F; Boolean x50; Boolean x51; @@ -66,10 +65,9 @@ struct DeclInfo { Boolean x55; Boolean x56; Boolean x57; - //FileOffsetInfo fileoffsetinfo; CPrepFileInfo *file; CPrepFileInfo *file2; - SInt32 x60; // file offset? + SInt32 sourceoffset; Boolean x64; }; @@ -125,7 +123,7 @@ 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 TypeMemberFunc *CDecl_MakeDefaultDtorType(TypeClass *tclass, Boolean is_virtual); -extern void CDecl_CompleteClass(DeclE *decle, TypeClass *tclass); +extern void CDecl_CompleteClass(ClassLayout *layout, TypeClass *tclass); extern TypeClass *CDecl_DefineClass(NameSpace *nspace, HashNameNode *name, TypeClass *tclass, short mode, Boolean flag2, Boolean flag3); extern void CDecl_ParseClassDeclSpec(UInt8 *declspec); extern void CDecl_ParseClass(DeclInfo *declinfo, short mode, Boolean flag1, UInt8 class_declspec); diff --git a/includes/compiler/CExpr.h b/includes/compiler/CExpr.h index bdc0789..9cc6b71 100644 --- a/includes/compiler/CExpr.h +++ b/includes/compiler/CExpr.h @@ -85,7 +85,7 @@ extern ENode *argumentpromotion(ENode *expr, Type *type, short qual, Boolean fla extern ENode *classargument(ENode *expr); extern ENodeList *CExpr_ScanExpressionList(Boolean is_parens); extern ENode *CExpr_DoExplicitConversion(Type *type, UInt32 qual, ENodeList *list); -extern ENode *CExpr_MakeNameLookupResultExpr(CScopeParseResult *pr); +extern ENode *CExpr_MakeNameLookupResultExpr(NameResult *pr); extern SInt32 scansizeof(void); extern SInt32 scanalignof(void); extern ENode *getnodeaddress(ENode *expr, Boolean flag); diff --git a/includes/compiler/CScope.h b/includes/compiler/CScope.h index 7a4c3de..d19a655 100644 --- a/includes/compiler/CScope.h +++ b/includes/compiler/CScope.h @@ -20,12 +20,11 @@ struct CScopeSave { Boolean is_member_func; }; // assumed name -// this might be called NameResult -typedef struct CScopeParseResult { +typedef struct NameResult { NameSpace *nspace_0; HashNameNode *name_4; - Type *x8; - UInt32 xC; // qual + Type *type; + UInt32 qual; ObjBase *obj_10; NameSpaceObjectList *nsol_14; BClassList *bcl_18; @@ -35,12 +34,12 @@ typedef struct CScopeParseResult { Boolean x1F; Boolean x20; Boolean x21; -} CScopeParseResult; +} NameResult; typedef struct CScopeNSIterator { NameSpace *nspace; NameSpaceLookupList *lookup; - CScopeParseResult *result; + NameResult *result; } CScopeNSIterator; typedef struct CScopeObjectIterator { @@ -75,27 +74,27 @@ extern void CScope_MergeNameSpace(NameSpace *dst, NameSpace *src); extern void CScope_AddObject(NameSpace *nspace, HashNameNode *name, ObjBase *obj); extern void CScope_AddGlobalObject(Object *obj); extern NameSpaceLookupList *CScope_BuildNameSpaceLookupList(NameSpace *nspace); -extern Boolean CScope_FindQualifiedClassMember(CScopeParseResult *result, TypeClass *tclass, HashNameNode *name); +extern Boolean CScope_FindQualifiedClassMember(NameResult *result, TypeClass *tclass, HashNameNode *name); extern Type *CScope_GetType(NameSpace *nspace, HashNameNode *name, UInt32 *qual); extern Type *CScope_GetTagType(NameSpace *nspace, HashNameNode *name); -extern Boolean CScope_ParseExprName(CScopeParseResult *result); -extern Boolean CScope_ParseDeclName(CScopeParseResult *result); -extern Boolean CScope_ParseQualifiedNameSpace(CScopeParseResult *result, Boolean flag1, Boolean flag2); -extern Boolean CScope_ParseElaborateName(CScopeParseResult *result); -extern Boolean CScope_FindObject(NameSpace *nspace, CScopeParseResult *result, HashNameNode *name); -extern Boolean CScope_FindNonClassObject(NameSpace *nspace, CScopeParseResult *result, HashNameNode *name); -extern NameSpaceObjectList *CScope_FindObjectList(CScopeParseResult *result, HashNameNode *name); +extern Boolean CScope_ParseExprName(NameResult *result); +extern Boolean CScope_ParseDeclName(NameResult *result); +extern Boolean CScope_ParseQualifiedNameSpace(NameResult *result, Boolean flag1, Boolean flag2); +extern Boolean CScope_ParseElaborateName(NameResult *result); +extern Boolean CScope_FindObject(NameSpace *nspace, NameResult *result, HashNameNode *name); +extern Boolean CScope_FindNonClassObject(NameSpace *nspace, NameResult *result, HashNameNode *name); +extern NameSpaceObjectList *CScope_FindObjectList(NameResult *result, HashNameNode *name); extern Boolean CScope_PossibleTypeName(HashNameNode *name); -extern Boolean CScope_FindClassMemberObject(TypeClass *tclass, CScopeParseResult *result, HashNameNode *name); +extern Boolean CScope_FindClassMemberObject(TypeClass *tclass, NameResult *result, HashNameNode *name); extern void CScope_InitObjectIterator(CScopeObjectIterator *iterator, NameSpace *nspace); extern ObjBase *CScope_NextObjectIteratorObject(CScopeObjectIterator *iterator); extern NameSpaceObjectList *CScope_NextObjectIteratorObjectList(CScopeObjectIterator *iterator); extern void CScope_DefineTypeTag(NameSpace *nspace, HashNameNode *name, Type *type); extern Type *CScope_GetLocalTagType(NameSpace *nspace, HashNameNode *name); -extern Boolean CScope_FindTypeName(NameSpace *nspace, HashNameNode *name, CScopeParseResult *result); +extern Boolean CScope_FindTypeName(NameSpace *nspace, HashNameNode *name, NameResult *result); extern NameSpaceObjectList *CScope_GetLocalObject(NameSpace *nspace, HashNameNode *name); extern BClassList *CScope_GetClassAccessPath(BClassList *list, TypeClass *tclass); -extern Boolean CScope_ParseMemberName(TypeClass *tclass, CScopeParseResult *result, Boolean flag); +extern Boolean CScope_ParseMemberName(TypeClass *tclass, NameResult *result, Boolean flag); extern void CScope_AddClassUsingDeclaration(TypeClass *tclass, TypeClass *tclass2, HashNameNode *name, AccessType access); extern void CScope_ParseUsingDeclaration(NameSpace *nspace, AccessType access, Boolean flag); extern void CScope_ParseNameSpaceAlias(HashNameNode *name); diff --git a/includes/compiler/CTemplateClass.h b/includes/compiler/CTemplateClass.h index 12cd088..b683bda 100644 --- a/includes/compiler/CTemplateClass.h +++ b/includes/compiler/CTemplateClass.h @@ -11,7 +11,7 @@ extern void CTemplClass_RegisterEnumType(TemplClass *tmclass, TypeEnum *enumtype extern void CTemplClass_RegisterEnumerator(TemplClass *tmclass, ObjEnumConst *objenumconst, ENode *initexpr); extern void CTemplClass_RegisterObjectInit(TemplClass *tmclass, Object *object, ENode *initexpr); extern void CTemplClass_RegisterObjectDef(TemplClass *tmclass, ObjBase *refobj); -extern void CTemplClass_CompleteClass(TemplClass *templ, DeclE *de); +extern void CTemplClass_CompleteClass(TemplClass *templ, ClassLayout *de); extern TemplClassInst *CTemplClass_GetInstance(TemplClass *tmclass, TemplArg *args1, TemplArg *args2); extern TemplateMember *CTemplClass_DefineMember(TemplClass *tmclass, Object *object, FileOffsetInfo *foi, TokenStream *stream); extern void CTemplClass_ParsePartialSpecialization(DeclFucker *what_is_this, TemplParam *params, short mode, SInt32 *offset); diff --git a/includes/compiler/common.h b/includes/compiler/common.h index ed5b25a..c5e2324 100644 --- a/includes/compiler/common.h +++ b/includes/compiler/common.h @@ -113,11 +113,11 @@ typedef struct Alias Alias; typedef struct BClassList BClassList; typedef struct CI_FuncData CI_FuncData; typedef struct CLabel CLabel; +typedef struct ClassLayout ClassLayout; typedef struct ClassList ClassList; typedef struct CompilerLinkerParamBlk CompilerLinkerParamBlk; typedef struct CPrepFileInfo CPrepFileInfo; typedef struct CScopeSave CScopeSave; -typedef struct DeclE DeclE; typedef struct DeclFucker DeclFucker; typedef struct DeclInfo DeclInfo; typedef struct DeclThing DeclThing; // rename me please @@ -176,7 +176,6 @@ typedef struct Statement Statement; typedef struct StructMember StructMember; typedef struct SwitchCase SwitchCase; typedef struct SwitchInfo SwitchInfo; -typedef struct Template Template; typedef struct TemplateAction TemplateAction; typedef struct TemplateFriend TemplateFriend; typedef struct TemplateMember TemplateMember; @@ -185,7 +184,6 @@ typedef struct TemplClass TemplClass; typedef struct TemplClassInst TemplClassInst; typedef struct TemplateFunction TemplateFunction; typedef struct TemplFuncInstance TemplFuncInstance; -typedef struct TemplInstance TemplInstance; typedef struct TemplParam TemplParam; typedef struct TemplPartialSpec TemplPartialSpec; typedef struct TemplStack TemplStack; @@ -252,13 +250,13 @@ enum { Q_BYCOPY = 0x2000, Q_BYREF = 0x4000, Q_ONEWAY = 0x8000, - Q_10000 = 0x10000, + Q_INLINE_DATA = 0x10000, // this object contains constant data in its union Q_20000 = 0x20000, - Q_OVERLOAD = 0x40000, // weak - Q_80000 = 0x80000, - Q_100000 = 0x100000, // Objective-C ID + Q_WEAK = 0x40000, // weak + Q_MANGLE_NAME = 0x80000, // adds C++ mangling info to a name + Q_IS_OBJC_ID = 0x100000, // Objective-C ID Q_RESTRICT = 0x200000, - Q_400000 = 0x400000, // is templated from another object? + Q_IS_TEMPLATED = 0x400000, // is templated from another object? Q_1000000 = 0x1000000, Q_ALIGNED_1 = 0x2000000, Q_ALIGNED_2 = 0x4000000, diff --git a/includes/compiler/objects.h b/includes/compiler/objects.h index 5f56877..0f5d52f 100644 --- a/includes/compiler/objects.h +++ b/includes/compiler/objects.h @@ -188,14 +188,14 @@ struct ObjectTemplated { }; enum { - OBJECT_FLAGS_1 = 1, - OBJECT_FLAGS_2 = 2, - OBJECT_FLAGS_4 = 4, - OBJECT_FLAGS_8 = 8, - OBJECT_FLAGS_10 = 0x10, // internal - OBJECT_FLAGS_20 = 0x20, // import - OBJECT_FLAGS_40 = 0x40, // export - OBJECT_FLAGS_60 = 0x60 // lib export + OBJECT_USED = 1, + OBJECT_FLAGS_2 = 2, // this object has been used in certain contexts (figure me out?) + OBJECT_DEFINED = 4, + OBJECT_LAZY = 8, // this object will be created by a CParser callback action only if referenced + OBJECT_INTERNAL = 0x10, + OBJECT_IMPORT = 0x20, + OBJECT_EXPORT = 0x40, + OBJECT_LIB_EXPORT = 0x60 }; #define OBJ_BASE(obj) ((ObjBase *) (obj)) @@ -209,7 +209,7 @@ enum { #define OBJECT_TEMPL(obj) ((ObjectTemplated *) (obj)) -struct VarInfo { // OK! +struct VarInfo { Object *func; SInt32 usage; TStreamElement deftoken; diff --git a/includes/compiler/templates.h b/includes/compiler/templates.h index 14f60b6..9a54c4b 100644 --- a/includes/compiler/templates.h +++ b/includes/compiler/templates.h @@ -9,7 +9,7 @@ #pragma options align=mac68k #endif -struct PackedDeclInfo { // ok +struct PackedDeclInfo { Type *thetype; UInt32 qual; NameSpace *nspace; @@ -21,20 +21,13 @@ struct PackedDeclInfo { // ok Boolean has_expltargs; }; -struct Template { - Template *parent; - TemplInstance *parentinst; - TemplParam *params; - Boolean is_class; -}; - -struct TemplateFriend { // verified via CPrec +struct TemplateFriend { PackedDeclInfo decl; FileOffsetInfo fileoffset; TokenStream stream; }; -struct TemplateMember { // verified via CPrec +struct TemplateMember { struct TemplateMember *next; TemplParam *params; Object *object; @@ -45,17 +38,7 @@ struct TemplateMember { // verified via CPrec SInt32 endoffset; }; -struct TemplInstance { - // Template *templ; - TemplInstance *parent; - TemplArg *args; - Boolean is_instantiated; - Boolean is_specialized; - Boolean is_extern; - Boolean static_instantiated; -}; - -struct TemplParam { // verified via CPrec +struct TemplParam { TemplParam *next; HashNameNode *name; TemplParamID pid; @@ -76,7 +59,7 @@ struct TemplParam { // verified via CPrec } data; }; -struct TemplArg { // verified by CPrec +struct TemplArg { TemplArg *next; TemplParamID pid; union { @@ -123,7 +106,7 @@ struct TypeDeduce { Boolean x19; }; -struct TemplPartialSpec { // confirmed via CPrec (but templ might be a different type?) +struct TemplPartialSpec { TemplPartialSpec *next; TemplClass *templ; TemplArg *args; @@ -146,47 +129,48 @@ struct TemplStack { struct TemplClass { TypeClass theclass; TemplClass *next; - TemplClass *templ_parent; // confirmed by v8 - TemplClassInst *inst_parent; // confirmed by v8 + TemplClass *templ_parent; + TemplClassInst *inst_parent; TemplParam *templ__params; TemplateMember *members; TemplClassInst *instances; TemplClass *pspec_owner; TemplPartialSpec *pspecs; TemplateAction *actions; - UInt16 lex_order_count; // confirmed by v8 + UInt16 lex_order_count; SInt8 align; UInt8 flags; }; +// TemplClass::flags enum { - TEMPLCLASS_FLAGS_1 = 1, + TEMPLCLASS_HAS_VTABLE = 1, TEMPLCLASS_FLAGS_2 = 2 }; struct TemplClassInst { TypeClass theclass; - TemplClassInst *next; // confirmed by v8 - TemplClassInst *parent; // confirmed by v8 + TemplClassInst *next; + TemplClassInst *parent; TemplClass *templ; TemplArg *inst_args; TemplArg *oargs; Boolean is_instantiated; Boolean is_specialized; Boolean is_extern; - Boolean x49; + Boolean static_instantiated; }; #define TEMPL_CLASS(ty) ( (TemplClass *) (ty) ) #define TEMPL_CLASS_INST(ty) ( (TemplClassInst *) (ty) ) -#define IS_TEMPL_CLASS(ty) ( IS_TYPE_CLASS(ty) && (TYPE_CLASS(ty)->flags & CLASS_FLAGS_100) ) -#define IS_TEMPL_CLASS_INST(ty) ( IS_TYPE_CLASS(ty) && (TYPE_CLASS(ty)->flags & CLASS_FLAGS_800) ) +#define IS_TEMPL_CLASS(ty) ( IS_TYPE_CLASS(ty) && (TYPE_CLASS(ty)->flags & CLASS_IS_TEMPL) ) +#define IS_TEMPL_CLASS_INST(ty) ( IS_TYPE_CLASS(ty) && (TYPE_CLASS(ty)->flags & CLASS_IS_TEMPL_INST) ) /*************/ /* Functions */ /*************/ -struct TemplateFunction { // verified via CPrec +struct TemplateFunction { TemplateFunction *next; TemplateFunction *unk4; // parent? HashNameNode *name; @@ -200,19 +184,18 @@ struct TemplateFunction { // verified via CPrec SInt32 endoffset; }; -struct TemplFuncInstance { // verified via CPrec +struct TemplFuncInstance { TemplFuncInstance *next; Object *object; TemplArg *args; Boolean is_instantiated; Boolean is_specialized; Boolean is_extern; - Boolean static_instantiated; }; #define TEMPL_FUNC(ty) ( (TemplateFunction *) (ty) ) #define TEMPL_FUNC_INST(ty) ( (TemplFuncInstance *) (ty) ) -#define IS_TEMPL_FUNC(ty) ( IS_TYPE_FUNC(ty) && (TYPE_FUNC(ty)->flags & FUNC_FLAGS_100000) ) +#define IS_TEMPL_FUNC(ty) ( IS_TYPE_FUNC(ty) && (TYPE_FUNC(ty)->flags & FUNC_IS_TEMPL) ) /***********/ /* Actions */ @@ -230,7 +213,7 @@ typedef enum TemplateActionType { TAT_ILLEGAL } TemplateActionType; -struct TemplateAction { // verified via CPrec +struct TemplateAction { TemplateAction *next; TStreamElement source_ref; union { diff --git a/includes/compiler/types.h b/includes/compiler/types.h index 5767eb9..caca63c 100644 --- a/includes/compiler/types.h +++ b/includes/compiler/types.h @@ -70,7 +70,7 @@ struct TypeIntegral { }; -struct TypeEnum { // checked via CPrec +struct TypeEnum { TypeType type; SInt32 size; NameSpace *nspace; @@ -115,7 +115,7 @@ enum { }; -struct ClassList { // checked via CPrec +struct ClassList { ClassList *next; TypeClass *base; SInt32 offset; @@ -124,16 +124,15 @@ struct ClassList { // checked via CPrec Boolean is_virtual; }; -struct VClassList { // checked via CPrec +struct VClassList { VClassList *next; TypeClass *base; SInt32 offset; // offset within the class instance SInt32 voffset; // offset within the vtable Boolean has_override; - char alignsave; }; -typedef struct ClassFriend { // checked via CPrec +typedef struct ClassFriend { struct ClassFriend *next; union { TypeClass *theclass; @@ -142,12 +141,12 @@ typedef struct ClassFriend { // checked via CPrec Boolean isclass; } ClassFriend; -struct BClassList { // checked via CPrec +struct BClassList { struct BClassList *next; Type *type; }; -typedef struct VTable { // checked via CPrec +typedef struct VTable { Object *object; TypeClass *owner; SInt32 offset; @@ -174,25 +173,23 @@ struct TypeClass { }; typedef enum { - CLASS_MODE_0 = 0, // struct - CLASS_MODE_1 = 1, // union - CLASS_MODE_2 = 2 // class + CLASS_MODE_STRUCT = 0, + CLASS_MODE_UNION = 1, + CLASS_MODE_CLASS = 2 } ClassMode; enum { - CLASS_FLAGS_1 = 1, - CLASS_FLAGS_2 = 2, // completed class? - CLASS_FLAGS_ABSTRACT = 8, - CLASS_FLAGS_10 = 0x10, - CLASS_FLAGS_20 = 0x20, - CLASS_FLAGS_40 = 0x40, - CLASS_FLAGS_80 = 0x80, - CLASS_FLAGS_100 = 0x100, // is TemplClass - CLASS_FLAGS_800 = 0x800, // is TemplClassInst - CLASS_FLAGS_900 = 0x900, - CLASS_FLAGS_1000 = 0x1000, // is empty class - CLASS_FLAGS_2000 = 0x2000, - CLASS_FLAGS_4000 = 0x4000, + CLASS_HANDLEOBJECT = 1, // class is a HandleObject + CLASS_COMPLETED = 2, // completed class? + CLASS_ABSTRACT = 8, + CLASS_SINGLE_OBJECT = 0x10, // inherits from SingleObject/SingleInheritance + CLASS_HAS_VBASES = 0x20, + CLASS_IS_CONVERTIBLE = 0x40, // defines at least one conversion function + CLASS_IS_TEMPL = 0x100, // is TemplClass + CLASS_IS_TEMPL_INST = 0x800, // is TemplClassInst + CLASS_IS_TEMPL_ANY = CLASS_IS_TEMPL | CLASS_IS_TEMPL_INST, + CLASS_EMPTY = 0x1000, // is 0 bytes (forced to 1 byte for ABI reasons) + CLASS_COM_OBJECT = 0x2000, // inherits from __comobject CLASS_FLAGS_8000 = 0x8000 }; @@ -225,7 +222,6 @@ struct FuncArg { // ok UInt32 qual; SInt16 sclass; Boolean is_array; - Boolean has_defdefarg; }; struct TypeFunc { @@ -237,37 +233,37 @@ struct TypeFunc { UInt32 qual; UInt32 flags; }; + +// TypeFunc::flags enum { - FUNC_FLAGS_PASCAL = 1, // on TypeFunc::flags - FUNC_FLAGS_2 = 2, // member function that has an inline definition? + FUNC_PASCAL = 1, + FUNC_DEFINED = 2, // does the function have a body? FUNC_FLAGS_4 = 4, - FUNC_FLAGS_8 = 8, // abstract - FUNC_FLAGS_METHOD = 0x10, + FUNC_PURE = 8, // abstract + FUNC_METHOD = 0x10, FUNC_FLAGS_20 = 0x20, - FUNC_FLAGS_40 = 0x40, // func that's like "operator SomeOtherType()" + FUNC_CONVERSION = 0x40, // func that's like "operator SomeOtherType()" FUNC_FLAGS_80 = 0x80, - FUNC_FLAGS_100 = 0x100, - FUNC_FLAGS_200 = 0x200, // intrinsic? - FUNC_FLAGS_NOTHROW = 0x400, + FUNC_AUTO_GENERATED = 0x100, // an auto-generated ctor, dtor or assignment operator + FUNC_INTRINSIC = 0x200, + FUNC_NOTHROW = 0x400, FUNC_FLAGS_800 = 0x800, // autoinlined? - FUNC_FLAGS_1000 = 0x1000, // is ctor - FUNC_FLAGS_2000 = 0x2000, // is dtor - FUNC_FLAGS_4000 = 0x4000, // objc method? - FUNC_FLAGS_CONST = 0x8000, - FUNC_FLAGS_VOLATILE = 0x10000, - FUNC_FLAGS_CV = FUNC_FLAGS_CONST | FUNC_FLAGS_VOLATILE, - FUNC_FLAGS_100000 = 0x100000, // is template? + FUNC_IS_CTOR = 0x1000, // is ctor + FUNC_IS_DTOR = 0x2000, // is dtor + FUNC_OBJC_METHOD = 0x4000, + FUNC_CONST = 0x8000, + FUNC_VOLATILE = 0x10000, + FUNC_FLAGS_CV = FUNC_CONST | FUNC_VOLATILE, + FUNC_IS_TEMPL = 0x100000, // the definition of a template FUNC_FLAGS_200000 = 0x200000, FUNC_FLAGS_400000 = 0x400000, // covariant? - FUNC_FLAGS_800000 = 0x800000, - FUNC_FLAGS_900000 = 0x900000, + FUNC_IS_TEMPL_INSTANCE = 0x800000, // a concrete instance of a template + FUNC_IS_TEMPL_ANY = FUNC_IS_TEMPL | FUNC_IS_TEMPL_INSTANCE, FUNC_FLAGS_4000000 = 0x4000000, FUNC_FLAGS_10000000 = 0x10000000, - FUNC_FLAGS_F0000000 = 0xF0000000 + FUNC_CALL_CONV_MASK = 0xF0000000 | FUNC_PASCAL }; -// This is actually called TypeMemberFunc... -// There seems to be a version of this which adds a class pointer at the end struct TypeMemberFunc { TypeType type; SInt32 size; @@ -277,9 +273,9 @@ struct TypeMemberFunc { UInt32 qual; UInt32 flags; TypeClass *theclass; - SInt32 x1E; // vtable offset? - SInt32 x22; // browser index? - Boolean x26; // is static + SInt32 vtbl_index; // index of this method within the vtable + SInt32 funcid; // ID used for tracking this method within browse data + Boolean is_static; // is static }; @@ -287,24 +283,18 @@ struct TypeBitfield { TypeType type; SInt32 size; Type *bitfieldtype; - char unkA; // offset in bits - char unkB; // size in bits + char offset; // offset in bits + char bitlength; // size in bits }; -// Label - - typedef enum TypeTemplDepType { TEMPLDEP_ARGUMENT, TEMPLDEP_QUALNAME, TEMPLDEP_TEMPLATE, TEMPLDEP_ARRAY, TEMPLDEP_QUALTEMPL, - TEMPLDEP_BITFIELD, - TEMPLDEP_VALUEDEP, // not in v7? - TEMPLDEP_ENUMVAL, // not in v7? - TEMPLDEP_TYPEOF // not in v7? + TEMPLDEP_BITFIELD } TypeTemplDepType; struct TypeTemplDep { @@ -333,13 +323,6 @@ struct TypeTemplDep { Type *type; ENode *size; } bitfield; - // the following ones may not be in v7 - Type *vdep; - ENode *tof; - struct { - TypeEnum *etype; - ENode *expr; - } enumval; } u; }; @@ -362,7 +345,7 @@ struct TypePointer { }; -/// Always has Q_100000 set +/// Always has Q_IS_OBJC_ID set struct TypeObjCID { TypePointer pointer; ObjCProtocolList *protocols; @@ -403,13 +386,13 @@ struct TypeList { #define IS_TYPE_SOM_CLASS(ty) ( (ty)->type == TYPECLASS && TYPE_CLASS((ty))->sominfo ) #define IS_TYPE_OBJC_CLASS(ty) ( (ty)->type == TYPECLASS && TYPE_CLASS((ty))->objcinfo ) #define IS_TYPE_FUNC(ty) ( (ty)->type == TYPEFUNC ) -#define IS_TYPEFUNC_METHOD(ty) ( (ty)->flags & FUNC_FLAGS_METHOD ) +#define IS_TYPEFUNC_METHOD(ty) ( (ty)->flags & FUNC_METHOD ) #define IS_TYPE_METHOD(ty) ( IS_TYPE_FUNC(ty) && IS_TYPEFUNC_METHOD(TYPE_FUNC(ty)) ) #define IS_TYPE_NONMETHOD(ty) ( IS_TYPE_FUNC(ty) && !IS_TYPEFUNC_METHOD(TYPE_FUNC(ty)) ) -#define IS_TYPE_NONSTATIC_METHOD(ty) ( IS_TYPE_FUNC(ty) && IS_TYPEFUNC_METHOD(TYPE_FUNC(ty)) && !TYPE_METHOD(ty)->x26 ) -#define IS_TYPE_STATIC_METHOD(ty) ( IS_TYPE_FUNC(ty) && IS_TYPEFUNC_METHOD(TYPE_FUNC(ty)) && TYPE_METHOD(ty)->x26 ) -#define IS_TYPEFUNC_NONSTATIC_METHOD(ty) ( IS_TYPEFUNC_METHOD(ty) && !TYPE_METHOD(ty)->x26 ) -#define IS_TYPEFUNC_STATIC_METHOD(ty) ( IS_TYPEFUNC_METHOD(ty) && TYPE_METHOD(ty)->x26 ) +#define IS_TYPE_NONSTATIC_METHOD(ty) ( IS_TYPE_FUNC(ty) && IS_TYPEFUNC_METHOD(TYPE_FUNC(ty)) && !TYPE_METHOD(ty)->is_static ) +#define IS_TYPE_STATIC_METHOD(ty) ( IS_TYPE_FUNC(ty) && IS_TYPEFUNC_METHOD(TYPE_FUNC(ty)) && TYPE_METHOD(ty)->is_static ) +#define IS_TYPEFUNC_NONSTATIC_METHOD(ty) ( IS_TYPEFUNC_METHOD(ty) && !TYPE_METHOD(ty)->is_static ) +#define IS_TYPEFUNC_STATIC_METHOD(ty) ( IS_TYPEFUNC_METHOD(ty) && TYPE_METHOD(ty)->is_static ) #define IS_TYPE_TEMPLATE(ty) ( (ty)->type == TYPETEMPLATE ) #define IS_TYPE_POINTER(ty) ( (ty)->type == TYPEPOINTER || (ty)->type == TYPEARRAY ) #define IS_TYPE_POINTER_ONLY(ty) ( (ty)->type == TYPEPOINTER ) |