aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 60416d3..66ac702 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2194,6 +2194,18 @@ max_int_size_in_bytes (const_tree type)
return size;
}
+
+/* Returns a tree for the size of EXP in bytes. */
+
+tree
+tree_expr_size (const_tree exp)
+{
+ if (DECL_P (exp)
+ && DECL_SIZE_UNIT (exp) != 0)
+ return DECL_SIZE_UNIT (exp);
+ else
+ return size_in_bytes (TREE_TYPE (exp));
+}
/* Return the bit position of FIELD, in bits from the start of the record.
This is a tree of type bitsizetype. */