aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/method.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r--gcc/cp/method.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 4e22a20..c1da08b 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -221,7 +221,8 @@ thunk_adjust (tree ptr, bool this_adjusting,
{
if (this_adjusting)
/* Adjust the pointer by the constant. */
- ptr = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (ptr), ptr,
+ ptr = fold_build2_loc (input_location,
+ POINTER_PLUS_EXPR, TREE_TYPE (ptr), ptr,
size_int (fixed_offset));
/* If there's a virtual offset, look up that value in the vtable and
@@ -239,18 +240,21 @@ thunk_adjust (tree ptr, bool this_adjusting,
/* Form the vtable address. */
vtable = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (vtable)), vtable);
/* Find the entry with the vcall offset. */
- vtable = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (vtable), vtable,
- fold_convert (sizetype, virtual_offset));
+ vtable = fold_build2_loc (input_location,
+ POINTER_PLUS_EXPR, TREE_TYPE (vtable), vtable,
+ fold_convert (sizetype, virtual_offset));
/* Get the offset itself. */
vtable = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (vtable)), vtable);
/* Adjust the `this' pointer. */
- ptr = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (ptr), ptr,
+ ptr = fold_build2_loc (input_location,
+ POINTER_PLUS_EXPR, TREE_TYPE (ptr), ptr,
fold_convert (sizetype, vtable));
}
if (!this_adjusting)
/* Adjust the pointer by the constant. */
- ptr = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (ptr), ptr,
+ ptr = fold_build2_loc (input_location,
+ POINTER_PLUS_EXPR, TREE_TYPE (ptr), ptr,
size_int (fixed_offset));
return ptr;