ソースを参照

+ added defutil.is_nativesint and is_nativeuint

git-svn-id: branches/i8086@24167 -
nickysn 12 年 前
コミット
d88855566a
1 ファイル変更17 行追加0 行削除
  1. 17 0
      compiler/defutil.pas

+ 17 - 0
compiler/defutil.pas

@@ -261,6 +261,12 @@ interface
     { true, if def is an ordinal type, equal in size to the processor's native int size }
     { true, if def is an ordinal type, equal in size to the processor's native int size }
     function is_nativeord(def : tdef) : boolean;
     function is_nativeord(def : tdef) : boolean;
 
 
+    { true, if def is an unsigned int type, equal in size to the processor's native int size }
+    function is_nativeuint(def : tdef) : boolean;
+
+    { true, if def is a signed int type, equal in size to the processor's native int size }
+    function is_nativesint(def : tdef) : boolean;
+
     {# If @var(l) isn't in the range of todef a range check error (if not explicit) is generated and
     {# If @var(l) isn't in the range of todef a range check error (if not explicit) is generated and
       the value is placed within the range
       the value is placed within the range
     }
     }
@@ -922,6 +928,17 @@ implementation
 {$endif}
 {$endif}
       end;
       end;
 
 
+    { true, if def is an unsigned int type, equal in size to the processor's native int size }
+    function is_nativeuint(def: tdef): boolean;
+      begin
+         result:=is_nativeint(def) and (def.typ=orddef) and (torddef(def).ordtype in [u64bit,u32bit,u16bit,u8bit]);
+      end;
+
+    { true, if def is a signed int type, equal in size to the processor's native int size }
+    function is_nativesint(def: tdef): boolean;
+      begin
+         result:=is_nativeint(def) and (def.typ=orddef) and (torddef(def).ordtype in [s64bit,s32bit,s16bit,s8bit]);
+      end;
 
 
     { if l isn't in the range of todef a range check error (if not explicit) is generated and
     { if l isn't in the range of todef a range check error (if not explicit) is generated and
       the value is placed within the range }
       the value is placed within the range }