Subject: Re: attributes bits in symb->attr

From: Zheng Gengbin <[email-masked]>
Date: Sat, 14 Dec 1996 09:21:47 +0800 (EAT)

On Wed, 11 Dec 1996, Guansong Zhang wrote:

> Hi,
> 
> I come to this question from the following two directions of my work at the
> same time, I need your help on this.
> 
> 1) I wrote previously that attibutes defined in header files are not quite
> clear.
> 
> 2) I need to use the attribute to improve evaluateExpression, so int parameter
> can be got at compiling time.
> 
> The following are my questions:
> 
> 1) attr is defined as an int in symb.h, how many bits it supposed to have? Any
> problem considering that int may be implemented differently on different kind
> of machines?
>

	We suppose a int will have 4 bytes on workstations. This seems
sound.
 
> 2) dumpdep will print out:
> 
> 
>   bits set:   0 syn/protected,  1 shared/public,  2 private,  3 future,  4
> virtual,
>                 5 inline,  6 unsigned,  7 signed,  8 short,  9 long,  10
> volatile,
>                 11 const,  12 typedef,  13 extern,  14 friend,  15 static,  16
> register,
>                 17 auto,  18 global,  19 Sync,  20 atomic,  21 __private, 22
> restrict
> 
> what does this mean? Do we follow this?
> 

	This only have meanings when compile c language .

> 3) how many attributes we may have? Now, these attributes are defined in
> defnodes.h. Some old def from vparse.h and macro.h. Is it possible we put them
> together?
> 

	All the attr we ever use is contained in defnodes.h .

> 4) Why the following in defnodes.h does not have single bit? Can we wrote it as
> a little clear, like:
> 
> #define STORAGE_FLAG  1024*(4+8+16+32+64+128)
> 
> 

	Yes . I think that's a good way.

Zheng

---

From: Zheng Gengbin <[email-masked]>
Date: Sat, 14 Dec 1996 15:38:44 +0800 (EAT)

> can be got at compiling time.

	I will say something about this . You can use PARAMETER_BIT of 
llnd->attr to test if an expression have a const int value . If a leaf node 
of the expression have PARAMETER_BIT , you can got the value . You also
should note that T_KIND is new and you must add it to the function .
And since we have no SUB_OP , and use MINUS_OP , we must discreminate two
conditions. 
	When parsing the expression , you use the field const_val in llnd to
record the intermidiate results if you like . In fact , in hpfsc I have
already written such a function to calculate the value . 

> Guansong

***************************************************************************
*     Zheng Gengbin                 *                                     *
*                                   *                                     *
*  Dept. of Computer Science        *  Phone:  86-10-2585088              *
*         & Technology              *  Email:                             *
*                                   *      [email-masked]   *
*  Peking University P.R.China      *  Mail:                              *
*                                   *      Room 1077 ,Building 47,        *
*                                   *      Peking University, P.R.China   *
***************************************************************************