mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 12:19:30 +02:00
+ added an unsigned counterpart to tpointerdef.pointer_arithmetic_it_type (needed by inc/dec)
git-svn-id: trunk@34653 -
This commit is contained in:
parent
95eb4ed2eb
commit
35b0201002
@ -59,6 +59,7 @@ type
|
||||
class function default_x86_data_pointer_type: tx86pointertyp; override;
|
||||
function alignment:shortint;override;
|
||||
function pointer_arithmetic_int_type:tdef; override;
|
||||
function pointer_arithmetic_uint_type:tdef; override;
|
||||
function pointer_subtraction_result_type:tdef; override;
|
||||
function converted_pointer_to_array_range_type: tdef; override;
|
||||
end;
|
||||
@ -441,6 +442,26 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
function tcpupointerdef.pointer_arithmetic_uint_type:tdef;
|
||||
begin
|
||||
case x86pointertyp of
|
||||
x86pt_huge:
|
||||
result:=u32inttype;
|
||||
x86pt_far,
|
||||
x86pt_near,
|
||||
x86pt_near_cs,
|
||||
x86pt_near_ds,
|
||||
x86pt_near_ss,
|
||||
x86pt_near_es,
|
||||
x86pt_near_fs,
|
||||
x86pt_near_gs:
|
||||
result:=u16inttype;
|
||||
else
|
||||
internalerror(2016100403);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
function tcpupointerdef.pointer_subtraction_result_type:tdef;
|
||||
begin
|
||||
case x86pointertyp of
|
||||
|
@ -255,6 +255,8 @@ interface
|
||||
Normally, this is sinttype, except on i8086, where it takes into account the
|
||||
special i8086 pointer types (near, far, huge). }
|
||||
function pointer_arithmetic_int_type:tdef;virtual;
|
||||
{# the unsigned version of pointer_arithmetic_int_type. Used with inc/dec. }
|
||||
function pointer_arithmetic_uint_type:tdef;virtual;
|
||||
{# returns the int type produced when subtracting two pointers of the given type.
|
||||
Normally, this is sinttype, except on i8086, where it takes into account the
|
||||
special i8086 pointer types (near, far, huge). }
|
||||
@ -3376,6 +3378,12 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
function tpointerdef.pointer_arithmetic_uint_type:tdef;
|
||||
begin
|
||||
result:=ptruinttype;
|
||||
end;
|
||||
|
||||
|
||||
function tpointerdef.pointer_subtraction_result_type:tdef;
|
||||
begin
|
||||
result:=ptrsinttype;
|
||||
|
Loading…
Reference in New Issue
Block a user