Subversion Repositories tendra.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
7 7u83 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
 */
31
/*
2 7u83 32
    Copyright (c) 1993 Open Software Foundation, Inc.
33
 
34
 
35
    All Rights Reserved
36
 
37
 
38
    Permission to use, copy, modify, and distribute this software
39
    and its documentation for any purpose and without fee is hereby
40
    granted, provided that the above copyright notice appears in all
41
    copies and that both the copyright notice and this permission
42
    notice appear in supporting documentation.
43
 
44
 
45
    OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING
46
    ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
47
    PARTICULAR PURPOSE.
48
 
49
 
50
    IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
51
    CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
52
    LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
53
    NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
54
    WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
55
*/
56
 
57
/*
58
    		 Crown Copyright (c) 1997
7 7u83 59
 
2 7u83 60
    This TenDRA(r) Computer Program is subject to Copyright
61
    owned by the United Kingdom Secretary of State for Defence
62
    acting through the Defence Evaluation and Research Agency
63
    (DERA).  It is made available to Recipients with a
64
    royalty-free licence for its use, reproduction, transfer
65
    to other parties and amendment for any purpose not excluding
66
    product development provided that any such use et cetera
67
    shall be deemed to be acceptance of the following conditions:-
7 7u83 68
 
2 7u83 69
        (1) Its Recipients shall ensure that this Notice is
70
        reproduced upon any copies or amended versions of it;
7 7u83 71
 
2 7u83 72
        (2) Any amended version of it shall be clearly marked to
73
        show both the nature of and the organisation responsible
74
        for the relevant amendment or amendments;
7 7u83 75
 
2 7u83 76
        (3) Its onward transfer from a recipient to another
77
        party shall be deemed to be that party's acceptance of
78
        these conditions;
7 7u83 79
 
2 7u83 80
        (4) DERA gives no warranty or assurance as to its
81
        quality or suitability for any purpose and DERA accepts
82
        no liability whatsoever in relation to any use to which
83
        it may be put.
84
*/
85
 
86
 
87
#include "config.h"
88
#ifdef DEBUG_POWERTRANS
89
#include "common_types.h"
90
#include "exptypes.h"
91
#include "expmacs.h"
92
#include "exp.h"
93
#include "tags.h"
94
#include "shapemacs.h"
95
#include "ash.h"
96
#include "addresstypes.h"
97
#include "locate.h"
98
#include "translat.h"
99
 
100
#include "pp.h"
101
/*
102
 * This file contains debugging tools used in debugging a translator
103
 */
104
 
7 7u83 105
void properties(int);
106
exp show_bro(int);
107
exp show_son(int);
108
exp show_current(int);
109
exp show_father(int);
110
exp show_pt(int);
111
exp recurse(int);
112
exp infotag(exp,int);
113
void showme(exp,int,int);
2 7u83 114
static exp last_exp_seen=NULL;
115
static exp last_exp_seen1=NULL;
116
static exp last_exp_seen2=NULL;
117
static exp last_exp_seen3=NULL;
118
static exp last_exp_seen4=NULL;
119
static exp last_exp_seen5=NULL;
120
 
7 7u83 121
static void exp_show(exp,int,int,int);
122
char *find_test_name(exp);
123
static void myprint(char *);
124
char *shape_name(int);
125
char *getname(int);
126
void ident_props(exp);
127
void proc_tag_props(exp);
128
void general_proc_tag_props(exp);
129
void solve_props(exp);
130
void movecont_props(exp);
131
void cont_props(exp);
132
void labst_props(exp);
133
void name_props(exp);
134
void string_props(exp);
135
void val_props(exp);
136
void rep_props(exp);
137
void apply_props(exp);
2 7u83 138
 
139
static exp stored_idents[1000];
140
static exp stored_labsts[1000];
7 7u83 141
static int store_ident(exp);
142
static int store_labst(exp);
2 7u83 143
static int no_of_idents_stored=0;
144
static int no_of_labsts_stored=0;
7 7u83 145
static int ident_no(exp);
146
static int labst_no(exp);
2 7u83 147
 
7 7u83 148
static int store_ident(exp e)
2 7u83 149
{
150
  no_of_idents_stored++;
7 7u83 151
  stored_idents[no_of_idents_stored] =e;
2 7u83 152
  return no_of_idents_stored;
153
}
7 7u83 154
static int store_labst(exp e)
2 7u83 155
{
156
  no_of_labsts_stored++;
7 7u83 157
  stored_labsts[no_of_labsts_stored] =e;
2 7u83 158
  return no_of_labsts_stored;
159
}
7 7u83 160
static int ident_no(exp e)
2 7u83 161
{
162
  int i;
163
  for (i=no_of_idents_stored;i>0;i--)
7 7u83 164
    if (stored_idents[i] ==e) return i;
2 7u83 165
  return 0;
166
}
7 7u83 167
static int labst_no(exp e)
2 7u83 168
{
169
  int i;
170
  for (i=no_of_labsts_stored;i>0;i--)
7 7u83 171
    if (stored_labsts[i] ==e) return i;
2 7u83 172
  return 0;
173
}
7 7u83 174
void scan_for_labsts(exp e)
2 7u83 175
{
176
  if (e==nilexp)
177
    return;
7 7u83 178
  switch (name(e))
2 7u83 179
  {
180
   case labst_tag:
181
    store_labst(e);
182
    break;
183
   case ident_tag:
184
    store_ident(e);
185
    break;
186
    /* don't scan sons of these tags */
187
   case name_tag:
188
   case env_offset_tag:
7 7u83 189
    if (!last(e))scan_for_labsts(bro(e));
2 7u83 190
    return;
191
    /* don't scan bros of these tags */
192
   case case_tag:
193
    scan_for_labsts(son(e));
194
    return;
195
  }
196
  scan_for_labsts(son(e));
7 7u83 197
  if (!last(e))scan_for_labsts(bro(e));
2 7u83 198
  return;
199
}
200
 
201
 
7 7u83 202
 
203
void showme(exp e, int depth_of_recursion, int flag)
2 7u83 204
{
205
  no_of_labsts_stored=0;
206
  no_of_idents_stored=0;
7 7u83 207
  if (name(e) ==labst_tag)
2 7u83 208
    store_labst(e);
7 7u83 209
  if (name(e) ==ident_tag)
2 7u83 210
    store_ident(e);
211
  scan_for_labsts(son(e));
212
  exp_show(e,0,depth_of_recursion,flag);
213
  return;
214
}
215
 
7 7u83 216
exp show_current(int i)
2 7u83 217
{
218
  exp l;
7 7u83 219
  switch (i)
2 7u83 220
  {
221
   case 0:l=last_exp_seen;break;
222
   case 1:l=last_exp_seen1;break;
223
   case 2:l=last_exp_seen2;break;
224
   case 3:l=last_exp_seen3;break;
225
   case 4:l=last_exp_seen4;break;
226
   case 5:l=last_exp_seen5;break;
227
  }
7 7u83 228
 
2 7u83 229
  if (l==NULL)
230
  {
231
    printf("No current exp for stored exp no %d\n",i);
232
  }
233
  else
234
  {
235
    infotag(l,i);
236
  }
237
  return l;
238
}
239
 
7 7u83 240
exp show_bro(int i)
2 7u83 241
{
242
  exp l;
7 7u83 243
  switch (i)
2 7u83 244
  {
245
   case 0:l=last_exp_seen;break;
246
   case 1:l=last_exp_seen1;break;
247
   case 2:l=last_exp_seen2;break;
248
   case 3:l=last_exp_seen3;break;
249
   case 4:l=last_exp_seen4;break;
250
   case 5:l=last_exp_seen5;break;
251
  }
7 7u83 252
 
2 7u83 253
  if (l==NULL)
254
  {
255
    printf("No current exp\n");
256
    return NULL;
257
  }
7 7u83 258
 
259
  if (bro(l)!=NULL)
2 7u83 260
  {
261
    infotag(bro(l),i);
262
  }
263
  else
264
  {
265
    printf("No brother field to stored exp no %d\n",i);
266
  }
267
  return l;
7 7u83 268
 
269
 
2 7u83 270
}
7 7u83 271
exp show_son(int i)
2 7u83 272
{
273
  exp l;
7 7u83 274
  switch (i)
2 7u83 275
  {
276
   case 0:l=last_exp_seen;break;
277
   case 1:l=last_exp_seen1;break;
278
   case 2:l=last_exp_seen2;break;
279
   case 3:l=last_exp_seen3;break;
280
   case 4:l=last_exp_seen4;break;
281
   case 5:l=last_exp_seen5;break;
282
  }
7 7u83 283
 
284
  if (l==NULL)
2 7u83 285
  {
286
    printf("No current exp\n");
287
    return 0;
7 7u83 288
 
2 7u83 289
  }
7 7u83 290
 
291
  if (son(l)!=NULL)
2 7u83 292
  {
293
    infotag(son(l),i);
294
  }
295
  else
296
  {
297
    printf("No son field to stored exp no %d\n",i);
298
  }
299
  return l;
7 7u83 300
 
2 7u83 301
}
7 7u83 302
exp show_father(int i)
2 7u83 303
{
304
  exp l;
7 7u83 305
  switch (i)
2 7u83 306
  {
307
   case 0:l=last_exp_seen;break;
308
   case 1:l=last_exp_seen1;break;
309
   case 2:l=last_exp_seen2;break;
310
   case 3:l=last_exp_seen3;break;
311
   case 4:l=last_exp_seen4;break;
312
   case 5:l=last_exp_seen5;break;
313
  }
7 7u83 314
 
315
  if (l==NULL)
2 7u83 316
  {
317
    printf("No current stored exp no %d\n",i);
318
    return NULL;
319
  }
320
  if (father(l)!=NULL)
321
  {
322
    infotag(father(l),i);
323
  }
324
  else
325
  {
326
    printf("Cannot find father of stored exp no %d\n",i);
327
  }
328
  return l;
329
}
7 7u83 330
exp show_pt(int i)
2 7u83 331
{
332
  exp l;
7 7u83 333
  switch (i)
2 7u83 334
  {
335
   case 0:l=last_exp_seen;break;
336
   case 1:l=last_exp_seen1;break;
337
   case 2:l=last_exp_seen2;break;
338
   case 3:l=last_exp_seen3;break;
339
   case 4:l=last_exp_seen4;break;
340
   case 5:l=last_exp_seen5;break;
341
  }
7 7u83 342
 
343
  if (l==NULL)
2 7u83 344
  {
345
    printf("No current exp\n");
346
    return 0;
7 7u83 347
 
2 7u83 348
  }
7 7u83 349
 
350
  if (pt(l)!=NULL)
2 7u83 351
  {
352
    infotag(pt(l),i);
353
  }
354
  else
355
  {
356
    printf("No pt field to stored exp no %d\n",i);
357
  }
358
  return l;
7 7u83 359
 
2 7u83 360
}
361
 
7 7u83 362
exp recurse(int i)
2 7u83 363
{
364
  exp l;
7 7u83 365
  switch (i)
2 7u83 366
  {
367
   case 0:l=last_exp_seen;break;
368
   case 1:l=last_exp_seen1;break;
369
   case 2:l=last_exp_seen2;break;
370
   case 3:l=last_exp_seen3;break;
371
   case 4:l=last_exp_seen4;break;
372
   case 5:l=last_exp_seen5;break;
373
  }
7 7u83 374
 
375
  if (l==NULL)
2 7u83 376
  {
377
    printf("No current exp for no %d (Use infotag)\n",i);
378
  }
379
  else
380
  {
381
    showme(l,-1,1);
382
  }
383
  return l;
384
}
385
 
386
 
7 7u83 387
char * getname(int n)
2 7u83 388
{
389
  char * tagname;
7 7u83 390
  switch (n) {
391
   case 0                    :tagname= "zero";break;
392
   case ident_tag            :tagname= "ident";break;
393
   case seq_tag              :tagname= "seq";break;
394
   case cond_tag             :tagname= "cond";break;
395
   case labst_tag            :tagname= "labst";break;
396
   case rep_tag              :tagname= "rep";break;
397
   case goto_tag             :tagname= "goto";break;
398
   case test_tag             :tagname= "test";break;
399
   case ass_tag              :tagname= "ass";break;
400
   case apply_tag            :tagname= "apply";break;
401
   case res_tag              :tagname= "res";break;
402
   case goto_lv_tag          :tagname= "goto_lv";break;
403
   case solve_tag            :tagname= "solve";break;
404
   case assvol_tag           :tagname= "assvol";break;
405
   case compound_tag         :tagname= "compound";break;
406
   case nof_tag              :tagname= "nof";break;
407
   case local_free_all_tag   :tagname= "local_free_all";break;
408
   case local_free_tag       :tagname= "local_free";break;
409
   case last_local_tag       :tagname= "last_local";break;
410
   case long_jump_tag        :tagname= "long_jump";break;
411
   case concatnof_tag        :tagname= "concatnof";break;
412
   case ncopies_tag          :tagname= "ncopies";break;
413
   case case_tag             :tagname= "case";break;
414
   case movecont_tag         :tagname= "movecont";break;
415
   case testbit_tag          :tagname= "testbit";break;
416
   case alloca_tag           :tagname= "alloca";break;
417
   case diagnose_tag         :tagname= "diagnose";break;
418
   case prof_tag             :tagname= "prof";break;
419
   case ignorable_tag        :tagname= "ignorable";break;
420
   case bfass_tag            :tagname= "bfass";break;
421
   case bfassvol_tag         :tagname= "bfassvol";break;
422
   case condassign_tag       :tagname= "condassign";break;
423
   case apply_general_tag    :tagname= "apply_general";break;
424
   case tail_call_tag        :tagname= "tail_call";break;
425
   case untidy_return_tag    :tagname= "untidy_return";break;
426
   case same_callees_tag     :tagname= "same_callees";break;
427
   case plus_tag             :tagname= "plus";break;
428
   case neg_tag              :tagname= "neg";break;
429
   case shl_tag              :tagname= "shl";break;
430
   case mod_tag              :tagname= "mod";break;
431
   case rem2_tag             :tagname= "rem2";break;
432
   case abs_tag              :tagname= "abs";break;
433
   case round_tag            :tagname= "round";break;
434
   case offset_pad_tag       :tagname= "offset_pad";break;
435
   case offset_div_tag       :tagname= "offset_div";break;
436
   case offset_max_tag       :tagname= "offset_max";break;
437
   case minptr_tag           :tagname= "minptr";break;
438
   case fpower_tag           :tagname= "fpower";break;
439
   case fplus_tag            :tagname= "fplus";break;
440
   case fminus_tag           :tagname= "fminus";break;
441
   case fmult_tag            :tagname= "fmult";break;
442
   case fdiv_tag             :tagname= "fdiv";break;
443
   case fabs_tag             :tagname= "fabs";break;
444
   case fneg_tag             :tagname= "fneg";break;
445
   case float_tag            :tagname= "float";break;
446
   case chfl_tag             :tagname= "chfl";break;
447
   case and_tag              :tagname= "and";break;
448
   case or_tag               :tagname= "or";break;
449
   case xor_tag              :tagname= "xor";break;
450
   case not_tag              :tagname= "not";break;
451
   case component_tag        :tagname= "component";break;
452
   case max_tag              :tagname= "max";break;
453
   case min_tag              :tagname= "min";break;
454
   case bitf_to_int_tag      :tagname= "bitf_to_int";break;
455
   case bfcont_tag           :tagname= "bfcont";break;
456
   case fmax_tag             :tagname= "fmax";break;
457
   case shr_tag              :tagname= "shr";break;
458
   case fmin_tag             :tagname= "fmin";break;
459
   case div0_tag             :tagname= "div0";break;
460
   case bfcontvol_tag        :tagname= "bfcontvol";break;
461
   case absbool_tag          :tagname= "absbool";break;
462
   case addptr_tag           :tagname= "addptr";break;
463
   case chvar_tag            :tagname= "chvar";break;
464
   case minus_tag            :tagname= "minus";break;
465
   case mult_tag             :tagname= "mult";break;
466
   case subptr_tag           :tagname= "subptr";break;
467
   case realpart_tag         :tagname= "realpart";break;
468
   case div1_tag             :tagname= "div1";break;
469
   case div2_tag             :tagname= "div2";break;
470
   case offset_add_tag       :tagname= "offset_add";break;
471
   case offset_div_by_int_tag:tagname= "offset_div_by_int";break;
472
   case offset_mult_tag      :tagname= "offset_mult";break;
473
   case offset_negate_tag    :tagname= "offset_negate";break;
474
   case offset_subtract_tag  :tagname= "offset_subtract";break;
475
   case rem0_tag             :tagname= "rem0";break;
476
   case rotl_tag             :tagname= "rotl";break;
477
   case rotr_tag             :tagname= "rotr";break;
478
   case power_tag            :tagname= "power";break;
479
   case imag_tag             :tagname= "imag";break;
480
   case make_complex_tag     :tagname= "make_complex";break;
481
   case int_to_bitf_tag      :tagname= "int_to_bitf";break;
482
   case hold_tag             :tagname= "hold";break;
483
   case hold2_tag            :tagname= "hold2";break;
484
   case cont_tag             :tagname= "cont";break;
485
   case field_tag            :tagname= "field";break;
486
   case val_tag              :tagname= "val";break;
487
   case reff_tag             :tagname= "reff";break;
488
   case name_tag             :tagname= "name";break;
489
   case proc_tag             :tagname= "proc";break;
490
   case top_tag              :tagname= "top";break;
491
   case contvol_tag          :tagname= "contvol";break;
492
   case current_env_tag      :tagname= "current_env";break;
493
   case env_offset_tag       :tagname= "env_offset";break;
494
   case make_lv_tag          :tagname= "make_lv";break;
495
   case clear_tag            :tagname= "clear";break;
496
   case null_tag             :tagname= "null";break;
497
   case real_tag             :tagname= "real";break;
498
   case string_tag           :tagname= "string";break;
499
   case general_proc_tag     :tagname= "general_proc";break;
500
   case env_size_tag         :tagname= "env_size";break;
501
   case give_stack_limit_tag :tagname= "give_stack_limit";break;
2 7u83 502
   case general_env_offset_tag:tagname= "general_env_offset";break;
7 7u83 503
   case caller_tag           :tagname= "caller";break;
504
   case caller_name_tag      :tagname= "caller_name";break;
2 7u83 505
   case make_dynamic_callee_tag:tagname="make_dynamic_callee";break;
7 7u83 506
   case make_callee_list_tag :tagname= "make_callee_list";break;
507
   case set_stack_limit_tag  :tagname= "set_stack_limit";break;
508
   case formal_callee_tag    :tagname= "formal_callee";break;
509
   case trap_tag             :tagname= "trap_tag";break;
510
 
2 7u83 511
    /* Powertrans specific */
7 7u83 512
   case locptr_tag          :tagname= "locptr_tag";break;
513
 
2 7u83 514
   default                    :tagname= "undefined";
7 7u83 515
 
2 7u83 516
  }
517
  return tagname;
518
}
519
 
7 7u83 520
exp infotag(exp e, int i)
2 7u83 521
{
7 7u83 522
  switch (i)
2 7u83 523
  {
524
   case 0:last_exp_seen=e;break;
525
   case 1:last_exp_seen1=e;break;
526
   case 2:last_exp_seen2=e;break;
527
   case 3:last_exp_seen3=e;break;
528
   case 4:last_exp_seen4=e;break;
529
   case 5:last_exp_seen5=e;break;
530
  }
7 7u83 531
 
532
  if (e==nilexp) {
2 7u83 533
    printf("Error 'nilexp'\n");
534
    return e;
535
  }
536
  printf("-------------------------------------------------------------------------------\n");
7 7u83 537
  printf("| %-17s 0x%-8x         | SHAPE information                    |\n",getname(name(e)), (unsigned int)e);
2 7u83 538
  printf("-------------------------------------------------------------------------------\n");
539
  printf("| no(e)        = %-15d       ",no(e));
7 7u83 540
  if (sh(e)!=NULL)
2 7u83 541
  {
542
    printf("| name(sh(e))        = %-15s |\n",shape_name(name(sh(e))));
543
  }
544
  else
545
  {
546
    printf("| No shape                             |\n");
547
  }
548
  printf("| props(e)     = ");
549
  {
550
    int i;
551
    unsigned short mask;
552
    for (i=15;i>=0;i--)
553
    {
554
      mask=1<<i;
555
      if (mask & props(e))
556
      {
557
	printf("1");
558
      }
7 7u83 559
      else
2 7u83 560
      {
561
	printf("0");
562
      }
7 7u83 563
 
2 7u83 564
      if (i%4 == 0)
565
      {
566
	printf(" ");
567
      }
568
    }
569
  }
570
 
7 7u83 571
  if (sh(e)!=NULL)
2 7u83 572
  {
573
    printf("  | shape_size(sh(e))  = %-8d        |\n",shape_size(sh(e)));
574
  }
575
  else
576
  {
577
    printf("  |                                      |\n");
578
  }
7 7u83 579
 
580
  printf("| bro(e)       = 0x%-8x            ",(unsigned int)bro(e));
581
 
582
  if (sh(e)!=NULL)
2 7u83 583
  {
584
 
585
    printf("| shape_align(sh(e)) = %-8d        |",(int)shape_align(sh(e)));
7 7u83 586
 
2 7u83 587
  }
588
  else
589
  {
590
    printf("|                                      |");
591
  }
7 7u83 592
  if (bro(e)!=NULL)
2 7u83 593
  {
7 7u83 594
    if (last(e))
2 7u83 595
    {
596
      printf("-->father:%s\n",getname(name(bro(e))));
597
    }
598
    else
599
    {
600
      printf("-->brother:%s\n",getname(name(bro(e))));
601
    }
602
  }
603
  else
604
  {
605
    printf("-->NULL\n");
606
  }
607
 
7 7u83 608
 
2 7u83 609
  printf("| sh(e)        = 0x%-8x            ",(unsigned int)sh(e));
610
 
7 7u83 611
  if (sh(e)!=NULL)
2 7u83 612
  {
613
    printf("| is_signed(sh(e))   = %-2d              |\n",is_signed(sh(e)));
614
  }
615
  else
616
  {
617
    printf("|                                      |\n");
618
  }
7 7u83 619
  printf("| pt(e)        = 0x%-8x            ",(unsigned int)pt(e));
2 7u83 620
 
7 7u83 621
  if (sh(e)!=NULL)
2 7u83 622
  {
623
    printf("| al1(sh(e))         = %-2d              |\n",(int)al1(sh(e)));
624
  }
625
  else
626
  {
627
    printf("|                                      |\n");
628
  }
7 7u83 629
 
2 7u83 630
  printf("| last(e)      = %d                     ",last(e));
7 7u83 631
 
632
  if (sh(e)!=NULL)
2 7u83 633
  {
634
    printf("| al2(sh(e))         = %-2d              |\n",(int)al2(sh(e)));
635
  }
636
  else
637
  {
638
    printf("|                                      |\n");
639
  }
7 7u83 640
 
2 7u83 641
  printf("-------------------------------------------------------------------------------\n");
7 7u83 642
  if (son(e)!=nilexp)
2 7u83 643
  {
644
    int finished=0;
7 7u83 645
    exp point=son(e);
646
    if (name(e) ==name_tag)
2 7u83 647
    {
648
      printf("son is ident 0x%-8x\n",(unsigned int)son(e));
649
      return e;
650
    }
7 7u83 651
 
2 7u83 652
    printf("                |\n");
653
 
654
    /* first line */
7 7u83 655
    while (!finished)
2 7u83 656
    {
657
      finished=last(point);
658
      printf("------------------------------   ");
659
      point=bro(point);
660
    }
661
    printf("\n");
662
    /* second line */
663
    point=son(e);
664
    finished=0;
7 7u83 665
    while (!finished)
2 7u83 666
    {
667
      finished=last(point);
7 7u83 668
      printf("| %-17s0x%-8x|   ",getname(name(point)), (unsigned int)point);
2 7u83 669
      point=bro(point);
670
    }
671
    printf("\n");
672
    /**/
673
    point=son(e);
674
    finished=0;
7 7u83 675
    while (!finished)
2 7u83 676
    {
677
      finished=last(point);
678
      printf("------------------------------   ");
679
      point=bro(point);
680
    }
681
    printf("\n");
682
    /* new line */
683
    point=son(e);
684
    finished=0;
7 7u83 685
    while (!finished)
2 7u83 686
    {
687
      finished=last(point);
7 7u83 688
      printf("| no          = %-10d   |   ",no(point));
2 7u83 689
      point=bro(point);
690
    }
691
    printf("\n");
692
    /* new line */
693
    point=son(e);
694
    finished=0;
7 7u83 695
    while (!finished)
2 7u83 696
    {
697
      finished=last(point);
7 7u83 698
      printf("| pt          = 0x%-8x   |   ",(unsigned int)pt(point));
2 7u83 699
      point=bro(point);
700
    }
701
    printf("\n");
702
    /* third line */
703
    point=son(e);
704
    finished=0;
7 7u83 705
    while (!finished)
2 7u83 706
    {
707
      finished=last(point);
7 7u83 708
      if (sh(point)!=NULL)
2 7u83 709
      {
7 7u83 710
	printf("| name(sh) = %-15s |",shape_name(name(sh(point))));
2 7u83 711
      }
712
      else
713
      {
714
	printf("|                            |");
715
      }
7 7u83 716
      if (finished==0)
2 7u83 717
      {
718
	printf("-->");
719
      }
720
      point=bro(point);
721
    }
722
    printf("\n");
723
 
724
    /* fourth line */
725
    point=son(e);
726
    finished=0;
7 7u83 727
    while (!finished)
2 7u83 728
    {
729
      finished=last(point);
7 7u83 730
      if (sh(point)!=NULL)
2 7u83 731
      {
732
	printf("| shape_size  = %-4d         |   ",shape_size(sh(point)));
733
      }
734
      else
735
      {
736
	printf("|                            |   ");
737
      }
738
      point=bro(point);
739
    }
740
    printf("\n");
741
    /**/
742
    point=son(e);
743
    finished=0;
7 7u83 744
    while (!finished)
2 7u83 745
    {
746
      finished=last(point);
7 7u83 747
      if (sh(point)!=NULL)
2 7u83 748
      {
749
	printf("| shape_align = %-4d         |   ",(int)shape_align(sh(point)));
750
      }
751
      else
752
      {
753
	printf("|                            |   ");
754
      }
755
      point=bro(point);
756
    }
757
    printf("\n");
758
    /* fifth_line */
759
    point=son(e);
760
    finished=0;
7 7u83 761
    while (!finished)
2 7u83 762
    {
763
      finished=last(point);
7 7u83 764
      if (sh(point)!=NULL)
2 7u83 765
      {
766
	printf("| is_signed   = %-4d         |   ",is_signed(sh(e)));
767
      }
768
      else
769
      {
770
	printf("|                            |   ");
771
      }
7 7u83 772
 
2 7u83 773
      point=bro(point);
774
    }
775
    printf("\n");
776
    /**/
777
    point=son(e);
778
    finished=0;
7 7u83 779
    while (!finished)
2 7u83 780
    {
781
      finished=last(point);
782
      printf("------------------------------   ");
783
      point=bro(point);
784
    }
785
    printf("\n");
786
    /* last line */
787
    point=son(e);
788
    finished=0;
7 7u83 789
    while (!finished)
2 7u83 790
    {
791
      finished=last(point);
7 7u83 792
      if (son(point) ==NULL)
2 7u83 793
      {
7 7u83 794
 
2 7u83 795
	printf("                                 ");
796
      }
7 7u83 797
      else
2 7u83 798
      {
799
	printf("                |                ");
800
      }
7 7u83 801
 
802
 
2 7u83 803
      point=bro(point);
804
    }
805
    printf("\n");
806
  }
807
 
7 7u83 808
 
809
 
810
 
811
 
2 7u83 812
  return e;
813
}
7 7u83 814
static void print_spaces(int n)
2 7u83 815
{
816
  int i;
817
  int j=0;
818
  for (i=0;i<n;i++)
819
  {
7 7u83 820
    switch (j)
2 7u83 821
    {
822
     case 0:printf(" ");break;
823
     case 1:printf(" ");break;
824
     case 2:printf("|");break;
7 7u83 825
     }
2 7u83 826
     j++;
827
    if (j==3)
828
      j=0;
829
  }
7 7u83 830
 
2 7u83 831
}
832
 
7 7u83 833
 
834
static void exp_show(exp e, int depth, int depth_of_recursion, int flag)
2 7u83 835
{
836
  char *tagname;
837
 
7 7u83 838
  if (e == nilexp || depth == depth_of_recursion)
2 7u83 839
    return;
840
  printf("(0x%x)",(int)e);
841
  tagname = getname(name(e));
7 7u83 842
 
2 7u83 843
  print_spaces(depth);
7 7u83 844
 
845
  switch (name(e))
2 7u83 846
  {
847
    /* Don't want to look down son's of name_tag's or env_offset_tag because this will take you to
848
ident_tag's and thus into an infinite loop */
849
 
850
   case proc_tag:
851
   case general_proc_tag:
852
    {
853
      if (done_scan==1)
854
      {
855
	baseoff b = boff(father(e));
856
	char *ext;
7 7u83 857
	ext = main_globals[(-b.base) - 1] ->dec_u.dec_val.dec_id;
2 7u83 858
	printf("%s:\"%s\"\n",tagname,ext);
859
      }
860
      else
861
      {
862
	printf("%s:\n",tagname);
863
      }
7 7u83 864
 
2 7u83 865
      exp_show(son(e),depth+1,depth_of_recursion,0);
866
      break;
867
    }
7 7u83 868
 
2 7u83 869
   case name_tag:
870
    {
871
      int l = ident_no(son(e));
7 7u83 872
      if (l)
2 7u83 873
	printf("%s:<%s> no=%d obtain {tag~%04d}\n",tagname,shape_name(name(sh(e))),no(e),l);
874
#if 1
7 7u83 875
      else if (name(sh(e)) ==prokhd && (name(son(son(e))) ==proc_tag||son(son(e)) ==nilexp||name(son(son(e))) ==general_proc_tag) && done_scan==1)
2 7u83 876
      {
877
	baseoff b = boff(son(e));
878
	char *ext;
7 7u83 879
	ext = main_globals[(-b.base) - 1] ->dec_u.dec_val.dec_id;
2 7u83 880
	printf("%s:<%s> function \"%s\"(0x%x)\n",tagname,shape_name(name(sh(e))),ext,(int)(son(e)));
881
      }
882
#endif
883
      else
7 7u83 884
	printf("%s:<%s> no=%d obtain (0x%x)\n",tagname,shape_name(name(sh(e))),no(e), (int)son(e));
2 7u83 885
      break;
886
    }
887
   case trap_tag:
888
    {
889
      printf("%s:no=%d\n",tagname,no(e));
890
      exp_show(son(e),depth+1,depth_of_recursion,0);
891
      break;
892
    }
7 7u83 893
 
2 7u83 894
   case general_env_offset_tag:
895
   case env_offset_tag:
896
    {
897
      int l = ident_no(son(e));
7 7u83 898
      if (l)
2 7u83 899
	printf("%s:<%s> for ident {tag~%04d}\n",tagname,shape_name(name(sh(e))),l);
900
      else
7 7u83 901
	printf("%s:<%s> for ident (0x%x)\n",tagname,shape_name(name(sh(e))), (int)son(e));
2 7u83 902
      break;
903
    }
904
   case caller_name_tag:
905
    {
906
      printf("%s:<%s> for caller NO_%d\n",tagname,shape_name(name(sh(e))),no(e));
907
      break;
7 7u83 908
    }
2 7u83 909
   case case_tag:
910
    printf("%s:<%s>\n",tagname,shape_name(name(sh(e))));
911
    exp_show(son(e),depth+1,depth_of_recursion,1);
912
    {
913
      exp s=son(e);
914
      do
915
      {
916
	int label;
917
	s=bro(s);
918
	printf("(0x%x)",(int)s);
919
	print_spaces(depth+1);
920
	printf("(%d",no(s));
7 7u83 921
	if (son(s)!=nilexp)
2 7u83 922
	  printf("-%d)",no(son(s)));
7 7u83 923
	else
2 7u83 924
	  printf(")");
925
	label = labst_no(pt(s));
926
	if (label)
927
	  printf(" ----> {label~%04d}\n",label);
928
	else
929
	  printf(" ----> (0x%x)\n",(int)pt(s));
930
      }
7 7u83 931
      while (!last(s));
2 7u83 932
    }
933
    break;
934
   case goto_tag:
935
    {
936
      int label= labst_no(pt(e));
937
      if (label)
938
	printf("%s:<%s> ---->{label~%04d}\n",tagname,shape_name(name(sh(e))),label);
939
      else
7 7u83 940
	printf("%s:<%s> ----> (0x%x)\n",tagname,shape_name(name(sh(e))), (int)pt(e));
2 7u83 941
      exp_show(son(e),depth+1,depth_of_recursion,0);
942
      break;
943
    }
944
   case fdiv_tag:
945
   case fplus_tag:
946
   case fminus_tag:
947
   case fneg_tag:
948
   case fpower_tag:
949
   case mult_tag:
950
   case neg_tag:
951
   case plus_tag:
952
   case power_tag:
953
   case rem0_tag:
954
   case rem2_tag:
955
   case mod_tag:
956
   case round_tag:
957
   case shl_tag:
958
   case shr_tag:
7 7u83 959
 
2 7u83 960
    if (optop(e))
961
    {
962
      printf("%s:<%s>\n",tagname,shape_name(name(sh(e))));
963
    }
964
    else
965
    {
966
      int label = labst_no(pt(e));
967
      if (label)
968
	printf("%s:<%s> error_jump=>{label~%04d}\n",tagname,shape_name(name(sh(e))),label);
969
      else
7 7u83 970
	printf("%s:<%s> error_jump=>0x%x\n",tagname,shape_name(name(sh(e))), (unsigned int)pt(e));
2 7u83 971
    }
972
    exp_show(son(e),depth+1,depth_of_recursion,0);
973
    break;
974
 
975
 
976
 
977
   case last_local_tag:
978
    printf("%s: pt=0x%x\n",tagname,(unsigned int)pt(e));
979
    exp_show(son(e),depth+1,depth_of_recursion,0);
980
    break;
981
   case make_lv_tag:
982
    {
983
      int label = labst_no(pt(e));
7 7u83 984
      if (label)
2 7u83 985
	printf("%s: {label~%04d}\n",tagname,label);
986
      else
987
	printf("%s: Label=0x%x\n",tagname,(unsigned int)pt(e));
988
      exp_show(son(e),depth+1,depth_of_recursion,0);
989
      break;
990
    }
7 7u83 991
 
2 7u83 992
   case seq_tag:
993
   case rotl_tag:
994
   case rotr_tag:
995
   case realpart_tag:
996
   case nof_tag:
997
   case not_tag:
998
   case null_tag:
999
   case offset_add_tag:
1000
   case offset_div_tag:
1001
   case offset_max_tag:
1002
   case offset_mult_tag:
1003
   case offset_negate_tag:
1004
   case offset_pad_tag:
1005
   case offset_subtract_tag:
1006
   case or_tag:
1007
   case minptr_tag:
1008
   case ignorable_tag:
1009
   case imag_tag:
1010
   case float_tag:
1011
   case fmax_tag:
1012
   case fmin_tag:
1013
   case fabs_tag:
1014
   case div2_tag:
7 7u83 1015
   case div1_tag:
2 7u83 1016
   case div0_tag:
1017
   case current_env_tag:
1018
   case concatnof_tag:
1019
   case abs_tag:
1020
   case addptr_tag:
1021
   case alloca_tag:
1022
   case and_tag:
1023
   case apply_tag:
1024
   case int_to_bitf_tag:
1025
   case bitf_to_int_tag:
1026
   case cont_tag:
1027
   case cond_tag:
1028
   case chfl_tag:
1029
   case caller_tag:
1030
    printf("%s:<%s>\n",tagname,shape_name(name(sh(e))));
1031
    exp_show(son(e),depth+1,depth_of_recursion,0);
1032
    break;
1033
   case bfass_tag:
1034
   case bfcont_tag:
7 7u83 1035
    if (name(sh(e)) ==bitfhd)
2 7u83 1036
    {
1037
      printf("%s:<%s> %s %d bit bitfield , bit_offset=%d\n",tagname,shape_name(name(sh(e))),is_signed(sh(e))?"Signed":"Unsigned",shape_size(sh(e)),no(e));
1038
    }
1039
    else
1040
    {
1041
      printf("%s:<%s> bit_offset=%d\n",tagname,shape_name(name(sh(e))),no(e));
1042
    }
7 7u83 1043
 
2 7u83 1044
    exp_show(son(e),depth+1,depth_of_recursion,0);
1045
    break;
1046
   case chvar_tag:
7 7u83 1047
    if (name(sh(e)) ==bitfhd)
2 7u83 1048
    {
7 7u83 1049
      printf("%s:<%s> %s %d bit bitfield\n",tagname,shape_name(name(sh(e))),is_signed(sh(e)) ==0?"Unsigned":"Signed",shape_size(sh(e)));
2 7u83 1050
    }
1051
    else
1052
    {
1053
      printf("%s:<%s>\n",tagname,shape_name(name(sh(e))));
1054
    }
1055
    exp_show(son(e),depth+1,depth_of_recursion,0);
1056
    break;
1057
   case make_callee_list_tag:
7 7u83 1058
    if (call_has_vcallees(e))
2 7u83 1059
    {
1060
      printf("%s:has_vcallees no=%d\n",tagname,no(e));
1061
    }
1062
    else
1063
    {
1064
      printf("%s: no=%d\n",tagname,no(e));
1065
    }
1066
    exp_show(son(e),depth+1,depth_of_recursion,0);
1067
    break;
1068
   case clear_tag:
1069
    printf("%s:<%s> no=%d\n",tagname,shape_name(name(sh(e))),no(e));
1070
    exp_show(son(e),depth+1,depth_of_recursion,0);
1071
    break;
1072
   case labst_tag:
1073
    printf("%s:<%s> {label~%04d}\n",tagname,shape_name(name(sh(e))),labst_no(e));
1074
    exp_show(son(e),depth+1,depth_of_recursion,0);
1075
    break;
1076
   case diagnose_tag:
7 7u83 1077
    printf("%s:<%s> dno=0x%x\n",tagname,shape_name(name(sh(e))), (unsigned int)dno(e));
2 7u83 1078
    exp_show(son(e),depth+1,depth_of_recursion,0);
1079
    break;
1080
   case val_tag:
1081
    if (is_signed(sh(e)))
1082
    {
1083
      printf("%s:<%s> no=%d (0x%08x)\n",tagname,shape_name(name(sh(e))),no(e),no(e));
1084
    }
1085
    else
1086
    {
1087
      printf("%s:<%s> no=%u (0x%08x)\n",tagname,shape_name(name(sh(e))),no(e),no(e));
1088
    }
7 7u83 1089
 
2 7u83 1090
    exp_show(son(e),depth+1,depth_of_recursion,0);
1091
    break;
1092
   case reff_tag:
1093
   case field_tag:
1094
   case real_tag:
1095
   case ncopies_tag:
1096
    printf("%s:<%s> no=%d\n",tagname,shape_name(name(sh(e))),no(e));
1097
    exp_show(son(e),depth+1,depth_of_recursion,0);
1098
    break;
1099
 
1100
  case test_tag:
1101
    {
1102
      int label= labst_no(pt(e));
1103
      if (label)
1104
	printf("%s: (f_%s) fails---->{label~%04d}\n",tagname,find_test_name(e),label);
1105
      else
7 7u83 1106
	printf("%s: (f_%s) fails----> (0x%x)\n",tagname,find_test_name(e), (int)pt(e));
2 7u83 1107
      exp_show(son(e),depth+1,depth_of_recursion,0);
1108
      break;
1109
    }
7 7u83 1110
 
2 7u83 1111
   case ident_tag:
1112
    printf("%s:<%s> {tag~%04d}",tagname,shape_name(name(sh(e))),ident_no(e));
1113
    if (isvar(e))
1114
    {
1115
      printf(" VAR");
1116
    }
7 7u83 1117
    if (isvis(e))
2 7u83 1118
    {
1119
      printf(" VIS");
1120
    }
7 7u83 1121
    if (isenvoff(e))
2 7u83 1122
    {
1123
      printf(" ENVOFF");
1124
    }
7 7u83 1125
    if (iscaonly(e))
2 7u83 1126
    {
1127
      printf(" CAONLY");
1128
    }
1129
    if (isparam(e))
1130
    {
1131
      printf(" PARAM");
1132
    }
1133
    if (isglob(e))
1134
    {
1135
      printf(" GLOB");
1136
    }
1137
    printf("\n");
7 7u83 1138
 
2 7u83 1139
    exp_show(son(e),depth+1,depth_of_recursion,0);
1140
    break;
1141
 
7 7u83 1142
 
2 7u83 1143
  case string_tag:
7 7u83 1144
    printf(    myprint(nostr(e));
2 7u83 1145
    printf("\"\n");
1146
    exp_show(son(e),depth+1,depth_of_recursion,0);
1147
    break;
1148
 
7 7u83 1149
 
2 7u83 1150
  default:
1151
/* default action will be */
1152
    printf("%s:\n",tagname);
1153
    exp_show(son(e),depth+1,depth_of_recursion,0);
1154
  }
1155
 
1156
 
1157
 
7 7u83 1158
 
2 7u83 1159
  /* always look at brother unless told not to or it is last */
1160
  if (last(e) || flag)
1161
    return;
7 7u83 1162
  else
2 7u83 1163
  {
1164
    exp_show(bro(e),depth,depth_of_recursion,0);
1165
    return;
1166
  }
1167
}
7 7u83 1168
char *find_test_name(exp e)
2 7u83 1169
{
1170
  char *word;
1171
  switch (test_number(e))
1172
  {
1173
   case 1:
1174
    word="greater_than";
1175
    break;
1176
   case 2:
1177
    word="greater_than_or_equal";
1178
    break;
1179
   case 3:
1180
    word="less_than";
1181
    break;
1182
   case 4:
1183
    word="less_than_or_equal";
1184
    break;
1185
   case 5:
1186
    word="equal";
1187
    break;
1188
   case 6:
1189
    word="not_equal";
1190
    break;
1191
   case 7:
1192
    word="not_less_than_or_equal";
1193
    break;
1194
   case 8:
1195
    word="not_less_than";
1196
    break;
1197
   case 9:
1198
    word="not_greater_than_or_equal";
1199
    break;
1200
   case 10:
1201
    word="not_greater_than";
1202
    break;
1203
   case 11:
1204
    word="less_than_or_greater_than";
1205
    break;
1206
   case 12:
1207
    word="not_less_than_and_not_greater_than";
1208
    break;
1209
   case 13:
1210
    word="comparable";
1211
    break;
1212
   case 14:
1213
    word="not_comparable";
1214
    break;
1215
  }
1216
  return word;
1217
}
7 7u83 1218
static void myprint(char *word)
2 7u83 1219
{
1220
  char *k;
1221
  k=word;
7 7u83 1222
  while (*k!=0) {
1223
    switch (*k) {
2 7u83 1224
    case '\n':
1225
      printf("\\n");
1226
      break;
1227
    case '\t':
1228
      printf("\\t");
1229
      break;
1230
    default:
1231
      printf("%c",*k);
1232
    }
1233
    k++;
1234
  }
1235
  return;
1236
}
7 7u83 1237
char *shape_name(int n)
2 7u83 1238
{
1239
  char *k;
7 7u83 1240
  switch (n)
2 7u83 1241
  {
1242
   case 1:
1243
    k="bothd";
1244
    break;
1245
   case 2:
1246
    k="tophd";
1247
    break;
1248
   case 3:
1249
    k="scharhd";
1250
    break;
1251
   case 4:
1252
    k="ucharhd";
1253
    break;
1254
   case 5:
1255
    k="swordhd";
1256
    break;
1257
   case 6:
1258
    k="uwordhd";
1259
    break;
1260
   case 7:
1261
    k="slonghd";
1262
    break;
1263
   case 8:
1264
    k="ulonghd";
1265
    break;
1266
   case 9:
1267
    k="s64hd";
1268
    break;
1269
   case 10:
1270
    k="u64hd";
1271
    break;
1272
   case 17:
1273
    k="shcomplexhd";
1274
    break;
1275
   case 18:
1276
    k="complexhd";
1277
    break;
1278
   case 19:
1279
    k="complexdoublehd";
1280
    break;
1281
   case 20:
1282
    k="shrealhd";
1283
    break;
1284
   case 21:
1285
    k="realhd";
1286
    break;
1287
   case 22:
1288
    k="doublehd";
1289
    break;
1290
   case 23:
1291
    k="bitfhd";
1292
    break;
1293
   case 24:
1294
    k="prokhd";
1295
    break;
1296
   case 25:
1297
    k="ptrhd";
1298
    break;
1299
   case 26:
1300
    k="offsethd";
1301
    break;
1302
   case 27:
1303
    k="sizehd";
1304
    break;
1305
   case 28:
1306
    k="cpdhd";
1307
    break;
1308
   case 29:
1309
    k="nofhd";
1310
    break;
1311
   case 30:
1312
    k="tokhd";
1313
    break;
7 7u83 1314
 
2 7u83 1315
   default:
1316
    k="unknown";
1317
    break;
1318
  }
1319
  return k;
1320
}
7 7u83 1321
void properties(int i)
2 7u83 1322
{
1323
  exp l;
7 7u83 1324
 
1325
  switch (i)
2 7u83 1326
  {
1327
   case 0:l=last_exp_seen;break;
1328
   case 1:l=last_exp_seen1;break;
1329
   case 2:l=last_exp_seen2;break;
1330
   case 3:l=last_exp_seen3;break;
1331
   case 4:l=last_exp_seen4;break;
1332
   case 5:l=last_exp_seen5;break;
1333
  }
7 7u83 1334
  if (l==NULL)
2 7u83 1335
  {
1336
    printf("No current exp\n");
1337
    return;
1338
  }
7 7u83 1339
  switch (name(l))
2 7u83 1340
  {
1341
    case ident_tag:ident_props(l);break;
1342
    case proc_tag:proc_tag_props(l);break;
1343
    case general_proc_tag:general_proc_tag_props(l);break;
1344
    case solve_tag:solve_props(l);break;
1345
   case movecont_tag:movecont_props(l);break;
1346
   case cont_tag:cont_props(l);break;
1347
   case labst_tag:labst_props(l);break;
1348
   case name_tag:name_props(l);break;
1349
   case string_tag:string_props(l);break;
1350
   case val_tag:val_props(l);break;
1351
   case rep_tag:rep_props(l);break;
1352
   case apply_tag:apply_props(l);break;
1353
   default:printf("Don't know about the properties of a %s\n",getname(name(l)));break;
1354
  }
1355
  return;
1356
}
7 7u83 1357
void ident_props(exp e)
2 7u83 1358
{
1359
  printf("isvar       = %d\n",isvar(e));
1360
  printf("isvis       = %d\n",isvis(e));
1361
  printf("isenvoff    = %d\n",isenvoff(e));
1362
  printf("iscaonly    = %d\n",iscaonly(e));
1363
  printf("isusereg    = %d\n",isusereg(e));
1364
  printf("isparam     = %d\n",isparam(e));
1365
  printf("isglob      = %d\n",isglob(e));
1366
  printf("copying     = %d\n",copying(e));
1367
  printf("isinlined   = %d\n",isinlined(e));
1368
#ifdef POWER
1369
#define subvar 0x0100
1370
  printf("subvar      = %d\n",!(!(props(e) & subvar)));
1371
  printf("inreg_bits  = %d\n",!(!(props(e) & inreg_bits)));
1372
  printf("infreg_bits = %d\n",!(!(props(e) & infreg_bits)));
1373
  printf("inanyreg    = %d\n",!(!(props(e) & inanyreg)));
1374
  printf("defer_bit   = %d\n",!(!(props(e) & defer_bit)));
1375
  printf("notparreg   = %d\n",!(!(props(e) & notparreg)));
1376
  printf("notresreg   = %d\n",!(!(props(e) & notresreg)));
1377
#endif
1378
}
7 7u83 1379
void proc_tag_props(exp e)
2 7u83 1380
{
1381
  printf("has_struct_res     = %d\n",has_struct_res(e));
1382
  printf("loc_address        = %d\n",loc_address(e));
1383
  printf("proc_has_setjmp    = %d\n",proc_has_setjmp(e));
1384
  printf("proc_has_lv        = %d\n",proc_has_lv(e));
1385
  printf("isrecursive        = %d\n",isrecursive(e));
1386
  printf("proc_uses_crt_env  = %d\n",proc_uses_crt_env(e));
1387
  printf("proc_uses_external = %d\n",proc_uses_external(e));
1388
}
7 7u83 1389
void general_proc_tag_props(exp e)
2 7u83 1390
{
1391
  printf("has_struct_res     = %d\n",has_struct_res(e));
1392
  printf("loc_address        = %d\n",loc_address(e));
1393
  printf("proc_has_setjmp    = %d\n",proc_has_setjmp(e));
1394
  printf("proc_has_lv        = %d\n",proc_has_lv(e));
1395
  printf("isrecursive        = %d\n",isrecursive(e));
1396
  printf("proc_uses_crt_env  = %d\n",proc_uses_crt_env(e));
1397
  printf("proc_uses_external = %d\n",proc_uses_external(e));
1398
  printf("PROCPROPS\n");
1399
  printf("proc_has_vcallees  = %d\n",proc_has_vcallees(e));
1400
  printf("proc_has_vcallers  = %d\n",proc_has_vcallers(e));
1401
  printf("proc_has_checkstack= %d\n",proc_has_checkstack(e));
1402
  printf("proc_has_nolongj   = %d\n",proc_has_nolongj(e));
1403
}
1404
 
7 7u83 1405
void solve_props(exp e)
2 7u83 1406
{
1407
#ifdef POWER
1408
  printf("is_copying_solve = %d\n",is_copying_solve(e));
1409
#endif
1410
}
7 7u83 1411
void movecont_props(exp e)
2 7u83 1412
{
1413
  printf("isnooverlap = %d\n",isnooverlap(e));
1414
}
7 7u83 1415
void cont_props(exp e)
2 7u83 1416
{
1417
  printf("to_propagate = %d\n",to_propagate(e));
1418
}
7 7u83 1419
void labst_props(exp e)
2 7u83 1420
{
1421
  printf("is_loaded_lv = %d\n",is_loaded_lv(e));
1422
  printf("isunroll     = %d\n",isunroll(e));
1423
}
7 7u83 1424
void name_props(exp e)
2 7u83 1425
{
1426
  printf("islastuse   = %d\n",islastuse(e));
1427
  printf("isloadparam = %d\n",isloadparam(e));
1428
  printf("isreallyass = %d\n",isreallyass(e));
1429
}
7 7u83 1430
void string_props(exp e)
2 7u83 1431
{
1432
  printf("string_char_size = %d\n",string_char_size(e));
1433
}
7 7u83 1434
void val_props(exp e)
2 7u83 1435
{
1436
  printf("isbigval = %d\n",isbigval(e));
1437
}
7 7u83 1438
void rep_props(exp e)
2 7u83 1439
{
1440
  printf("isunrolled = %d\n",isunrolled(e));
1441
}
7 7u83 1442
void apply_props(exp e)
2 7u83 1443
{
1444
  printf("istoinline = %d\n",istoinline(e));
1445
}
1446
#endif