Author: zhuqing
Date: 2011-08-31 05:16:46 -0400 (Wed, 31 Aug 2011)
New Revision: 3728
Modified:
trunk/osprey/be/com/stblock.cxx
trunk/osprey/common/com/symtab_idx.h
trunk/osprey/wgen/wgen_spin_symbol.cxx
Log:
Fix bug832, add user defined align info to ty_idx.
Code Review: Sun Chan.
Modified: trunk/osprey/be/com/stblock.cxx
===================================================================
--- trunk/osprey/be/com/stblock.cxx 2011-08-25 02:01:39 UTC (rev 3727)
+++ trunk/osprey/be/com/stblock.cxx 2011-08-31 09:16:46 UTC (rev 3728)
@@ -129,6 +129,11 @@
return align;
}
+ if (TY_is_user_align(ty_idx))
+ {
+ return align;
+ }
+
switch(ST_sclass(sym))
{
case SCLASS_AUTO:
Modified: trunk/osprey/common/com/symtab_idx.h
===================================================================
--- trunk/osprey/common/com/symtab_idx.h 2011-08-25 02:01:39 UTC (rev
3727)
+++ trunk/osprey/common/com/symtab_idx.h 2011-08-31 09:16:46 UTC (rev
3728)
@@ -219,13 +219,15 @@
// UINT _restrict : 1;
// UINT _volatile : 1;
// UINT _const : 1;
-// UINT _align : 5;
+// UINT _user_align : 1;
+// UINT _align : 4;
// };
const UINT32 TY_RESTRICT = 0x00000080; // restrict type qualifier
const UINT32 TY_VOLATILE = 0x00000040; // volatile type qualifier
const UINT32 TY_CONST = 0x00000020; // const type qualifier
-const UINT32 TY_ALIGN = 0x0000001f; // bit mask for alignment field
+const UINT32 TY_USER_ALIGN = 0x00000010; // user defined align flag
+const UINT32 TY_ALIGN = 0x0000000f; // bit mask for alignment field
inline UINT32 TY_IDX_index (TY_IDX ty_idx) { return ty_idx >> 8; }
inline void Set_TY_IDX_index (TY_IDX &ty_idx, UINT32 index)
@@ -248,6 +250,10 @@
inline void Set_TY_is_restrict (TY_IDX &ty_idx) { ty_idx |= TY_RESTRICT; }
inline void Clear_TY_is_restrict (TY_IDX &ty_idx){ ty_idx &= ~TY_RESTRICT; }
+inline BOOL TY_is_user_align (TY_IDX ty_idx) { return ty_idx &
TY_USER_ALIGN;}
+inline void Set_TY_is_user_align (TY_IDX &ty_idx) { ty_idx |= TY_USER_ALIGN; }
+inline void Clear_TY_is_user_align (TY_IDX &ty_idx){ ty_idx &= ~TY_USER_ALIGN;
}
+
// TY_align_exp returns the exponent part of the alignment. That is, the
// true alignment in bytes is 2 to the power of TY_align_exp ()
inline UINT TY_align_exp (TY_IDX ty_idx) { return ty_idx & TY_ALIGN; }
Modified: trunk/osprey/wgen/wgen_spin_symbol.cxx
===================================================================
--- trunk/osprey/wgen/wgen_spin_symbol.cxx 2011-08-25 02:01:39 UTC (rev
3727)
+++ trunk/osprey/wgen/wgen_spin_symbol.cxx 2011-08-31 09:16:46 UTC (rev
3728)
@@ -1915,6 +1915,9 @@
if (gs_tree_this_volatile(decl_node))
Set_TY_is_volatile (ty_idx);
else Clear_TY_is_volatile (ty_idx);
+ if (gs_decl_user_align (decl_node))
+ Set_TY_is_user_align(ty_idx);
+ else Clear_TY_is_user_align(ty_idx);
#ifdef KEY
// Handle aligned attribute (bug 7331)
if (gs_decl_user_align (decl_node))
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Open64-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/open64-devel