Browse Source

+ codeptruinttype/codeptrsinttype that has the same size as
voidcodepointertype

git-svn-id: trunk@32470 -

Jonas Maebe 9 years ago
parent
commit
2504a0ce6c
2 changed files with 22 additions and 0 deletions
  1. 19 0
      compiler/psystem.pas
  2. 3 0
      compiler/symdef.pas

+ 19 - 0
compiler/psystem.pas

@@ -163,6 +163,25 @@ implementation
         voidcodepointertype:=voidpointertype;
         voidstackpointertype:=voidpointertype;
 {$endif i8086}
+        case voidcodepointertype.size of
+          2:
+            begin
+              codeptruinttype:=u16inttype;
+              codeptrsinttype:=s16inttype;
+            end;
+          4:
+            begin
+              codeptruinttype:=u32inttype;
+              codeptrsinttype:=s32inttype;
+            end;
+          8:
+            begin
+              codeptruinttype:=u64inttype;
+              codeptrsinttype:=s64inttype;
+            end;
+          else
+            Internalerror(2015112106);
+        end;
       end;
 
     procedure create_intern_types;

+ 3 - 0
compiler/symdef.pas

@@ -1065,6 +1065,9 @@ interface
        { unsigned and signed ord type with the same size as a pointer }
        ptruinttype,
        ptrsinttype,
+       { unsigned and signed ord type with the same size as a codepointer }
+       codeptruinttype,
+       codeptrsinttype,
        { several types to simulate more or less C++ objects for GDB }
        vmttype,
        vmtarraytype,