aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2008-06-03 23:18:30 +0000
committerDiego Novillo <dnovillo@google.com>2008-06-03 23:18:30 +0000
commitcd48677ec09b5c43c576fe0b0a56cf6b82c53ef2 (patch)
tree3dc74301a258d9b629fe8e189123d319a0a18db6
parentd23ca292916702c59f18f356daec5e2c67483292 (diff)
2008-06-03 Diego Novillo <dnovillo@google.com>
* lto-function-out.c (output_tree_flags): Tidy formatting. (output_type_decl): Emit TYPE_MODE. (output_tree): Add comment. Ignore language codes. Add pointer to proper fix. * lto-function-in.c (input_type_decl): Read TYPE_MODE. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/lto-streamer@136342 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.lto9
-rw-r--r--gcc/lto-function-in.c4
-rw-r--r--gcc/lto-function-out.c35
3 files changed, 37 insertions, 11 deletions
diff --git a/gcc/ChangeLog.lto b/gcc/ChangeLog.lto
index b727e8dde3b..d4811263f17 100644
--- a/gcc/ChangeLog.lto
+++ b/gcc/ChangeLog.lto
@@ -1,3 +1,12 @@
+2008-06-03 Diego Novillo <dnovillo@google.com>
+
+ * lto-function-out.c (output_tree_flags): Tidy
+ formatting.
+ (output_type_decl): Emit TYPE_MODE.
+ (output_tree): Add comment.
+ Ignore language codes. Add pointer to proper fix.
+ * lto-function-in.c (input_type_decl): Read TYPE_MODE.
+
2008-06-02 Diego Novillo <dnovillo@google.com>
* lto-function-out.c: Do not include ctype.h.
diff --git a/gcc/lto-function-in.c b/gcc/lto-function-in.c
index 558f51f2316..56e9e7cd74c 100644
--- a/gcc/lto-function-in.c
+++ b/gcc/lto-function-in.c
@@ -2236,8 +2236,8 @@ input_type_decl (struct lto_input_block *ib, struct data_in *data_in)
decl->decl_common.attributes = input_tree (ib, data_in);
decl->decl_common.abstract_origin = input_tree (ib, data_in);
- /* omit mode */
- decl->decl_common.align = lto_input_uleb128 (ib);
+ decl->decl_common.mode = lto_input_uleb128 (ib);
+ decl->decl_common.align = lto_input_uleb128 (ib);
decl->decl_common.size = input_tree (ib, data_in);
decl->decl_common.size_unit = input_tree (ib, data_in);
diff --git a/gcc/lto-function-out.c b/gcc/lto-function-out.c
index bdf7fed30e9..b66daa207f0 100644
--- a/gcc/lto-function-out.c
+++ b/gcc/lto-function-out.c
@@ -361,9 +361,7 @@ output_integer (struct output_block *ob, tree t)
static void
-output_tree_flags (struct output_block *ob,
- enum tree_code code,
- tree expr,
+output_tree_flags (struct output_block *ob, enum tree_code code, tree expr,
bool force_loc)
{
lto_flags_type flags = 0;
@@ -407,7 +405,7 @@ output_tree_flags (struct output_block *ob,
{ 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_VIS_FLAG_SIZE(flag_name,size) \
+#define ADD_VIS_FLAG_SIZE(flag_name,size) \
{ flags <<= size; if (expr->decl_with_vis. flag_name ) flags |= expr->decl_with_vis. flag_name; }
#define ADD_FUN_FLAG(flag_name) \
{ flags <<= 1; if (expr->function_decl. flag_name ) flags |= 1; }
@@ -2439,7 +2437,7 @@ output_type_decl (struct output_block *ob, tree decl)
output_tree (ob, decl->decl_common.attributes);
output_tree (ob, decl->decl_common.abstract_origin);
- gcc_assert (decl->decl_common.mode == 0);
+ output_uleb128 (ob, decl->decl_common.mode);
output_uleb128 (ob, decl->decl_common.align);
output_tree (ob, decl->decl_common.size); /* ??? */
@@ -2658,6 +2656,9 @@ output_global_constructor (struct output_block *ob, tree ctor)
}
}
+
+/* Emit tree node EXPR to output block OB. */
+
void
output_tree (struct output_block *ob, tree expr)
{
@@ -2856,6 +2857,7 @@ output_tree (struct output_block *ob, tree expr)
output_translation_unit_decl (ob, expr);
break;
+
case LABEL_DECL:
case LABEL_EXPR:
/* ### These should occur only within a function body. */
@@ -3137,10 +3139,25 @@ output_tree (struct output_block *ob, tree expr)
case TRY_CATCH_EXPR:
case TRY_FINALLY_EXPR:
default:
- /* We cannot have forms that are not explicity handled. So when
- this is triggered, there is some form that is not being
- output. */
- gcc_unreachable ();
+ if (TREE_CODE (expr) >= NUM_TREE_CODES)
+ {
+ /* When this happens, it means that EXPR is a
+ language-specific tree node. Since these codes have no
+ meaning outside of the front-end, and in fact they cannot
+ be handled, we just ignore them. FIXME, we should really
+ abort here. These codes should not have escaped from
+ the front end. Something along the lines of
+ http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00349.html
+ should be implemented. */
+ break;
+ }
+ else
+ {
+ /* We cannot have forms that are not explicity handled. So when
+ this is triggered, there is some form that is not being
+ output. */
+ gcc_unreachable ();
+ }
}
LTO_DEBUG_UNDENT ();