1 /* GDC -- D front-end for GCC
2 Copyright (C) 2004 David Friedman
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "d-gcc-tree.h"
46 struct dt_t
* DTvalues
;
58 extern dt_t
** dtval(dt_t
** pdt
, DT t
, integer_t i
, void * p
);
59 extern dt_t
** dtcat(dt_t
** pdt
, dt_t
* d
);
62 dtnbytes(dt_t
** pdt
, size_t count
, char * pbytes
) {
63 return dtval(pdt
, DT_nbytes
, count
, pbytes
); }
66 dtabytes(dt_t
** pdt
, TypeType
, int, size_t count
, char * pbytes
) {
67 return dtval(pdt
, DT_abytes
, count
, pbytes
); }
70 dtnzeros(dt_t
** pdt
, target_size_t count
) {
71 return dtval(pdt
, DT_azeros
, count
, 0); }
74 dtdword(dt_t
** pdt
, target_size_t val
) {
75 return dtval(pdt
, DT_word
, val
, 0); }
78 dtxoff(dt_t
** pdt
, Symbol
* sym
, target_size_t offset
, TypeType
) {
79 return dtval(pdt
, DT_xoff
, offset
, sym
); }
82 dttree(dt_t
** pdt
, tree t
) {
83 return dtval(pdt
, DT_tree
, 0, t
); }
86 dt_optimize(dt_t
*) { }
87 // %% should be integer_t?, but when used in todt.c, it's assigned to an unsigned
88 target_size_t
dt_size(dt_t
* dt
);
90 // Added for GCC to get correct byte ordering / size
91 extern dt_t
** dtnbits(dt_t
** pdt
, size_t count
, char * pbytes
, unsigned unit_size
);
92 extern dt_t
** dtnwords(dt_t
** pdt
, size_t word_count
, void * pwords
, unsigned word_size
);
93 extern dt_t
** dtawords(dt_t
** pdt
, size_t word_count
, void * pwords
, unsigned word_size
);
94 extern dt_t
** dti32(dt_t
** pdt
, unsigned val
, int pad_to_word
);
96 // Added for GCC to match types for SRA pass
97 extern dt_t
** dtcontainer(dt_t
** pdt
, Type
* type
, dt_t
* values
);