summaryrefslogtreecommitdiff
path: root/includes/compiler/TOC.h
blob: c5eabb0d42e17a50f5ca47038039027940508a9b (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
#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;

extern ObjectList *toclist;
extern ObjectList *exceptionlist;
extern void *descriptorlist;
extern void *floatconstpool;
extern void *doubleconstpool;
extern ObjectList *floatconstlist;
extern void *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();
extern Object *CreateFloatConst(Type *type, Float *data, SInt32 *unkptr);
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