1 /* ***********************************************************
 2    *                                                         *
 3    * Copyright, (C) Honeywell Information Systems Inc., 1982 *
 4    *                                                         *
 5    * Copyright (c) 1972 by Massachusetts Institute of        *
 6    * Technology and Honeywell Information Systems, Inc.      *
 7    *                                                         *
 8    *********************************************************** */
 9 
10 
11 propagate_bit:      proc(sym,number);
12 
13 /* Modified 780616 by PG for unsigned */
14 /* Modified Dec 1978 by DS for new cross-ref 'set' format */
15 
16 /* parameters */
17 
18 dcl (     sym ptr,
19           number fixed bin (15)) parameter;
20 
21 /* automatic */
22 
23 dcl       (p, r) ptr;
24 
25 /* builtins */
26 
27 dcl       (null, string, substr) builtin;
28 
29 /* include files */
30 
31 %include symbol;
32 %include symbol_bits;
33 %include cross_reference;
34 ^L
35 /* program */
36 
37           if sym->symbol.temporary then return;
38 
39           p = sym;
40 
41           if number = set_bit                               /* Set gets propagated to ancestors as well */
42           then do;
43                     r = p -> symbol.cross_references;
44                     if r ^= null then r -> cross_reference.set_reference = "1"b;
45                                                             /* r = null means symbol is compiler-developed */
46                                                             /* Support new 'set' format in listing */
47                     r = p;
48                     do while(r->symbol.father^=null);
49                               r=r->symbol.father;
50                               substr(string(r->symbol.attributes),number,1) = "1"b;
51                     end;
52           end;
53           else if substr (string (p->symbol.attributes), number, 1)
54                then return;
55 
56           substr(string(p->symbol.attributes),number,1) = "1"b;
57           if p->symbol.son^=null
58           then call propagate((p->symbol.son));
59 
60 propagate:          proc(p);
61 
62 dcl       p ptr unal,
63           q ptr;
64 
65           q = p;
66 
67           do while(q^=null);
68                     substr(string(q->symbol.attributes),number,1) = "1"b;
69 
70                     if q->symbol.son^=null
71                     then call propagate(q->symbol.son);
72 
73                     q = q->symbol.brother;
74           end;
75 
76           end propagate;
77 
78      end /* propagate_bit */;