This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lto] declaration flags


This patch answer request for declaration flags:

http://gcc.gnu.org/ml/gcc/2007-01/msg01094.html

The DECL_ASSEMBLER_NAME, DECL_INIT_PRIORITY  and
DECL_THREAD_LOCAL_P are not at place yet, but others
are rather obvious (till I am missing something in
the meaning of the flags).

ok for lto?

Alon.

Index: lto-tree-flags.def
===================================================================
--- lto-tree-flags.def  (revision 124739)
+++ lto-tree-flags.def  (working copy)
@@ -309,6 +309,23 @@
       ADD_EXPR_FLAG (static_flag)
       ADD_EXPR_FLAG (public_flag)
       ADD_EXPR_FLAG (nothrow_flag)
+      ADD_VIS_FLAG (section_name)
+      ADD_VIS_FLAG (visibility)
+      ADD_VIS_FLAG (one_only)
+      ADD_VIS_FLAG (comdat_flag)
+      ADD_VIS_FLAG (weak_flag)
+      ADD_VIS_FLAG (dllimport_flag)
+      ADD_FUNC_FLAG (uninlinable)
+      ADD_FUNC_FLAG (malloc_flag)
+      ADD_FUNC_FLAG (returns_twice_flag)
+      ADD_FUNC_FLAG (pure_flag)
+      ADD_FUNC_FLAG (novops_flag)
+      ADD_FUNC_FLAG (static_ctor_flag)
+      ADD_FUNC_FLAG (static_dtor_flag)
+      ADD_FUNC_FLAG (no_instrument_function_entry_exit)
+      ADD_FUNC_FLAG (no_limit_stack)
+      ADD_FUNC_FLAG (regdecl_flag)
+      ADD_FUNC_FLAG (inline_flag)
     END_EXPR_CASE (FUNCTION_DECL)

     START_EXPR_CASE (FUNCTION_TYPE)
@@ -692,6 +709,17 @@
       ADD_DECL_FLAG (decl_flag_3)
       ADD_DECL_FLAG (gimple_reg_flag)
       ADD_DECL_FLAG (call_clobbered_flag)
+      ADD_VIS_FLAG (section_name)
+      ADD_VIS_FLAG (visibility)
+      ADD_VIS_FLAG (one_only)
+      ADD_VIS_FLAG (comdat_flag)
+      ADD_VIS_FLAG (weak_flag)
+      ADD_VIS_FLAG (dllimport_flag)
+      ADD_VIS_FLAG (hard_register)
+      ADD_VIS_FLAG (init_priority_p)
+      ADD_VIS_FLAG (tls_model)
+      ADD_VIS_FLAG (in_text_section)
+      ADD_VIS_FLAG (common_flag)
     END_EXPR_CASE (VAR_DECL)

     START_EXPR_CASE (VEC_COND_EXPR)
Index: lto-function-out.c
===================================================================
--- lto-function-out.c  (revision 124739)
+++ lto-function-out.c  (working copy)
@@ -616,6 +616,8 @@
 #define START_EXPR_CASE(code)    case code:
 #define ADD_EXPR_FLAG(flag_name) { flags <<= 1; if (expr->common.
flag_name ) flags |= 1; }
 #define ADD_DECL_FLAG(flag_name) { flags <<= 1; if (expr->decl_common.
flag_name ) flags |= 1; }
+#define ADD_VIS_FLAG(flag_name) { flags <<= 1; if (expr->decl_with_vis.
flag_name ) flags |= 1; }
+#define ADD_FUNC_FLAG(flag_name) { flags <<= 1; if (expr->function_decl.
flag_name ) flags |= 1; }
 #define END_EXPR_CASE(class)      break;
 #define END_EXPR_SWITCH()                 \
     default:                              \
@@ -634,6 +636,8 @@
 #undef START_EXPR_CASE
 #undef ADD_EXPR_FLAG
 #undef ADD_DECL_FLAG
+#undef ADD_VIS_FLAG
+#undef ADD_FUNC_FLAG
 #undef END_EXPR_CASE
 #undef END_EXPR_SWITCH

Index: ChangeLog
===================================================================
--- ChangeLog     (revision 124762)
+++ ChangeLog     (working copy)
@@ -1,3 +1,9 @@
+2007-05-15  Alon Dayan  <alond@il.ibm.com>
+
+     * lto-function-out.c (output_tree_flags): Flags added to VAR_DECL and
+     FUNCTION_DECL.
+     * lto-tree-flags.def: Likewise.
+
 2006-05-22  Gerald Pfeifer  <gerald@pfeifer.com>

      * doc/install.texi (Configuration): Remove reference to CrossGCC
Index: lto/ChangeLog
===================================================================
--- lto/ChangeLog (revision 124762)
+++ lto/ChangeLog (working copy)
@@ -1,3 +1,8 @@
+2007-05-15  Alon Dayan  <alond@il.ibm.com>
+
+     * lto-read.c (process_flags, lto_static_init_local):
+     Read flags of VAR_DECL and FUNCTION_DECL.
+
 2007-03-14 Robert Kennedy  <jimbob@google.com>

      Eliminate use of lang_hooks.set_decl_assembler_name from LTO
Index: lto/lto-read.c
===================================================================
--- lto/lto-read.c      (revision 124739)
+++ lto/lto-read.c      (working copy)
@@ -412,6 +412,8 @@
 #define START_EXPR_CASE(code)    case code:
 #define ADD_EXPR_FLAG(flag_name) { expr->common. flag_name = (flags >>
CLEAROUT);  flags <<= 1; }
 #define ADD_DECL_FLAG(flag_name) { expr->decl_common. flag_name = flags >>
CLEAROUT; flags <<= 1; }
+#define ADD_VIS_FLAG(flag_name) { expr->decl_with_vis. flag_name = (flags
>> CLEAROUT); flags <<= 1; }
+#define ADD_FUNC_FLAG(flag_name) { expr->function_decl. flag_name = (flags
>> CLEAROUT); flags <<= 1; }
 #define END_EXPR_CASE(class)      break;
 #define END_EXPR_SWITCH()                 \
     default:                              \
@@ -430,6 +432,8 @@
 #undef START_EXPR_CASE
 #undef ADD_EXPR_FLAG
 #undef ADD_DECL_FLAG
+#undef ADD_VIS_FLAG
+#undef ADD_FUNC_FLAG
 #undef END_EXPR_CASE
 #undef END_EXPR_SWITCH
 }
@@ -1231,6 +1235,8 @@
 #define START_EXPR_CASE(code)    case code:
 #define ADD_EXPR_FLAG(flag_name)    num_flags_for_code[code]++;
 #define ADD_DECL_FLAG(flag_name)    num_flags_for_code[code]++;
+#define ADD_VIS_FLAG(flag_name)    num_flags_for_code[code]++;
+#define ADD_FUNC_FLAG(flag_name)    num_flags_for_code[code]++;
 #define END_EXPR_CASE(class)      break;
 #define END_EXPR_SWITCH()                     \
           default:                            \
@@ -1250,6 +1256,8 @@
 #undef START_EXPR_CASE
 #undef ADD_EXPR_FLAG
 #undef ADD_DECL_FLAG
+#undef ADD_VIS_FLAG
+#undef ADD_FUNC_FLAG
 #undef END_EXPR_CASE
 #undef END_EXPR_SWITCH


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]