From aec1b8dddc68ecb8288ec6132932e4c7b4bca09f Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Tue, 10 Jan 2023 11:05:21 +0000 Subject: getting close to done --- includes/compiler/CFunc.h | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'includes/compiler/CFunc.h') diff --git a/includes/compiler/CFunc.h b/includes/compiler/CFunc.h index bed511f..a64cc74 100644 --- a/includes/compiler/CFunc.h +++ b/includes/compiler/CFunc.h @@ -49,6 +49,7 @@ typedef enum StatementType { enum { StmtFlag_1 = 1, StmtFlag_2 = 2, + StmtFlag_4 = 4, StmtFlag_8 = 8, StmtFlag_10 = 0x10 }; @@ -80,9 +81,15 @@ typedef struct InitExpr { Object *object; } InitExpr; +typedef enum CtorChainType { + CtorChain_Base = 0, + CtorChain_VBase = 1, + CtorChain_MemberVar = 2 +} CtorChainType; + typedef struct CtorChain { struct CtorChain *next; - UInt8 what; + CtorChainType what; ENode *objexpr; union { ClassList *base; // 0 @@ -91,17 +98,19 @@ typedef struct CtorChain { } u; } CtorChain; -typedef struct CFuncSave { - CScopeSave scope; - // lots of fields -} CFuncSave; +typedef struct CFuncSave CFuncSave; struct DeclThing { Type *thetype; UInt32 qual; - NameSpace *nspace; - CLabel *xC; - CLabel *x10; + SwitchInfo *switchinfo; + CLabel *loopContinue; + CLabel *loopBreak; +}; + +struct DefArgCtorInfo { + Object *default_func; + ENode *default_arg; }; extern FuncArg elipsis; @@ -122,7 +131,7 @@ extern Statement *curstmt; extern DeclBlock *CFunc_NewDeclBlock(void); extern void CFunc_RestoreBlock(DeclBlock *block); extern void CFunc_SetupLocalVarInfo(Object *obj); -extern void CFunc_DefaultArg(Type *type, short qual, FuncArg *args); +extern ENode *CFunc_DefaultArg(Type *type, UInt32 qual, FuncArg *args); extern Boolean CFunc_ParseFakeArgList(Boolean flag); extern FuncArg *parameter_type_list(DeclInfo *declinfo); extern CLabel *findlabel(void); @@ -137,19 +146,19 @@ extern ENode *create_temp_node2(Type *type); extern void CFunc_WarnUnused(void); extern void CFunc_CodeCleanup(Statement *stmt); extern void CFunc_DestructorCleanup(Statement *stmt); -extern Statement *CFunc_GenerateLoop(Statement *stmt, Type *type, ENode *expr1, ENode *expr2, ENode *expr3, ENode *expr4, ENode (*callback)(ENode *, ENode *)); +extern Statement *CFunc_GenerateLoop(Statement *stmt, Type *type, ENode *lowerBound, ENode *upperBound, ENode *increment1, ENode *increment2, ENode *(*callback)(ENode *, ENode *)); extern void CFunc_CompoundStatement(DeclThing *thing); -extern void CFunc_SetupNewFuncArgs(Object *obj, FuncArg *args); +extern void CFunc_SetupNewFuncArgs(Object *func, FuncArg *args); extern NameSpace *CFunc_FuncGenSetup(Statement *stmt, Object *func); -extern void CFunc_GetGlobalCompilerState(CFuncSave *state); +extern CFuncSave *CFunc_GetGlobalCompilerState(void); extern void CFunc_SetGlobalCompilerState(CFuncSave *state); -extern void CFunc_Gen(Statement *stmt, Object *obj, UInt8 unk); +extern void CFunc_Gen(Statement *stmt, Object *func, UInt8 unk); extern void CFunc_CheckClassCtors(TypeClass *tclass); -extern void CFunc_ParseFuncDef(Object *obj, DeclInfo *declinfo, TypeClass *tclass, Boolean is_method, Boolean is_static, NameSpace *nspace); +extern void CFunc_ParseFuncDef(Object *func, DeclInfo *di, TypeClass *tclass, Boolean is_method, Boolean is_static, NameSpace *nspace); extern void InitExpr_Register(ENode *expr, Object *object); -extern void CFunc_GenerateDummyFunction(Object *a); -extern void CFunc_GenerateSingleExprFunc(Object *a, ENode *expr); -extern void CFunc_GenerateDummyCtorFunc(Object *a, Object *b); +extern void CFunc_GenerateDummyFunction(Object *func); +extern void CFunc_GenerateSingleExprFunc(Object *func, ENode *expr); +extern void CFunc_GenerateDummyCtorFunc(Object *func, Object *real_ctor); #ifdef __MWERKS__ #pragma options align=reset -- cgit v1.2.3