|
@@ -214,6 +214,9 @@ interface
|
|
{ Returns True if n one of its children has a type that appears in TypeList }
|
|
{ Returns True if n one of its children has a type that appears in TypeList }
|
|
function has_node_of_type(n: TNode; TypeList: TNodeTypeSet): Boolean; {$IFDEF USEINLINE}inline;{$ENDIF USEINLINE}
|
|
function has_node_of_type(n: TNode; TypeList: TNodeTypeSet): Boolean; {$IFDEF USEINLINE}inline;{$ENDIF USEINLINE}
|
|
|
|
|
|
|
|
+ { returns true if n is guranteed not to return an ordinal zero }
|
|
|
|
+ function node_not_zero(n : tnode) : Boolean;
|
|
|
|
+
|
|
|
|
|
|
implementation
|
|
implementation
|
|
|
|
|
|
@@ -1727,4 +1730,11 @@ implementation
|
|
Result := foreachnodestatic(n, @node_in_list, @TypeList);
|
|
Result := foreachnodestatic(n, @node_in_list, @TypeList);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+
|
|
|
|
+ function node_not_zero(n: tnode): Boolean;
|
|
|
|
+ begin
|
|
|
|
+ result:=(is_constintnode(n) and (get_int_value(n)<>0)) or
|
|
|
|
+ ((n.nodetype=orn) and (node_not_zero(taddnode(n).left) or node_not_zero(taddnode(n).right)));
|
|
|
|
+ end;
|
|
|
|
+
|
|
end.
|
|
end.
|