diff options
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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. */ |