/* sem_eval: */
#define Compile_Time_Known_Value sem_eval__compile_time_known_value
+#define Is_Null_Range sem_eval__is_null_range
extern Boolean Compile_Time_Known_Value (Node_Id);
+extern Boolean Is_Null_Range (Node_Id, Node_Id);
/* sem_util: */
return Expr_Value_R (Lo) > Expr_Value_R (Hi);
end if;
end;
+
else
- return False;
+ return Compile_Time_Compare (Lo, Hi, Assume_Valid => False) = GT;
end if;
end Is_Null_Range;
return Expr_Value_R (Lo) <= Expr_Value_R (Hi);
end if;
end;
+
else
- return False;
+ return
+ Compile_Time_Compare (Lo, Hi, Assume_Valid => False) in Compare_LE;
end if;
-
end Not_Null_Range;
-------------
-- an entity with Is_Known_Valid set, or Assume_No_Invalid_Values is True.
function Is_Null_Range (Lo : Node_Id; Hi : Node_Id) return Boolean;
- -- Returns True if it can guarantee that Lo .. Hi is a null range. If it
- -- cannot (because the value of Lo or Hi is not known at compile time) then
- -- it returns False.
+ -- Returns True if it can guarantee that Lo .. Hi is a null range
+
+ -- WARNING: There is a matching C declaration of this subprogram in fe.h
function Is_OK_Static_Expression (N : Node_Id) return Boolean;
-- An OK static expression is one that is static in the RM definition sense
-- per RM 4.9(38/2). N is a node only used to post warnings.
function Not_Null_Range (Lo : Node_Id; Hi : Node_Id) return Boolean;
- -- Returns True if it can guarantee that Lo .. Hi is not a null range. If
- -- it cannot (because the value of Lo or Hi is not known at compile time)
- -- then it returns False.
+ -- Returns True if it can guarantee that Lo .. Hi is not a null range
function Predicates_Compatible (T1, T2 : Entity_Id) return Boolean;
-- In Ada 2012, subtypes are statically compatible if the predicates are