summaryrefslogtreecommitdiff
path: root/includes/compiler/CDecl.h
blob: 331a53b6c942302919ee67b415bba65e30eb8ff2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#ifndef COMPILER_CDECL_H
#define COMPILER_CDECL_H

#include "compiler/common.h"
#include "compiler/tokens.h"
#include "compiler/types.h"

#ifdef __MWERKS__
#pragma options align=mac68k
#endif

// named because it's 0xE bytes big (hurr)
struct DeclE {
    ObjBase **objlist;
    ObjMemberVar *vtable_ivar;
    unsigned short x8; // lex_order_count?
    unsigned short xA;
    Boolean xC;
};

// what the fuck am I?
struct DeclFucker {
    NameSpace *nspace;
    void *mystery4;
};

struct DeclInfo {
    Type *thetype;
    UInt32 qual;
    NameSpace *nspace;
    HashNameNode *name;
    Object *x10;
    NameSpaceObjectList *x14;
    FuncArg *x18;
    NameSpace *x1C;
    Type *x20;
    ENode *x24;
    TemplClass *x28;
    TemplArg *expltargs;
    TemplParam *x30;
    DeclFucker *fucker34;
    TemplateFunction *x38;
    UInt8 x3C; // related to template nindex
    Boolean x3D;
    short x3E;
    short storageclass;
    UInt8 section;
    UInt8 exportflags;
    Boolean x44; // has args in identifier list
    Boolean x45; // has oldstyle args
    Boolean x46;
    Boolean x47;
    Boolean x48;
    Boolean x49;
    Boolean x4A; // objc related
    Boolean x4B;
    Boolean x4C;
    Boolean x4D;
    Boolean x4E; // is_extern_c?
    Boolean x4F;
    Boolean x50;
    Boolean x51;
    Boolean has_expltargs;
    Boolean x53;
    Boolean x54;
    Boolean x55;
    Boolean x56;
    Boolean x57;
    //FileOffsetInfo fileoffsetinfo;
    CPrepFileInfo *file;
    CPrepFileInfo *file2;
    SInt32 x60; // file offset?
    Boolean x64;
};

typedef struct BigDeclInfo {
    DeclInfo declinfo;
    DeclInfo declinfo2;
    Boolean xCC;
    Boolean xCD;
} BigDeclInfo;

extern AccessType global_access;
extern FileOffsetInfo member_fileoffset;

extern Type *CDecl_NewStructType(SInt32 size, SInt16 align);
extern Type *CDecl_NewArrayType(Type *type, SInt32 size);
extern Type *CDecl_NewPointerType(Type *type);
extern Type *CDecl_NewRefPointerType(Type *type);
extern Type *CDecl_NewTemplDepType(TypeTemplDepType tdt);
extern void CDecl_SetResultReg(TypeFunc *tfunc);
extern void CDecl_SetFuncFlags(TypeFunc *tfunc, UInt32 flags);
extern void CDecl_NewConvFuncType(DeclInfo *declinfo);
extern void CDecl_CompleteType(Type *type);
extern Boolean IsCompleteType(Type *type);
extern Boolean CanAllocObject(Type *type);
extern Boolean CanCreateObject(Type *type);
extern void makethetypepointer(DeclInfo *declinfo, UInt32 qual);
extern void CDecl_AddThisPointerArgument(TypeFunc *tfunc, TypeClass *tclass);
extern void CDecl_MakePTMFuncType(TypeFunc *tfunc);
extern void CDecl_AddArgument(TypeFunc *tfunc, Type *argtype);
extern Boolean CDecl_CheckArrayIntegr(Type *type);
extern void CDecl_ParseDirectFuncDecl(DeclInfo *declinfo);
extern void makememberpointertype(DeclInfo *declinfo, TypeClass *tclass, UInt32 qual);
extern void CDecl_ScanPointer(DeclInfo *declinfo, NameSpace *nspace, Boolean flag);
extern void scandeclarator(DeclInfo *declinfo);
extern void conversion_type_name(DeclInfo *declinfo);
extern void MergeDefaultArgs(FuncArg *a, FuncArg *b);
extern void CheckDefaultArgs(FuncArg *args);
extern Object *CDecl_GetFunctionObject(DeclInfo *declinfo, NameSpace *nspace, Boolean *pflag, Boolean someotherflag);
extern void CDecl_TypedefDeclarator(DeclInfo *declinfo);
extern Boolean CDecl_FunctionDeclarator(DeclInfo *declinfo, NameSpace *nspace, Boolean flag, Boolean flag2);
extern void CDecl_ScanDeclarator(DeclInfo *declinfo);
extern void scandeclaratorlist(DeclInfo *declinfo);
extern void CDecl_ComputeUnderlyingEnumType(TypeEnum *tenum);
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 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 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);
extern void CDecl_ParseClass(DeclInfo *declinfo, short mode, Boolean flag1, UInt8 class_declspec);

#ifdef __MWERKS__
#pragma options align=reset
#endif

#endif