OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [ada/] [targtyps.c] - Blame information for rev 20

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/****************************************************************************
2
 *                                                                          *
3
 *                         GNAT COMPILER COMPONENTS                         *
4
 *                                                                          *
5
 *                            T A R G T Y P S                               *
6
 *                                                                          *
7
 *                                  Body                                    *
8
 *                                                                          *
9
 *          Copyright (C) 1992-2004 Free Software Foundation, Inc.          *
10
 *                                                                          *
11
 * GNAT is free software;  you can  redistribute it  and/or modify it under *
12
 * terms of the  GNU General Public License as published  by the Free Soft- *
13
 * ware  Foundation;  either version 2,  or (at your option) any later ver- *
14
 * sion.  GNAT is distributed in the hope that it will be useful, but WITH- *
15
 * OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY *
16
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License *
17
 * for  more details.  You should have  received  a copy of the GNU General *
18
 * Public License  distributed with GNAT;  see file COPYING.  If not, write *
19
 * to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, *
20
 * Boston, MA 02110-1301, USA.                                              *
21
 *                                                                          *
22
 * As a  special  exception,  if you  link  this file  with other  files to *
23
 * produce an executable,  this file does not by itself cause the resulting *
24
 * executable to be covered by the GNU General Public License. This except- *
25
 * ion does not  however invalidate  any other reasons  why the  executable *
26
 * file might be covered by the  GNU Public License.                        *
27
 *                                                                          *
28
 * GNAT was originally developed  by the GNAT team at  New York University. *
29
 * Extensive contributions were provided by Ada Core Technologies Inc.      *
30
 *                                                                          *
31
 ****************************************************************************/
32
 
33
/* Functions for retrieving target types. See Ada package Get_Targ */
34
 
35
#include "config.h"
36
#include "system.h"
37
#include "coretypes.h"
38
#include "tm.h"
39
#include "tree.h"
40
#include "real.h"
41
#include "rtl.h"
42
#include "ada.h"
43
#include "types.h"
44
#include "atree.h"
45
#include "elists.h"
46
#include "namet.h"
47
#include "nlists.h"
48
#include "snames.h"
49
#include "stringt.h"
50
#include "uintp.h"
51
#include "urealp.h"
52
#include "fe.h"
53
#include "sinfo.h"
54
#include "einfo.h"
55
#include "ada-tree.h"
56
#include "gigi.h"
57
 
58
/* If we don't have a specific size for Ada's equivalent of `long', use that
59
   of C.  */
60
#ifndef ADA_LONG_TYPE_SIZE
61
#define ADA_LONG_TYPE_SIZE LONG_TYPE_SIZE
62
#endif
63
 
64
#ifndef WIDEST_HARDWARE_FP_SIZE
65
#define WIDEST_HARDWARE_FP_SIZE LONG_DOUBLE_TYPE_SIZE
66
#endif
67
 
68
/* The following provide a functional interface for the front end Ada code
69
   to determine the sizes that are used for various C types. */
70
 
71
Pos
72
get_target_bits_per_unit (void)
73
{
74
  return BITS_PER_UNIT;
75
}
76
 
77
Pos
78
get_target_bits_per_word (void)
79
{
80
  return BITS_PER_WORD;
81
}
82
 
83
Pos
84
get_target_char_size (void)
85
{
86
  return CHAR_TYPE_SIZE;
87
}
88
 
89
Pos
90
get_target_wchar_t_size (void)
91
{
92
  /* We never want wide chacters less than "short" in Ada.  */
93
  return MAX (SHORT_TYPE_SIZE, WCHAR_TYPE_SIZE);
94
}
95
 
96
Pos
97
get_target_short_size (void)
98
{
99
  return SHORT_TYPE_SIZE;
100
}
101
 
102
Pos
103
get_target_int_size (void)
104
{
105
  return INT_TYPE_SIZE;
106
}
107
 
108
Pos
109
get_target_long_size (void)
110
{
111
  return ADA_LONG_TYPE_SIZE;
112
}
113
 
114
Pos
115
get_target_long_long_size (void)
116
{
117
  return LONG_LONG_TYPE_SIZE;
118
}
119
 
120
Pos
121
get_target_float_size (void)
122
{
123
  return fp_prec_to_size (FLOAT_TYPE_SIZE);
124
}
125
 
126
Pos
127
get_target_double_size (void)
128
{
129
  return fp_prec_to_size (DOUBLE_TYPE_SIZE);
130
}
131
 
132
Pos
133
get_target_long_double_size (void)
134
{
135
  return fp_prec_to_size (WIDEST_HARDWARE_FP_SIZE);
136
}
137
 
138
 
139
Pos
140
get_target_pointer_size (void)
141
{
142
  return POINTER_SIZE;
143
}
144
 
145
Pos
146
get_target_maximum_alignment (void)
147
{
148
  return BIGGEST_ALIGNMENT / BITS_PER_UNIT;
149
}
150
 
151
#ifndef FLOAT_WORDS_BIG_ENDIAN
152
#define FLOAT_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
153
#endif
154
 
155
Nat
156
get_float_words_be (void)
157
{
158
  return FLOAT_WORDS_BIG_ENDIAN;
159
}
160
 
161
Nat
162
get_words_be (void)
163
{
164
  return WORDS_BIG_ENDIAN;
165
}
166
 
167
Nat
168
get_bytes_be (void)
169
{
170
  return BYTES_BIG_ENDIAN;
171
}
172
 
173
Nat
174
get_bits_be (void)
175
{
176
  return BITS_BIG_ENDIAN;
177
}
178
 
179
Nat
180
get_strict_alignment (void)
181
{
182
  return STRICT_ALIGNMENT;
183
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.