summaryrefslogtreecommitdiff
path: root/includes/compiler/TOC.h
blob: 2d6d3be9280c7cc1d9f1765910e621782d2a94d3 (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
#ifndef COMPILER_TOC_H
#define COMPILER_TOC_H

#include "compiler/common.h"

#ifdef __MWERKS__
#pragma options align=mac68k
#endif

typedef struct CodeLabelList {
    struct CodeLabelList *next;
    Object *object;
    CLabel *label;
} CodeLabelList;

typedef struct PoolEntry {
    struct PoolEntry *next;
    Object *object;
    SInt32 offset;
    void *buffer;
} PoolEntry;

extern ObjectList *toclist;
extern ObjectList *exceptionlist;
extern void *descriptorlist;
extern PoolEntry *floatconstpool;
extern PoolEntry *doubleconstpool;
extern ObjectList *floatconstlist;
extern PoolEntry *vectorconstpool;
extern ObjectList *vectorconstlist;
extern Object toc0;
extern Boolean no_descriptors;
extern Object pic_base;
extern VarInfo pic_base_varinfo;
extern short pic_base_reg;
extern CodeLabelList *codelabellist;

extern void setupaddressing(void);
extern void createNonLazyPointer(Object *obj);
extern void referenceIndirectPointer(Object *obj);
extern Object *createIndirect(Object *obj, Boolean flag1, Boolean flag2);
extern Object *createfloatconstant(Type *type, Float *data);
extern Object *createvectorconstant(Type *type, MWVector128 *data);
extern void DeclarePooledConstants(void);
extern Object *CreateFloatConst(Type *type, Float *data, SInt32 *pOffset);
extern void dumpcodelabels(Object *func);
typedef struct COVCResult {
    // this struct might be used in other places too???
    short op1;
    short op2;
    char arg;
} COVCResult;
extern Boolean canoptimizevectorconst(MWVector128 *vecp, Type *type, COVCResult *result);
extern Boolean TOC_use_fsel(ENode *expr);
extern Boolean TOC_use_isel(ENode *expr, Boolean flag);
extern SInt32 GetSizeSkip(ENode *expr);
extern void Optimize64bitMath(ENode *expr);
extern void expandTOCreferences(Statement **stmts);
extern void resetTOCvarinfo(void);
extern Boolean needdescriptor(void);
extern Object *createstaticinitobject(void);

#ifdef __MWERKS__
#pragma options align=reset
#endif

#endif