/
cg.c
53 lines (42 loc) · 1.7 KB
/
cg.c
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
// Copyright (C) 1984-1995 by Symantec
// Copyright (C) 2000-2012 by Digital Mars
// All Rights Reserved
// http://www.digitalmars.com
// Written by Walter Bright
/*
* This source file is made available for personal use
* only. The license is in /dmd/src/dmd/backendlicense.txt
* or /dm/src/dmd/backendlicense.txt
* For any other uses, please contact Digital Mars.
*/
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include "cc.h"
#include "global.h"
#include "code.h"
#include "type.h"
#include "filespec.h"
///////////////////// GLOBALS /////////////////////
#include "fltables.c"
targ_size_t framehandleroffset; // offset of C++ frame handler
#if TARGET_OSX
targ_size_t localgotoffset; // offset of where localgot refers to
#endif
int cseg = CODE; // current code segment
// (negative values mean it is the negative
// of the public name index of a COMDAT)
/* Stack offsets */
targ_size_t localsize; /* amt subtracted from SP for local vars */
/* The following are initialized for the 8088. cod3_set32() or cod3_set64()
* will change them as appropriate.
*/
int BPRM = 6; /* R/M value for [BP] or [EBP] */
regm_t fregsaved; // mask of registers saved across function calls
regm_t FLOATREGS = FLOATREGS_16;
regm_t FLOATREGS2 = FLOATREGS2_16;
regm_t DOUBLEREGS = DOUBLEREGS_16;
symbol *localgot; // reference to GOT for this function
symbol *tls_get_addr_sym; // function __tls_get_addr
int STACKALIGN = 2; // default for 16 bit code