diff options
Diffstat (limited to 'includes/compiler/templates.h')
-rw-r--r-- | includes/compiler/templates.h | 57 |
1 files changed, 20 insertions, 37 deletions
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 { |