@@ -407,7 +407,7 @@ package body Tree_Walk is
407
407
408
408
procedure Declare_Itype (Ty : Entity_Id) is
409
409
begin
410
- if Is_Itype (Ty) then
410
+ if Present (Ty) and then Is_Itype (Ty) then
411
411
declare
412
412
Ty_Name : constant Symbol_Id := Intern (Unique_Name (Ty));
413
413
Ty_Symbol : Symbol;
@@ -2128,6 +2128,8 @@ package body Tree_Walk is
2128
2128
-- Handle pragmas that suppress some checks by explicitly ignoring them
2129
2129
procedure Do_Pragma_Suppress
2130
2130
(N_Orig : Node_Id);
2131
+ procedure Do_Pragma_Refine
2132
+ (N_Orig : Node_Id);
2131
2133
2132
2134
procedure Do_Pragma_Assert_or_Assume
2133
2135
(N_Orig : Node_Id; Block : Irep)
@@ -2227,6 +2229,54 @@ package body Tree_Walk is
2227
2229
2228
2230
end Do_Pragma_Suppress ;
2229
2231
2232
+ procedure Do_Pragma_Refine
2233
+ (N_Orig : Node_Id)
2234
+ is
2235
+ -- To be set by iterator:
2236
+ Components : List_Id;
2237
+ Component_Expression : Node_Id;
2238
+ CEE : List_Id;
2239
+ Scope_Size : Nat;
2240
+
2241
+ -- --------------
2242
+ -- Handle_Arg --
2243
+ -- --------------
2244
+
2245
+ procedure Handle_Arg
2246
+ (Arg_Pos : Positive; Arg_Name : Name_Id; Expr : Node_Id);
2247
+
2248
+ procedure Handle_Arg
2249
+ (Arg_Pos : Positive; Arg_Name : Name_Id; Expr : Node_Id) is
2250
+ begin
2251
+
2252
+ if Arg_Name = No_Name and then
2253
+ Arg_Pos = 1 and then
2254
+ Nkind (Expr) = N_Aggregate
2255
+ then
2256
+ Components := Component_Associations (Expr);
2257
+ Component_Expression := Expression (First (Components));
2258
+ CEE := Expressions (Component_Expression);
2259
+ Scope_Size := List_Length (CEE);
2260
+ else
2261
+ Report_Unhandled_Node_Empty (N, " Do_Pragma_Suppress" ,
2262
+ " Unknown arg name" );
2263
+ end if ;
2264
+ end Handle_Arg ;
2265
+
2266
+ procedure Iterate_Args is new
2267
+ Iterate_Pragma_Parameters (Handle_Arg => Handle_Arg);
2268
+
2269
+ begin
2270
+ Iterate_Args (N_Orig);
2271
+ if Scope_Size > 1
2272
+ then
2273
+ null ; -- Intentionally ignoring this request to suppress all checks
2274
+ else
2275
+ null ; -- Intentionally ignoring supressing some checks
2276
+ end if ;
2277
+
2278
+ end Do_Pragma_Refine ;
2279
+
2230
2280
N_Orig : Node_Id;
2231
2281
2232
2282
begin
@@ -2241,8 +2291,11 @@ package body Tree_Walk is
2241
2291
when Name_Annotate =>
2242
2292
-- Ignore here. Rather look for those when we process a node.
2243
2293
null ;
2294
+ when Name_Refined_State | Name_Refined_Global |
2295
+ Name_Refined_Depends =>
2296
+ Do_Pragma_Refine (N_Orig);
2244
2297
when Name_SPARK_Mode | Name_Global | Name_Postcondition |
2245
- Name_Refined_State | Name_Refined_Global | Name_Precondition =>
2298
+ Name_Precondition =>
2246
2299
-- These pragmas are currently unimplemented
2247
2300
Report_Unhandled_Node_Empty (N, " Do_Pragma" ,
2248
2301
" Unsupported pragma" );
0 commit comments