-- operations for constructing patterns that can be used in the pattern
-- matching operations provided.
- type Boolean_Func is access function return Boolean;
+ type Boolean_Func is access function return Boolean with Favor_Top_Level;
-- General Boolean function type. When this type is used as a formal
-- parameter type in this package, it indicates a deferred predicate
-- pattern. The function will be called when the pattern element is
-- matched and failure signalled if False is returned.
- type Natural_Func is access function return Natural;
+ type Natural_Func is access function return Natural with Favor_Top_Level;
-- General Natural function type. When this type is used as a formal
-- parameter type in this package, it indicates a deferred pattern.
-- The function will be called when the pattern element is matched
-- to obtain the currently referenced Natural value.
- type VString_Func is access function return VString;
+ type VString_Func is access function return VString with Favor_Top_Level;
-- General VString function type. When this type is used as a formal
-- parameter type in this package, it indicates a deferred pattern.
-- The function will be called when the pattern element is matched
Set_No_Strict_Aliasing (Implementation_Base_Type (Target));
end if;
+ -- If the unchecked conversion is between Address and an access
+ -- subprogram type, show that we shouldn't use an internal
+ -- representation for the access subprogram type.
+
+ if Is_Access_Subprogram_Type (Target)
+ and then Is_Descendant_Of_Address (Source)
+ and then In_Same_Source_Unit (Target, N)
+ then
+ Set_Can_Use_Internal_Rep (Target, False);
+ elsif Is_Access_Subprogram_Type (Source)
+ and then Is_Descendant_Of_Address (Target)
+ and then In_Same_Source_Unit (Source, N)
+ then
+ Set_Can_Use_Internal_Rep (Source, False);
+ end if;
+
-- Generate N_Validate_Unchecked_Conversion node for back end in case
-- the back end needs to perform special validation checks.