Subversion Repositories tendra.SVN

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 7
Line -... Line 1...
-
 
1
/*
-
 
2
 * Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
-
 
3
 * All rights reserved.
-
 
4
 *
-
 
5
 * Redistribution and use in source and binary forms, with or without
-
 
6
 * modification, are permitted provided that the following conditions are met:
-
 
7
 *
-
 
8
 * 1. Redistributions of source code must retain the above copyright notice,
-
 
9
 *    this list of conditions and the following disclaimer.
-
 
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
-
 
11
 *    this list of conditions and the following disclaimer in the documentation
-
 
12
 *    and/or other materials provided with the distribution.
-
 
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
-
 
14
 *    may be used to endorse or promote products derived from this software
-
 
15
 *    without specific, prior written permission.
-
 
16
 *
-
 
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
-
 
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-
 
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-
 
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
-
 
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-
 
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-
 
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-
 
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-
 
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-
 
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-
 
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 
28
 *
-
 
29
 * $Id$
-
 
30
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1997
32
    		 Crown Copyright (c) 1997
3
 
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
Line 53... Line 83...
53
#include "machine.h"
83
#include "machine.h"
54
#include "exp.h"
84
#include "exp.h"
55
#include "dump_distr.h"
85
#include "dump_distr.h"
56
#include "construct_v.h"
86
#include "construct_v.h"
57
#include "reader_v.h"
87
#include "reader_v.h"
58
extern void output_symtab PROTO_S (( char* ));
88
extern void output_symtab(char*);
59
 
89
 
60
 
90
 
61
void out_rename
91
void out_rename
62
    PROTO_N ( (oldid, newid) )
-
 
63
    PROTO_T ( char * oldid X char * newid )
92
(char * oldid, char * newid)
64
{
93
{
65
	/* ??? this may be wrong with diagnostics */
94
	/* ??? this may be wrong with diagnostics */
66
	return;
95
	return;
67
}
96
}
68
 
97
 
Line 81... Line 110...
81
bool BIGEND = (little_end == 0);
110
bool BIGEND = (little_end == 0);
82
 
111
 
83
bool do_tlrecursion = 0;
112
bool do_tlrecursion = 0;
84
 
113
 
85
bool opt
114
bool opt
86
    PROTO_N ( (c) )
-
 
87
    PROTO_T ( char c )
115
(char c)
88
{ if (c == '0' || c == 0) return 0;
116
{ if (c == '0' || c == 0) return 0;
89
  else return 1;
117
  else return 1;
90
}
118
}
91
 
119
 
92
int   main
120
int   main
93
    PROTO_N ( (argc, argv) )
-
 
94
    PROTO_T ( int argc X char **argv )
121
(int argc, char **argv)
95
{
122
{
96
  long  i;
123
  long  i;
97
  char *nm;
124
  char *nm;
98
  char *aname;
125
  char *aname;
99
  char *dname;
126
  char *dname;
100
  bool withs = 0;
127
  bool withs = 0;
101
  bool no_opts = 0;
128
  bool no_opts = 0;
102
  bool override_diags = 0;
129
  bool override_diags = 0;
103
  PIC_code = 1;
130
  PIC_code = 1;
104
 
131
 
105
  as_file = (FILE *) 0;
132
  as_file = (FILE *)0;
106
  do_inlining = 1;
133
  do_inlining = 1;
107
  redo_structfns = 1;
134
  redo_structfns = 1;
108
  do_unroll = 1;
135
  do_unroll = 1;
109
 
136
 
110
  do_foralls = 1;
137
  do_foralls = 1;
Line 183... Line 210...
183
		    else
210
		    else
184
		      break;
211
		      break;
185
		  }
212
		  }
186
		}
213
		}
187
 
214
 
188
		if (s[ind] != '.') {
215
		if (s[ind]!= '.') {
189
		  fprintf(stderr,
216
		  fprintf(stderr,
190
                "DRA TDF Mips BIGEND (as:3.x) translator %d.%d (TDF version %d.%d): 30th June 1994\n",
217
                "DRA TDF Mips BIGEND (as:3.x) translator %d.%d (TDF version %d.%d): 30th June 1994\n",
191
                 mipstrans_version,mipstrans_revision,MAJOR_VERSION, MINOR_VERSION);
218
                 mipstrans_version,mipstrans_revision,MAJOR_VERSION, MINOR_VERSION);
192
                 fprintf(stderr, "reader %d.%d: ", reader_version,
219
                 fprintf(stderr, "reader %d.%d: ", reader_version,
193
		 reader_revision);
220
		 reader_revision);
Line 223... Line 250...
223
      case 'Z': /* prints on stderr the versions of all the capsules
250
      case 'Z': /* prints on stderr the versions of all the capsules
224
                   from which this capsule was made */
251
                   from which this capsule was made */
225
        report_versions = 1;
252
        report_versions = 1;
226
        break;
253
        break;
227
      default:
254
      default:
228
	failer ("Illegal flag");
255
	failer("Illegal flag");
229
	break;
256
	break;
230
    };
257
    };
231
  };
258
  };
232
 
259
 
233
 
260
 
234
 
261
 
235
  if (override_diags) diagnose = 0;
262
  if (override_diags)diagnose = 0;
236
  if (diagnose || no_opts) {		/* line numbering goes to hell with
263
  if (diagnose || no_opts) {		/* line numbering goes to hell with
237
				   optimisations */
264
				   optimisations */
238
 
265
 
239
        do_inlining = 0;
266
        do_inlining = 0;
240
        do_loopconsts = 0;
267
        do_loopconsts = 0;
Line 245... Line 272...
245
  };
272
  };
246
 
273
 
247
 
274
 
248
  if (withs) {			/* requires assembler text */
275
  if (withs) {			/* requires assembler text */
249
    aname = argv[argc - 1];
276
    aname = argv[argc - 1];
250
    as_file = fopen (aname, "w");
277
    as_file = fopen(aname, "w");
251
    if (as_file == (FILE *) 0) {
278
    if (as_file == (FILE *)0) {
252
      failer ("can't find .s file");
279
      failer("can't find .s file");
253
      return 1;
280
      return 1;
254
    }
281
    }
255
    argc--;
282
    argc--;
256
  }
283
  }
257
 
284
 
258
 
285
 
259
 
286
 
260
 
287
 
261
  dname = argv[argc - 1];	/* the .T file */
288
  dname = argv[argc - 1];	/* the .T file */
262
  nm = argv[argc - 2];		/* the .G file */
289
  nm = argv[argc - 2];		/* the .G file */
263
  ba_file = fopen (nm, "w");
290
  ba_file = fopen(nm, "w");
264
  if (ba_file == (FILE *) 0) {
291
  if (ba_file == (FILE *)0) {
265
    printf ("install: can't open output file %s\n", nm);
292
    printf("install: can't open output file %s\n", nm);
266
    return (1);
293
    return(1);
267
  }
294
  }
268
 
295
 
269
 
296
 
270
  if (!initreader (argv[argc - 3])) {
297
  if (!initreader(argv[argc - 3])) {
271
    failer ("cant read .t file");
298
    failer("cant read .t file");
272
    return (1);
299
    return(1);
273
  };
300
  };
274
 
301
 
275
  init_flpt();
302
  init_flpt();
276
#include "inits.h"
303
#include "inits.h"
277
  top_def = (dec*)0;
304
  top_def = (dec*)0;