Subversion Repositories tendra.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
/**********************************************************************
32
$Author: pwe $
33
$Date: 1998/03/11 11:03:40 $
34
$Revision: 1.2 $
35
$Log: dw2_common.c,v $
36
 * Revision 1.2  1998/03/11  11:03:40  pwe
37
 * DWARF optimisation info
38
 *
39
 * Revision 1.1.1.1  1998/01/17  15:55:48  release
40
 * First version to be checked into rolling release.
41
 *
42
 * Revision 1.4  1997/12/04  19:42:02  pwe
43
 * ANDF-DE V1.9
44
 *
45
 * Revision 1.3  1997/11/06  09:22:39  pwe
46
 * ANDF-DE V1.8
47
 *
48
 * Revision 1.2  1997/10/23  09:28:05  pwe
49
 * ANDF-DE v1.7, extra diags
50
 *
51
 * Revision 1.1  1997/10/10  18:19:06  pwe
52
 * prep ANDF-DE revision
53
 *
54
**********************************************************************/
55
 
56
#include "config.h"
57
#include "common_types.h"
58
#include "basicread.h"
59
#include "install_fns.h"
60
#include "xalloc.h"
61
#include "dg_aux.h"
62
#include "externs.h"
63
#include "dg_globs.h"
64
#include "shapemacs.h"
65
#include "dw2_common.h"
66
 
67
 
68
static dg_name_list capnames;
69
static int cni = 0;
70
 
71
static void make_bastype
72
    PROTO_N ( (s, t) )
73
    PROTO_T ( char * s X dg_type t )
74
{
75
  dg_name this_name;
76
  dg_tag ans = (dgtag_struct *) xmalloc (sizeof(dgtag_struct));
77
  init_dgtag (ans);
78
  ans->outref.k = LAB_STR;
79
  ans->outref.u.s = s;
80
  this_name = f_dg_tag_name (ans, f_dg_type_name (
81
	no_dg_idname_option,
82
	f_dg_null_sourcepos,
83
	no_dg_accessibility_option,
84
	yes_dg_type_option (t),
85
	f_false,
86
	no_bool_option,
87
	no_dg_constraint_list_option));
88
  capnames = add_dg_name_list (capnames, this_name, cni++);
89
}
90
 
91
 
92
static dg_idname m_id
93
    PROTO_N ( (s) )
94
    PROTO_T ( char * s )
95
{
96
  dg_idname ans;
97
  ans.id_key = DG_ID_SRC;
98
  ans.idd.nam = s;
99
  return ans;
100
}
101
 
102
 
103
static void make_basic_types
104
    PROTO_Z ()
105
{
106
  make_bastype ("__D_void_star", f_dg_address_type (
107
		m_id ("void *"), f_pointer (f_alignment (scharsh))));
108
  make_bastype ("__D_signed_char", f_dg_char_type (
109
		m_id ("signed char"), scharsh));
110
  make_bastype ("__D_unsigned_char", f_dg_char_type (
111
		m_id ("unsigned char"), ucharsh));
112
  make_bastype ("__D_short", f_dg_integer_type (
113
		m_id ("short"), swordsh));
114
  make_bastype ("__D_unsigned_short", f_dg_integer_type (
115
		m_id ("unsigned short"), uwordsh));
116
  make_bastype ("__D_int", f_dg_integer_type (
117
		m_id ("int"), slongsh));
118
  make_bastype ("__D_unsigned_int", f_dg_integer_type (
119
		m_id ("unsigned int"), ulongsh));
120
  make_bastype ("__D_long", f_dg_integer_type (
121
		m_id ("long"), slongsh));
122
  make_bastype ("__D_unsigned_long", f_dg_integer_type (
123
		m_id ("unsigned long"), ulongsh));
124
  make_bastype ("__D_long_long", f_dg_integer_type (
125
		m_id ("long long"), s64sh));
126
  make_bastype ("__D_unsigned_long_long", f_dg_integer_type (
127
		m_id ("unsigned long long"), u64sh));
128
  make_bastype ("__D_float", f_dg_float_type (
129
		m_id ("float"), shrealfv));
130
  make_bastype ("__D_double", f_dg_float_type (
131
		m_id ("double"), realfv));
132
  make_bastype ("__D_long_double", f_dg_float_type (
133
		m_id ("long double"), doublefv));
134
  make_bastype ("__D_complex", f_dg_complex_float_type (
135
		m_id ("complex"), shcomplexfv));
136
  make_bastype ("__D_double_complex", f_dg_complex_float_type (
137
		m_id ("double complex"), complexfv));
138
  make_bastype ("__D_long_double_complex", f_dg_complex_float_type (
139
		m_id ("long double complex"), complexdoublefv));
140
}
141
 
142
 
143
void make_dwarf_common
144
    PROTO_Z ()
145
{
146
  dg_compilation ans;
147
  capnames = new_dg_name_list (15);
148
  make_basic_types ();
149
  ans = (dg_compilation) xmalloc (sizeof (struct dg_comp_t));
150
  ans->prim_file = get_filename ((long)0, "", "", "");
151
  ans->comp_deps = new_string_list (0);
152
  ans->date = 0;
153
  ans->language = 1;	/* assume ANSI C */
154
  ans->id_case = 0;	/* case sensitive */
155
  ans->producer = "TenDRA";
156
  ans->comp_dir = get_filename ((long)0, "", "", "");
157
  ans->options = new_string_list (0);
158
  ans->dn_list = capnames;
159
  ans->macros = new_dg_macro_list (0);
160
  ans->another = (dg_compilation)0;
161
  all_comp_units = ans;
162
}