aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 139c276..820431f 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -5323,6 +5323,15 @@ ptrofftype_p (tree type)
&& TYPE_UNSIGNED (type) == TYPE_UNSIGNED (sizetype));
}
+/* Return OFF converted to a pointer offset type suitable as offset for
+ POINTER_PLUS_EXPR. Use location LOC for this conversion. */
+static inline tree
+convert_to_ptrofftype_loc (location_t loc, tree off)
+{
+ return fold_convert_loc (loc, sizetype, off);
+}
+#define convert_to_ptrofftype(t) convert_to_ptrofftype_loc (UNKNOWN_LOCATION, t)
+
/* Build and fold a POINTER_PLUS_EXPR at LOC offsetting PTR by OFF. */
static inline tree
fold_build_pointer_plus_loc (location_t loc, tree ptr, tree off)