diff options
Diffstat (limited to 'gcc/ada/gcc-interface/gigi.h')
-rw-r--r-- | gcc/ada/gcc-interface/gigi.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index 1d87b5be44e..2b33c13302c 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -1074,7 +1074,7 @@ maybe_vector_array (tree exp) static inline unsigned HOST_WIDE_INT ceil_pow2 (unsigned HOST_WIDE_INT x) { - return (unsigned HOST_WIDE_INT) 1 << (floor_log2 (x - 1) + 1); + return (unsigned HOST_WIDE_INT) 1 << ceil_log2 (x); } /* Return true if EXP, a CALL_EXPR, is an atomic load. */ @@ -1171,3 +1171,16 @@ maybe_debug_type (tree type) return type; } + +/* Like build_qualified_type, but TYPE_QUALS is added to the existing + qualifiers on TYPE. */ + +static inline tree +change_qualified_type (tree type, int type_quals) +{ + /* Qualifiers must be put on the associated array type. */ + if (TREE_CODE (type) == UNCONSTRAINED_ARRAY_TYPE) + return type; + + return build_qualified_type (type, TYPE_QUALS (type) | type_quals); +} |