1 2017-01-13 Gary Dismukes <dismukes@adacore.com>
3 * sem_ch13.adb: Minor reformatting and typo fix.
5 2017-01-13 Ed Schonberg <schonberg@adacore.com>
7 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
8 Iterated_Component_Association is a named association in an
10 * sem_aggr.adb (Resolve_Iterated_Component_Association): New
11 procedure, subsidiary of Resolve_Array_Aggregate, to analyze
12 and resolve the discrete choices and the expression of the
14 * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
15 Loop_Actions and Box_Present are attributes of
16 N_Iterated_Component_Association nodes. Box_Present is always
18 * sprint.adb (Sprint_Node): An Iterated_Component_Association
19 has a Discrete_Choices list, as specified in the RM. A
20 Component_Association for aggregate uses instead a Choices list.
21 We have to live with this small inconsistency because the new
22 construct also has a defining identifier, and there is no way
23 to merge the two node structures.
25 2017-01-13 Yannick Moy <moy@adacore.com>
27 * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
28 list of pragmas to remove. Remove pragmas from the list of
29 statements in the body to inline.
30 * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
32 2017-01-13 Ed Schonberg <schonberg@adacore.com>
34 * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
35 Analyze_Declarations, to analyze and resolve the expressions of
36 aspect specifications in the current declarative list, so that
37 the expressions have proper entity and type info. This is needed
38 for ASIS when there is no subsequent expansion to generate this
40 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
41 original expression, to suppress cascaded errors when expression
42 has been constant-folded.
43 (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
44 ASIS mode, because there is no subsequent expansion to decorate
47 2017-01-13 Yannick Moy <moy@adacore.com>
49 * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
50 New function to detect when a call may be inlined or not in
52 (Expand_Inlined_Call): Ensure that a temporary
53 is always created in the cases where a type conversion may be
54 needed on an input parameter in GNATprove mode, so that GNATprove
55 sees the check to perform.
56 * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
57 when not applicable due to actual requiring type conversion
58 with possible check but no temporary value can be copied for
59 GNATprove to see the check.
61 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
63 * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
64 exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
65 layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
66 exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
67 exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
68 g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
69 sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
70 prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
71 a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
72 get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
73 g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
74 sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
75 s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
76 contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
77 g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
78 g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
79 a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
80 ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
81 get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
82 prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
83 exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
84 s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
85 a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
86 a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
87 g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
88 par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
89 uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
90 a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
91 statements to reflect the new style for case alternatives. Various
92 code clean up and reformatting.
94 2017-01-13 Gary Dismukes <dismukes@adacore.com>
96 * exp_util.adb: Minor reformatting.
98 2017-01-13 Yannick Moy <moy@adacore.com>
100 * exp_spark.adb: Code cleanup.
101 * sem_ch9.adb (Analyze_Delay_Until): Resolve
102 expression so that calls are identified as such inside delay
105 2017-01-13 Ed Schonberg <schonberg@adacore.com>
107 * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
108 * par-ch3.adb (P_Discrete_Choice_List): An
109 Iterated_Component_Association is an array aggregate component.
110 * par-ch4.adb (P_Iterated_Component_Association): New procedure.
111 (Is_Quantified_Expression): New function that performs a lookahead
112 to distinguish quantified expressions from iterated component
114 (P_Aggregate_Or_Paren_Expr): Recognize iterated component
116 (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
117 * sem.adb (Analyze): Handle Iterated_Component_Association.
118 * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
119 component associations.
120 * sinfo.ads, sinfo.adb: Entries for for
121 N_Iterated_Component_Association and its fields.
122 * sprint.adb (Sprint_Node_Actual): Handle
123 N_Iterated_Component_Association.
125 2017-01-13 Justin Squirek <squirek@adacore.com>
127 * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
128 of the style check until after preanalysis of acutals.
130 2017-01-13 Yannick Moy <moy@adacore.com>
132 * sem_ch13.adb: Minor reformatting.
133 * par-ch11.adb: minor style fix in whitespace
134 * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
135 reduced to Add_Artificial_ALI_File; style fix in declaration of
136 Text; grammar fix in comment.
137 * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
138 * freeze.adb: Cleanup to pass pragma instead of
140 * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
141 replace System'To_Address by equivalent call.
143 2017-01-13 Arnaud Charlet <charlet@adacore.com>
145 * bindusg.adb: Improve usage output for -f switch.
147 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
149 * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
152 2017-01-13 Ed Schonberg <schonberg@adacore.com>
154 * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
155 treat comparisons on strings as legal in a Static_Predicate.
156 (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
157 a function call that is the expansion of a string comparison.The
158 function call is built when compiling the corresponding predicate
159 function, but the expression has been found legal as a static
160 predicate during earlier analysis.
161 * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
162 properly a function call that is the expansion of a string
163 comparison operation, in order to recover the Static_Predicate
164 expression and apply it to a static argument when needed.
166 2017-01-13 Tristan Gingold <gingold@adacore.com>
168 * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
169 (Open_Read): Re-implement using Open_Read_No_Exception.
170 (Open_Write): Raise exception in case of error.
171 * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
172 * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
174 * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
176 2017-01-13 Yannick Moy <moy@adacore.com>
178 * checks.adb: Code cleanup.
180 2017-01-13 Yannick Moy <moy@adacore.com>
182 * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
183 expression instead of unanalyzed aspect expression for checking
184 the validity of inheriting an operation. Also copy the expression
185 being passing it to Build_Class_Wide_Expression, as this call
186 modifies its argument.
187 * sem_util.ads Fix comment to reference correct function name
190 2017-01-13 Javier Miranda <miranda@adacore.com>
192 * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
193 when we propagate information about the indexes back to the original
194 indexing mode and the prefix of the index is a function call, do not
195 remove any parameter from such call.
197 2017-01-13 Gary Dismukes <dismukes@adacore.com>
199 * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
200 * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
201 a build-in-place function whose result type is tagged.
203 2017-01-13 Yannick Moy <moy@adacore.com>
205 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
206 Do not generate a wrapper when the only candidate is a class-wide
208 (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
209 inside a generic context.
211 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
213 * exp_util.adb (Add_Inherited_Tagged_DIC):
214 Pass the object parameters of both the parent and the derived
215 type DIC procedure to the reference replacement circuitry.
216 (Find_DIC_Type): Modify the circuitry to present the partial
217 view of a private type in case the private type defines its own
219 (Replace_Object_And_Primitive_References): Add two
220 optional formal parameters. Update the comment on usage. Update
221 the replacement of references to object parameters.
223 2017-01-13 Gary Dismukes <dismukes@adacore.com>
225 * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
227 2017-01-13 Ed Schonberg <schonberg@adacore.com>
229 * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
230 an out parameter that is a type conversion, independently of th
231 range check that may apply to the expression of the conversion,
232 for use in GNATProve.
234 2017-01-13 Yannick Moy <moy@adacore.com>
236 * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
237 GNATprove_Mode here to Frontend.
238 * frontend.adb (Frontend): Move the implicit with for System
239 in GNATprove_Mode here as it ismore correct this way; the old
240 place only worked by chance, since there were no overloaded names.
241 * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
242 * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
243 four attributes identified in SRM 9(18), add an implicit with
244 to Ada.Task_Identification.
245 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
246 Deal specially with the wrapper introduced for AI05-0071 in GNATprove
248 * checks.adb (Apply_Discriminant_Check,
249 Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
250 In GNATprove mode, we do not apply the checks, but we still
251 analyze the expression to possibly issue errors on SPARK
252 code when a run-time error can be detected at compile time.
253 (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
256 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
258 * expander.adb (Expand): Add a warning about using return
259 statements in Ghost management code.
260 * exp_ch3.adb (Freeze_Type): Add a warning about using return
261 statements in Ghost management code.
262 * exp_ch7.adb (Build_Invariant_Procedure_Body,
263 Build_Invariant_Procedure_Declaration): Add a warning about
264 using return statements in Ghost management code.
265 * exp_disp.adb (Make_DT): Add a warning about using return
266 statements in Ghost management code.
267 * exp_util.adb (Build_DIC_Procedure_Body,
268 Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
269 warning about using return statements in Ghost management code.
270 * freeze.adb (Freeze_Entity): Add a warning about using return
271 statements in Ghost management code.
272 * sem.adb (Analyze, Do_Analyze): Add a warning about using return
273 statements in Ghost management code.
274 * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
275 a warning about using return statements in Ghost management code.
276 * sem_ch5.adb (Analyze_Assignment): Add a warning about using
277 return statements in Ghost management code.
278 * sem_ch6.adb (Analyze_Procedure_Call,
279 Analyze_Subprogram_Body_Helper): Add a warning about using return
280 statements in Ghost management code.
281 * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
282 using return statements in Ghost management code.
283 * sem_ch12.adb (Analyze_Package_Instantiation,
284 Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
285 Instantiate_Subprogram_Body): Add a warning about using return
286 statements in Ghost management code.
287 * sem_ch13.adb (Build_Predicate_Functions,
288 Build_Predicate_Function_Declarations): Add a warning about
289 using return statements in Ghost management code.
290 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
291 Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
292 Analyze_Pre_Post_Condition_In_Decl_Part): Add a warning about
293 using return statements in Ghost management code.
295 2017-01-13 Tristan Gingold <gingold@adacore.com>
297 * s-mmosin-mingw.adb: Fix pragma import.
299 2017-01-13 Arnaud Charlet <charlet@adacore.com>
301 * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
304 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
306 * atree.adb (Allocate_Initialize_Node): A newly created node is
307 no longer marked as Ghost at this level.
308 (Mark_New_Ghost_Node): New routine.
309 (New_Copy): Mark the copy as Ghost.
310 (New_Entity): Mark the entity as Ghost.
311 (New_Node): Mark the node as Ghost.
312 * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
313 apply to unanalyzed entities.
314 (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
316 (Set_Is_Checked_Ghost_Entity): This attribute now
317 applies to all entities as well as unanalyzed entities.
318 (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
319 all entities as well as unanalyzed entities.
320 * expander.adb Add with and use clauses for Ghost.
321 (Expand): Install and revert the Ghost region associated with the node
323 * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
324 (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
325 (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
326 (Expand_Freeze_Record_Type): Remove all Ghost-related code.
327 (Freeze_Type): Install and revert the Ghost region associated
328 with the type being frozen.
329 * exp_ch5.adb Remove with and use clauses for Ghost.
330 (Expand_N_Assignment_Statement): Remove all Ghost-related code.
331 * exp_ch6.adb Remove with and use clauses for Ghost.
332 (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
333 (Expand_N_Subprogram_Body): Remove all Ghost-related code.
334 * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
335 Ghost region of the working type.
336 (Build_Invariant_Procedure_Declaration): Install and revert
337 the Ghost region of the working type.
338 (Expand_N_Package_Body): Remove all Ghost-related code.
339 * exp_ch8.adb Remove with and use clauses for Ghost.
340 (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
342 (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
343 (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
344 (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
346 * exp_ch13.adb Remove with and use clauses for Ghost.
347 (Expand_N_Freeze_Entity): Remove all Ghost-related code.
348 * exp_disp.adb (Make_DT): Install and revert the Ghost region of
349 the tagged type. Move the generation of various entities within
350 the Ghost region of the type.
351 * exp_prag.adb Remove with and use clauses for Ghost.
352 (Expand_Pragma_Check): Remove all Ghost-related code.
353 (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
354 (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
355 (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
356 * exp_util.adb (Build_DIC_Procedure_Body): Install
357 and revert the Ghost region of the working types.
358 (Build_DIC_Procedure_Declaration): Install and revert the
359 Ghost region of the working type.
360 (Make_Invariant_Call): Install and revert the Ghost region of the
362 (Make_Predicate_Call): Reimplemented. Install and revert the
363 Ghost region of the associated type.
364 * freeze.adb (Freeze_Entity): Install and revert the Ghost region
365 of the entity being frozen.
366 (New_Freeze_Node): Removed.
367 * ghost.adb Remove with and use clauses for Opt.
368 (Check_Ghost_Completion): Update the parameter profile
369 and all references to formal parameters.
370 (Ghost_Entity): Update the comment on usage.
371 (Install_Ghost_Mode): New routines.
372 (Is_Ghost_Assignment): New routine.
373 (Is_Ghost_Declaration): New routine.
374 (Is_Ghost_Pragma): New routine.
375 (Is_Ghost_Procedure_Call): New routine.
376 (Is_Ghost_Renaming): Removed.
377 (Is_OK_Declaration): Reimplemented.
378 (Is_OK_Pragma): Reimplemented.
379 (Is_OK_Statement): Reimplemented.
380 (Is_Subject_To_Ghost): Update the comment on usage.
381 (Mark_And_Set_Ghost_Assignment): New routine.
382 (Mark_And_Set_Ghost_Body): New routine.
383 (Mark_And_Set_Ghost_Completion): New routine.
384 (Mark_And_Set_Ghost_Declaration): New routine.
385 (Mark_And_Set_Ghost_Instantiation): New routine.
386 (Mark_And_Set_Ghost_Procedure_Call): New routine.
387 (Mark_Full_View_As_Ghost): Removed.
388 (Mark_Ghost_Declaration_Or_Body): New routine.
389 (Mark_Ghost_Pragma): New routine.
390 (Mark_Ghost_Renaming): New routine.
391 (Mark_Pragma_As_Ghost): Removed.
392 (Mark_Renaming_As_Ghost): Removed.
393 (Propagate_Ignored_Ghost_Code): Update the comment on usage.
394 (Prune_Node): Freeze nodes no longer need special pruning, they
395 are processed by the general ignored Ghost code mechanism.
396 (Restore_Ghost_Mode): New routine.
397 (Set_Ghost_Mode): Reimplemented.
398 (Set_Ghost_Mode_From_Entity): Removed.
399 * ghost.ads Add with and use clauses for Ghost.
400 (Check_Ghost_Completion): Update the parameter profile
401 along with the comment on usage.
402 (Install_Ghost_Mode): New routine.
403 (Is_Ghost_Assignment): New routine.
404 (Is_Ghost_Declaration): New routine.
405 (Is_Ghost_Pragma): New routine.
406 (Is_Ghost_Procedure_Call): New routine.
407 (Mark_And_Set_Ghost_Assignment): New routine.
408 (Mark_And_Set_Ghost_Body): New routine.
409 (Mark_And_Set_Ghost_Completion): New routine.
410 (Mark_And_Set_Ghost_Declaration): New routine.
411 (Mark_And_Set_Ghost_Instantiation): New routine.
412 (Mark_And_Set_Ghost_Procedure_Call): New routine.
413 (Mark_Full_View_As_Ghost): Removed.
414 (Mark_Ghost_Pragma): New routine.
415 (Mark_Ghost_Renaming): New routine.
416 (Mark_Pragma_As_Ghost): Removed.
417 (Mark_Renaming_As_Ghost): Removed.
418 (Restore_Ghost_Mode): New routine.
419 (Set_Ghost_Mode): Redefined.
420 (Set_Ghost_Mode_From_Entity): Removed.
421 * sem.adb (Analyze): Install and revert the Ghost region of the
423 (Do_Analyze): Change the way a clean Ghost
424 region is installed and reverted.
425 * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
426 all Ghost-related code.
427 (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
428 (Analyze_Number_Declaration): Remove all Ghost-related code.
429 (Analyze_Object_Declaration): Install and revert the Ghost region of
430 a deferred object declaration's completion.
431 (Array_Type_Declaration): Remove all Ghost-related code.
432 (Build_Derived_Type): Update the comment on
433 the propagation of Ghost attributes from a parent to a derived type.
434 (Derive_Subprogram): Remove all Ghost-related code.
435 (Make_Class_Wide_Type): Remove all Ghost-related code.
436 (Make_Implicit_Base): Remove all Ghost-related code.
437 (Process_Full_View): Install and revert the Ghost region of
438 the partial view. There is no longer need to check the Ghost
440 * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
441 region of the left hand side.
442 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
443 all Ghost-related code.
444 (Analyze_Expression_Function): Remove all Ghost-related code.
445 (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
446 (Analyze_Procedure_Call): Install and revert the Ghost region of
447 the procedure being called.
448 (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
449 region of the spec or body.
450 (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
451 (Build_Subprogram_Declaration): Remove all Ghost-related code.
452 (Find_Corresponding_Spec): Remove all Ghost-related code.
453 (Process_Formals): Remove all Ghost-related code.
454 * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
455 the Ghost region of the spec.
456 (Analyze_Package_Declaration): Remove all Ghost-related code.
457 * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
458 Ghost when it aliases a Ghost entity.
459 (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
461 (Analyze_Object_Renaming): Mark a renaming as Ghost when
462 it aliases a Ghost entity.
463 (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
465 (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
466 aliases a Ghost entity.
467 * sem_ch11.adb Remove with and use clauses for Ghost.
468 (Analyze_Exception_Declaration): Remove all Ghost-related code.
469 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
471 (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
473 (Analyze_Package_Instantiation): Install and revert the Ghost region
474 of the package instantiation.
475 (Analyze_Subprogram_Instantiation): Install
476 and revert the Ghost region of the subprogram instantiation.
477 (Instantiate_Package_Body): Code clean up. Install and revert the
478 Ghost region of the package body.
479 (Instantiate_Subprogram_Body): Code clean up. Install and revert the
480 Ghost region of the subprogram body.
481 * sem_ch13.adb (Build_Predicate_Functions): Install
482 and revert the Ghost region of the related type.
483 (Build_Predicate_Function_Declaration): Code clean up. Install
484 and rever the Ghost region of the related type.
485 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
486 Install and revert the Ghost region of the pragma.
487 (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
488 Ghost region of the pragma.
489 (Analyze_Pragma): Install and revert the Ghost region of various
490 pragmas. Mark a pragma as Ghost when it is related to a Ghost entity
491 or encloses a Ghost entity.
492 (Analyze_Pre_Post_Condition): Install and revert the Ghost
493 region of the pragma.
494 (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
495 Ghost region of the pragma.
496 * sem_res.adb (Resolve): Remove all Ghost-related code.
497 * sem_util.adb (Is_Declaration): Reimplemented.
498 (Is_Declaration_Other_Than_Renaming): New routine.
499 * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
500 * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
501 (Is_Ghost_Pragma): Removed.
502 (Is_Ignored_Ghost_Pragma): New routine.
503 (Set_Is_Checked_Ghost_Pragma): New routine.
504 (Set_Is_Ghost_Pragma): Removed.
505 (Set_Is_Ignored_Ghost_Pragma): New routine.
506 * sinfo.ads: Update the documentation on Ghost mode and
507 Ghost regions. New attributes Is_Checked_Ghost_Pragma
508 and Is_Ignored_Ghost_Pragma along with usages in nodes.
509 Remove attribute Is_Ghost_Pragma along with usages in nodes.
510 (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
511 (Is_Ghost_Pragma): Removed along with pragma Inline.
512 (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
513 (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
514 (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
515 (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
517 2017-01-12 Tristan Gingold <gingold@adacore.com>
519 * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
520 s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
522 2017-01-12 Yannick Moy <moy@adacore.com>
524 * errout.adb, errout.ads (Initialize): Factor common treatment
526 (Reset_Warnings): New procedure to reset counts related to warnings.
527 (Record_Compilation_Errors): New variable to store the presence of an
528 error, used in gnat2why to allow changing the Warning_Mode.
529 (Compilation_Errors): Use new variable Record_Compilation_Errors to
530 store the presence of an error.
532 2017-01-12 Javier Miranda <miranda@adacore.com>
534 * sem_ch13.adb (Analyze_Aspect_Specifications):
535 For Interrupt_Handler and Attach_ Handler aspects, decorate the
536 internally built reference to the protected procedure as coming
537 from sources and force its analysis.
539 2017-01-12 Ed Schonberg <schonberg@adacore.com>
541 * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
542 inherit predicates if any from the first_subtype of the parent,
543 not from the anonymous parent type.
544 * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
545 predicate is not a static subtype.
547 2017-01-12 Gary Dismukes <dismukes@adacore.com>
549 * freeze.adb (Check_Suspicious_Convention): New procedure
550 performing a warning check on discriminated record types with
551 convention C or C++. Factored out of procedure Freeze_Record_Type,
552 and changed to only apply to base types (to avoid spurious
553 warnings on subtypes). Minor improvement of warning messages
554 to refer to discriminated rather than variant record types.
555 (Freeze_Record_Type): Remove code for performing a suspicious
557 (Freeze_Entity): Only call Freeze_Record_Type
558 on types that aren't declared within any enclosing generic units
559 (rather than just excluding the type when the innermost scope
560 is generic). Call Check_Suspicious_Convention whether or not
561 the type is declared within a generic unit.
562 * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
563 * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
566 2017-01-12 Tristan Gingold <gingold@adacore.com>
568 * sysdep.c, adaint.c, rtinit.c, ming32.h:
569 (__gnat_current_codepage): Renamed from CurrentCodePage
570 (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
572 2017-01-12 Ed Schonberg <schonberg@adacore.com>
574 * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
575 quantified expressions, following AI12-050: the loop parameters
576 of two quantified expressions are conformant if they have the
579 2017-01-12 Arnaud Charlet <charlet@adacore.com>
581 * gcc-interface/Makefile.in: Clean up VxWorks targets.
583 2017-01-12 Ed Schonberg <schonberg@adacore.com>
585 * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
586 Hnadle properly the attribute reference when it appears as part
587 of an expression in another loop aspect.
589 2017-01-12 Ed Schonberg <schonberg@adacore.com>
591 * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
592 subsidiary of Build_Initialization_Call, to complete generation
593 of predicate checks on discriminants whose (sub)types have
594 predicates, and to add checks on variants that do not have an
596 * sem_util.adb (Gather_Components): A missing Others alternative is
597 not an error when the type of the discriminant is a static predicate
598 (and coverage has been checked when analyzing the case statement). A
599 runtime check is generated to verify that a given discriminant
600 satisfies the predicate (RM 3.8.1. (21.1/2)).
602 2017-01-12 Yannick Moy <moy@adacore.com>
604 * gnat1drv.adb (Adjust_Global_Switches): Only
605 perform checking of exception mechanism when generating code.
607 2017-01-12 Justin Squirek <squirek@adacore.com>
609 * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
610 Remove handling of access component with invariant.
611 (Build_Invariant_Procedure_Declaration): Remove return on class
613 * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
614 conditional exception for component or array so Has_Own_Invariants
615 flag is not falsly set.
616 * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
617 wide type to have no invariant flags.
619 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
621 * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
622 sem_ch13.adb: Minor reformatting.
624 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
626 * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
627 adjustment primitive when the ancestor type was not properly frozen.
628 (Gen_Assign): Guard against a missing initialization
629 primitive when the component type was not properly frozen.
630 (Initialize_Array_Component): Guard against a missing adjustment
631 primitive when the component type was not properly frozen.
632 (Initialize_Record_Component): Guard against a missing adjustment
633 primitive when the component type was not properly frozen.
634 (Process_Transient_Component_Completion): The transient object may
635 not be finalized when its associated type was not properly frozen.
636 * exp_ch3.adb (Build_Assignment): Guard against a missing
637 adjustment primitive when the component type was not properly frozen.
638 (Build_Initialization_Call): Guard against a missing
639 initialization primitive when the associated type was not properly
641 (Expand_N_Object_Declaration): Guard against a missing
642 adjustment primitive when the base type was not properly frozen.
643 (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
644 body when there is no adjustment primitive available. Create an
645 empty Deep_Finalize body when there is no finalization primitive
647 * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
648 missing finalization primitive when the designated type was
650 (Expand_N_Allocator): Guard against a missing initialization primitive
651 when the designated type was not properly frozen.
652 * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
653 only when the corresponding adjustment primitive is available.
654 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
655 adjustment/finalization statements only when there is an available
656 primitive to carry out the action.
657 (Build_Initialize_Statements): Generate the initialization/finalization
658 statements only when there is an available primitive to carry out the
660 (Make_Adjust_Call): Do not generate a call when the underlying
661 type is not present due to a possible missing full view.
662 (Make_Final_Call): Do not generate a call when the underlying
663 type is not present due to a possible missing full view.
664 (Make_Finalize_Address_Stmts): Generate an empty body when the
665 designated type lacks a finalization primitive.
666 (Make_Init_Call): Do not generate a call when the underlying type is
667 not present due to a possible missing full view.
668 (Process_Component_For_Adjust): Add the adjustment call only when the
669 corresponding adjustment primitive is available.
670 (Process_Component_For_Finalize): Add the finalization call only when
671 the corresponding finalization primitive is available.
672 (Process_Object_Declaration): Use a null statement to emulate a
673 missing call to the finalization primitive of the object type.
674 * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
675 (Make_Final_Call): Update the comment on usage.
676 (Make_Init_Call): Update the comment on usage.
677 * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
679 2017-01-12 Arnaud Charlet <charlet@adacore.com>
681 * einfo.ads: Update documentation of Address_Taken.
682 * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
683 [Access_Attribute]): Only consider 'Access/'Unchecked_Access
684 for subprograms when setting Address_Taken flag.
686 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
688 * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
689 Configurable_Run_Time_Mode off when analysing with'ed predefined
692 2017-01-12 Gary Dismukes <dismukes@adacore.com>
694 * sem_prag.adb: Minor reformatting.
695 * sem_util.adb (Unique_Entity): fix result for
696 bodies of entry families.
698 2017-01-12 Justin Squirek <squirek@adacore.com>
700 * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
701 Resolve_Suppressible in the pragma Assertion_Policy case.
702 (Resolve_Suppressible): Created this function to factor out
703 common code used to resolve Suppress to either Ignore or Check
704 * snames.ads-tmpl: Add name for Suppressible.
706 2017-01-12 Gary Dismukes <dismukes@adacore.com>
708 * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
710 * debug.adb: Minor comment fixes.
712 2017-01-12 Arnaud Charlet <charlet@adacore.com>
714 * sem_util.adb (Unique_Entity): For concurrent
715 bodies that are defined with stubs and complete a declaration
716 of a single concurrent object return the entity of an implicit
717 concurrent type, not the entity of the anonymous concurrent
719 * debug.adb: -gnatd.J is no longer used.
720 * make.adb (Globalize): Removed, no longer used.
721 * sem_ch9.adb: minor typo in comment for entry index
723 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
725 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
726 * exp_ch3.adb (Build_Init_Statements): As part of initialising
727 the value record of a task, set its _Secondary_Stack_Size field
729 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
730 a _Secondary_Stack_Size field in the value record of
731 the task if a Secondary_Stack_Size rep item is present.
732 (Make_Task_Create_Call): Include secondary stack size
733 parameter. If No_Secondary_Stack restriction is in place, passes
735 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
736 Secondary_Stack_Size.
737 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
738 function to define the overhead of the secondary stack.
739 * s-tarest.adb (Create_Restricted_Task,
740 Create_Restricted_Task_Sequential): Functions now include
741 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
742 * s-tarest.adb (Create_Restricted_Task,
743 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
744 include Secondary_Stack_Size parameter.
745 (Task_Wrapper): Secondary stack now allocated to the size specified by
746 the Secondary_Stack_Size parameter in the task's ATCB.
747 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
748 Secondary_Stack_Size component.
749 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
750 Create_Restricted_Task_Sequential): Function now include
751 Secondary_Stack_Size parameter.
752 (Task_Wrapper): Secondary stack now allocated to the size
753 specified by the Secondary_Stack_Size parameter in the task's
755 * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
756 to include Secondary_Stack_Size parameter.
757 * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
758 Secondary_Stack_Size aspect, turning the aspect into its corresponding
760 (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
761 * snames.adb-tmpl, snames.ads-tmpl: Added names
762 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
763 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
765 2017-01-12 Yannick Moy <moy@adacore.com>
767 * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
770 2017-01-12 Justin Squirek <squirek@adacore.com>
772 * exp_attr.adb (Expand_N_Attribute_Reference):
773 Fix Finalization_Size case by properly resolving the type after
776 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
778 * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
780 (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
781 * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
782 exp_sel.ads: Minor reformatting.
784 2017-01-12 Justin Squirek <squirek@adacore.com>
786 * exp_ch6.adb (Expand_Call): Add guard to prevent
787 invariant checks from being created for internally generated
790 2017-01-12 Bob Duff <duff@adacore.com>
792 * lib-writ.ads: Remove incorrect comment.
794 2017-01-12 Javier Miranda <miranda@adacore.com>
796 * debug.adb (-gnatd.K): Enable generation of contract-only
797 procedures in CodePeer mode.
798 * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
800 (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
802 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
804 (Get_Contract_Only_Missing_Body_Name): New subprogram.
805 (Get_Contract_Only_Body): New subprogram.
806 (Set_Contract_Only_Body): New subprogram.
807 (Is_Contract_Only_Body): New subprogram.
808 (Set_Is_Contract_Only_Body): New subprogram.
809 (SCIL_Nodes): Replace table by hash-table.
811 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
813 * exp_ch6.adb: Minor reformatting.
814 * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
816 2017-01-12 Bob Duff <duff@adacore.com>
818 * binde.adb (Forced): New reason for a dependence.
819 (Force_Elab_Order): Implementation of the new switch.
820 * binde.ads: Minor comment fixes.
821 * bindusg.adb: Add -f switch. Apparently, there was an -f switch
822 long ago that is no longer supported; removed comment about that.
823 * opt.ads (Force_Elab_Order_File): Name of file specified for
825 * switch-b.adb: Parse -f switch.
827 2017-01-12 Justin Squirek <squirek@adacore.com>
829 * exp_ch6.adb (Check_View_Conversion): Created this function
830 to properly chain calls to check type invariants that may be
831 present in a subprogram call after the subprogram.
832 (Expand_Call): Add a conditional to identify when a view conversion
834 * nlists.adb, nlists.ads (Prepend_New): New routine.
835 (Prepend_New_To): New routine.
837 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
839 * sinfo.ads: Minor reformatting.
841 2017-01-12 Gary Dismukes <dismukes@adacore.com>
843 * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
846 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
848 * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
849 variable Definite. Create a local object and pass its 'Access to the
850 BIP function when the result type is either definite or it does not
851 require any finalization or secondary stack management.
853 2017-01-12 Bob Duff <duff@adacore.com>
855 * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
856 exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
857 frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
858 par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
859 sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
860 sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
861 sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
862 sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
863 Change name to Pragma_Name_Unmapped.
864 (Pragma_Name_Mapped): Change name to Pragma_Name.
865 This is because the "mapped" version should be the usual case.
867 2017-01-09 Hristian Kirtchev <kirtchev@adacore.com>
869 * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
870 Is_Default_Init_Cond_Procedure, and
871 Has_Inherited_Default_Init_Cond. Add uses of flags
872 Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
873 (Default_Init_Cond_Procedure): Removed.
874 (DIC_Procedure): New routine.
875 (Has_Default_Init_Cond): Removed.
876 (Has_DIC): New routine.
877 (Has_Inheritable_Invariants): The attribute applies to the base type.
878 (Has_Inherited_Default_Init_Cond): Removed.
879 (Has_Inherited_DIC): New routine.
880 (Has_Inherited_Invariants): The attribute applies to the base type.
881 (Has_Own_DIC): New routine.
882 (Has_Own_Invariants): The attribute applies to the base type.
883 (Is_Default_Init_Cond_Procedure): Removed.
884 (Is_DIC_Procedure): New routine.
885 (Set_Default_Init_Cond_Procedure): Removed.
886 (Set_DIC_Procedure): New routine.
887 (Set_Has_Default_Init_Cond): Removed.
888 (Set_Has_Inheritable_Invariants): The attribute applies
890 (Set_Has_Inherited_Default_Init_Cond): Removed.
891 (Set_Has_Inherited_DIC): New routine.
892 (Set_Has_Inherited_Invariants): The attribute applies to the base type.
893 (Set_Has_Own_DIC): New routine.
894 (Set_Has_Own_Invariants): The attribute applies to the base type.
895 (Set_Is_Default_Init_Cond_Procedure): Removed.
896 (Set_Is_DIC_Procedure): New routine.
897 (Write_Entity_Flags): Update the output of all flags related to
898 default initial condition.
899 * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
900 of the call to the DIC procedure.
901 (Freeze_Type): Generate the body of the DIC procedure.
902 * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
903 all occurrences of Create_Append with Append_New_To. Do
904 not generate an invariant procedure for a class-wide type.
905 The generated body acts as a freeze action of the working type.
906 (Build_Invariant_Procedure_Declaration): Do not generate an
907 invariant procedure for a class-wide type.
908 (Create_Append): Removed.
909 * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
910 sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
911 class-wide pre/postcondition description and data structures from
913 (Build_Class_Wide_Expression): Moved from Sem_Prag.
914 (Build_DIC_Call): New routine.
915 (Build_DIC_Procedure_Body): New routine.
916 (Build_DIC_Procedure_Declaration): New routine.
917 (Entity_Hash): Moved from Sem_Prag.
918 (Find_DIC_Type): New routine.
919 (Update_Primitives_Mapping): Reimplemented.
920 (Update_Primitives_Mapping_Of_Types): New routine.
921 * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
922 (Build_DIC_Call): New routine.
923 (Build_DIC_Procedure_Body): New routine.
924 (Build_DIC_Procedure_Declaration): New routine.
925 (Update_Primitives_Mapping): Moved from Sem_Prag.
926 (Update_Primitives_Mapping_Of_Types): New routine.
927 * nlists.adb (Append_New): New routine.
928 (Append_New_To): New routine.
929 * nlists.ads (Append_New): New routine.
930 (Append_New_To): New routine.
931 * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
932 of DIC procedures here. This is now done at the end of the
933 visible declarations, private declarations, and at the freeze
935 (Analyze_Private_Extension_Declaration):
936 A private extension inherits the DIC pragma of a parent type.
937 (Analyze_Subtype_Declaration): No need to propagate invariant
938 attributes to a subtype as those apply to the base type.
939 (Build_Derived_Record_Type): No need to inherit invariants here
940 as this is now done in Build_Derived_Type.
941 (Build_Derived_Type): Inherit both the DIC pragma and invariants from
943 (Process_Full_View): Update the propagation of DIC attributes.
944 (Propagate_Default_Init_Cond_Attributes): Removed.
945 * sem_ch7.adb Add with and use clauses for Exp_Util.
946 (Analyze_Package_Specification): Create the body of the DIC
947 procedure at the end of the visible and private declarations.
948 (Preserve_Full_Attributes): Propagate DIC attributes.
949 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
951 (Analyze_Task_Type_Declaration): Propagate DIC attributes.
952 * sem_elab.adb (Check_A_Call): Update the call to
953 Is_Nontrivial_Default_Init_Cond_Procedure.
954 * sem_prag.adb Remove the with and use clauses for
955 GNAT.HTable. Move the handling of class- wide pre/postcondition
956 description and data structures to Exp_Util.
957 (Analyze_Pragma): Create the declaration of the DIC procedure. There
958 is no need to propagate invariant-related attributes at this point
959 as this is done in Build_Invariant_Procedure_Declaration.
960 (Build_Class_Wide_Expression): Moved to Exp_Util.
961 (Entity_Hash): Moved to Exp_Util.
962 (Update_Primitives_Mapping): Moved to Exp_Util.
963 * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
964 (Update_Primitives_Mapping): Moved to Exp_Util.
965 * sem_util.adb: Remove with and use clauses for Ghost
967 (Build_Default_Init_Cond_Call): Removed.
968 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
969 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
970 (Get_Views): Reimplemented.
971 (Has_Full_Default_Initialization): Reimplement the section on DIC.
972 (Inherit_Default_Init_Cond_Procedure): Removed.
973 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
974 (Is_Nontrivial_DIC_Procedure): New routine.
975 (Is_Verifiable_DIC_Pragma): New routine.
976 (Propagate_DIC_Attributes): New routine.
977 * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
978 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
979 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
980 (Inherit_Default_Init_Cond_Procedure): Removed.
981 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
982 (Is_Nontrivial_DIC_Procedure): New routine.
983 (Is_Verifiable_DIC_Pragma): New routine.
984 (Propagate_DIC_Attributes): New routine.
985 * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
987 * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
989 (Expression_Copy): New routine along with pragma Inline.
990 (Set_Expression_Copy): New routine along with pragma Inline.
992 2017-01-06 Bob Duff <duff@adacore.com>
994 * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
995 "Bind_Main_Program" to "not Bind_For_Library", because otherwise
996 we won't generate the call to s_stalib_adafinal when the main
997 is not written in Ada.
999 2017-01-06 Bob Duff <duff@adacore.com>
1001 * sem_prag.adb: Minor: remove pragma Warnings.
1003 2017-01-06 Tristan Gingold <gingold@adacore.com>
1005 * Makefile.rtl: Do not compile s-stchop by default.
1007 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
1009 * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
1010 sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
1011 snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
1012 s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
1013 Reverted previous change for now.
1015 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1017 * exp_ch3.adb (Build_Initialization_Call): Apply predicate
1018 check to default discriminant value if checks are enabled.
1019 (Build_Assignment): If type of component has static predicate,
1020 apply check to its default value, if any.
1022 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
1024 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
1025 * exp_ch3.adb (Build_Init_Statements): As part of initialising
1026 the value record of a task, set its _Secondary_Stack_Size field
1028 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
1029 a _Secondary_Stack_Size field in the value record of
1030 the task if a Secondary_Stack_Size rep item is present.
1031 (Make_Task_Create_Call): Include secondary stack size
1032 parameter. If No_Secondary_Stack restriction is in place, passes
1034 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
1035 Secondary_Stack_Size.
1036 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
1037 function to define the overhead of the secondary stack.
1038 * s-tarest.adb (Create_Restricted_Task,
1039 Create_Restricted_Task_Sequential): Functions now include
1040 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
1041 * s-tarest.adb (Create_Restricted_Task,
1042 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
1043 now include Secondary_Stack_Size parameter.
1045 Secondary stack now allocated to the size specified by the
1046 Secondary_Stack_Size parameter in the task's ATCB.
1047 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
1048 Secondary_Stack_Size component.
1049 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
1050 Create_Restricted_Task_Sequential): Function now include
1051 Secondary_Stack_Size parameter.
1052 (Task_Wrapper): Secondary stack
1053 now allocated to the size specified by the Secondary_Stack_Size
1054 parameter in the task's ATCB.
1055 * sem_ch13.adb (Analyze_Aspect_Specification): Add support
1056 for Secondary_Stack_Size aspect, turning the aspect into its
1057 corresponding internal attribute.
1058 (Analyze_Attribute_Definition):
1059 Process Secondary_Stack_Size attribute.
1060 * snames.adb-tmpl, snames.ads-tmpl: Added names
1061 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
1062 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
1064 2017-01-06 Pascal Obry <obry@adacore.com>
1066 * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
1067 Sequential_IO and Direct_IO.
1069 2017-01-06 Bob Duff <duff@adacore.com>
1071 * snames.ads-tmpl (Renamed): New name for the pragma argument.
1072 * par-ch2.adb: Allow the new pragma (with analysis deferred
1074 * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
1075 Keep a mapping from new pragma names to old names.
1076 * sem_prag.adb: Check legality of pragma Rename_Pragma, and
1077 implement it by calling Map_Pragma_Name.
1078 * checks.adb, contracts.adb, einfo.adb, errout.adb,
1079 * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
1080 * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
1081 * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
1082 * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
1083 * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
1084 * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
1087 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1089 * exp_ch9.adb: Minor reformatting.
1091 2017-01-06 Tristan Gingold <gingold@adacore.com>
1093 * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
1094 * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
1095 (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
1097 * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
1098 Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
1099 * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
1100 Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
1102 2017-01-06 Bob Duff <duff@adacore.com>
1104 * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
1105 dummy implementation of Map_Pragma_Name.
1107 2017-01-06 Tristan Gingold <gingold@adacore.com>
1109 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
1110 entry_body variable constant.
1111 * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
1112 * s-tpoben.ads (Protected_Entry_Body_Access): Now access
1114 * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
1115 now access to constant.
1117 2017-01-06 Gary Dismukes <dismukes@adacore.com>
1119 * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
1120 reformatting and typo fixes.
1122 2017-01-06 Bob Duff <duff@adacore.com>
1124 * snames.ads-tmpl: New names for pragma renaming.
1125 * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
1126 * par-prag.adb: Add new pragma name to case statement.
1127 * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
1129 * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
1130 Dummy implementation of Pragma_Name_Mapped.
1132 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1134 * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
1135 better detect call within an entry_wrapper.
1136 * sem_res.adb (Resolve_Call): A protected call within an
1137 entity_wrapper is analyzed in the context of the protected
1138 object but corresponds to a pre-analysis and is not an access
1140 * sem_attr.adb: Minor reformatting.
1142 2017-01-06 Justin Squirek <squirek@adacore.com>
1144 * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
1145 Finalization_Size to allow a prefix of any non-class-wide type.
1146 * sem_attr.ads Modify comment for Finalization_Size to include
1147 definite type use case.
1149 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1151 * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
1152 on procedures that are wrappers created for entries that have
1154 * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
1155 body is an entry_wrapper, compile it in the context of the
1156 synchronized type, because a precondition may refer to funtions
1158 * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
1160 * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
1161 within an Entry_Wrapper this is an external call whose target
1162 is the synchronized object that is the actual in the call to
1165 2017-01-06 Yannick Moy <moy@adacore.com>
1167 * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
1168 in tree, which means not analyzing the previous prefix if the node has
1169 been rewritten into its prefix.
1171 2017-01-06 Gary Dismukes <dismukes@adacore.com>
1173 * s-tpobop.adb: Minor reformatting.
1175 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1177 * checks.adb (Ensure_Valid): Do not generate a validity check
1178 within a generated predicate function, validity checks will have
1179 been applied earlier when required.
1181 2017-01-06 Tristan Gingold <gingold@adacore.com>
1183 * s-tpoben.ads (Protection_Entries): Add comment and reorder
1184 components for performances.
1185 * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
1188 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1190 * sem_eval.adb (Check_Expression_Against_Static_Predicate):
1191 If expression is compile-time known and obeys a static predicate
1192 it must be labelled as static, to prevent spurious warnings and
1193 run-time errors, e.g. in case statements. This is relevant when
1194 the expression is the result of constant-folding a type conversion
1195 whose expression is a variable with a known static value.
1197 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1199 * exp_attr.adb, sem_attr.ads: Minor reformatting.
1201 2017-01-06 Justin Squirek <squirek@adacore.com>
1203 * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
1204 expansion of Finalization_Size attribute.
1205 * sem_attr.adb (Analyze_Attribute): Add entry to check the
1206 semantics of Finalization_Size.
1207 (Eval_Attribute): Add null entry for Finalization_Size.
1208 * sem_attr.ads: Add Finalization_Size to the implementation
1209 dependent attribute list.
1210 * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
1212 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1214 * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
1215 iterator specification with a serious syntactic error, transform
1216 construct into an infinite loop in order to continue analysis
1217 and prevent a compiler abort.
1219 2017-01-06 Tristan Gingold <gingold@adacore.com>
1221 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
1222 max_queue_lengths_array if unused.
1224 2017-01-06 Bob Duff <duff@adacore.com>
1226 * errout.adb (Set_Msg_Text): Protect against out-of-bounds
1227 array access, in case "\" is at the end of Text.
1228 * stylesw.adb (Set_Style_Check_Options): Don't include input
1229 characters in the error message template, because they could
1230 be control characters such as "\", which Errout will try to
1233 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1235 * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
1236 For a private type examine the visible declarations that follow
1237 the partial view, not just the private declarations that follow
1240 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1242 * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
1245 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1247 * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
1248 alias of the inherited op is the parent iterator, no need to
1249 examine dispatch table positions which might not be established
1250 yet if type is not frozen.
1251 * sem_disp.adb (Check_Controlling_Formals): The formal of a
1252 predicate function may be a subtype of a tagged type.
1253 * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
1254 of representation items for the completion of a type extension
1255 where a predicate applies to the partial view.
1256 * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
1257 parameter that designates function whose actual receives a
1258 predicate check, to improve warning message when the check will
1259 lead to infinite recursion.
1260 * sem_res.adb (Resolve_Actuals): Pass additional parameter to
1261 Apply_Predicate_Check.
1263 2017-01-06 Tristan Gingold <gingold@adacore.com>
1265 * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
1266 Gnat_Extended_Ravenscar.
1267 * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
1269 2017-01-06 Gary Dismukes <dismukes@adacore.com>
1271 * sem_util.ads: Minor typo fix and reformatting.
1273 2017-01-06 Yannick Moy <moy@adacore.com>
1275 * ghost.adb Minor fixing of references to SPARK RM.
1276 (Check_Ghost_Context): Check whether reference is to a lvalue
1277 before issuing an error about violation of SPARK RM 6.9(13)
1278 when declaration has Ghost policy Check and reference has Ghost
1280 * sem_util.adb Minor indentation.
1281 * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
1282 Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
1283 * sem_util.ads (Unique_Defining_Entity): Document the result
1284 for package body stubs.
1286 2017-01-06 Tristan Gingold <gingold@adacore.com>
1288 * raise-gcc.c (abort): Macro to call Abort_Propagation.
1289 * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
1291 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
1292 Do not generate the Entry_Max_Queue_Lengths_Array if all default
1294 * exp_util.adb (Corresponding_Runtime_Package): Consider
1295 Max_Queue_Length pragma.
1297 2017-01-06 Justin Squirek <squirek@adacore.com>
1299 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
1300 Remove declaration generation in the case of
1301 System_Tasking_Protected_Objects_Single_Entry being used,
1302 and add a warning message when this is detected to occur.
1303 (Make_Initialize_Protection): Remove reference pass in the case
1304 of System_Tasking_Protected_Objects_Single_Entry.
1305 * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
1306 * s-tposen.adb (Initialize_Protection_Entry): Remove
1307 Entry_Queue_Max parameter.
1308 * s-tposen.ads: Remove the types use to store the entry queue
1310 * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
1312 2017-01-06 Yannick Moy <moy@adacore.com>
1314 * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
1315 behavior of function, to also accept out of range positions
1316 and raise Constraint_Error in such case, and to copy sloc from
1317 literal if No_Location passed as location.
1318 * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
1319 of functions to raise Constraint_Error in case of value not in
1322 2017-01-06 Tristan Gingold <gingold@adacore.com>
1324 * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
1325 Invalidate_Stack_Cache.
1327 2017-01-06 Eric Botcazou <ebotcazou@adacore.com>
1329 * s-os_lib.adb: Minor fix to the signature of Readlink.
1331 2017-01-06 Javier Miranda <miranda@adacore.com>
1333 * sem_ch6.adb (Conforming_Types): Handle another
1334 confusion between views in a nested instance with an actual
1335 private type whose full view is not in scope.
1337 2017-01-06 Arnaud Charlet <charlet@adacore.com>
1339 * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
1340 mark a rewritten if statement as explicit (Comes_From_Source).
1342 2017-01-06 Gary Dismukes <dismukes@adacore.com>
1344 * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
1346 2017-01-06 Tristan Gingold <gingold@adacore.com>
1348 * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
1350 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1352 * sem_case.adb: Minor reformatting.
1354 2017-01-06 Thomas Quinot <quinot@adacore.com>
1356 * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
1358 2017-01-06 Justin Squirek <squirek@adacore.com>
1360 * aspects.adb: Register aspect in Canonical_Aspect.
1361 * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
1362 into respective tables.
1363 * einfo.ads, einfo.adb: Add a new attribute for
1364 handling the parameters for Pragma_Max_Entry_Queue
1365 (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
1366 for accessing and setting were added as well.
1367 * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
1368 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
1369 declaration for pramga arguments and store them in the protected
1371 (Make_Initialize_Protection): Pass a reference to
1372 the Entry_Max_Queue_Lengths_Array in the protected type node to
1374 * rtsfind.adb: Minor grammar fix.
1375 * rtsfind.ads: Register new types taken from the
1376 runtime libraries RE_Protected_Entry_Queue_Max and
1377 RE_Protected_Entry_Queue_Max_Array
1378 * s-tposen.adb, s-tpoben.adb
1379 (Initialize_Protection_Entry/Initialize_Protection_Entries):
1380 Add extra parameter and add assignment to local object.
1381 * s-tposen.ads, s-tpoben.ads: Add new types to
1382 store entry queue maximums and a field to the entry object record.
1383 * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
1384 for Aspect_Max_Queue_Length.
1385 (Check_Aspect_At_Freeze_Point):
1386 Add aspect to list of aspects that don't require delayed analysis.
1387 * sem_prag.adb (Analyze_Pragma): Add case statement for
1388 Pragma_Max_Queue_Length, check semantics, and register arugments
1389 in the respective entry nodes.
1390 * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
1391 and Has_Max_Queue_Length
1392 * snames.ads-tmpl: Add constant for the new aspect-name
1393 Name_Max_Queue_Length and corrasponding pragma.
1395 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1397 * exp_util.adb (Is_Controlled_Function_Call):
1398 Reimplemented. Consider any node which has an entity as the
1399 function call may appear in various ways.
1401 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1403 * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
1404 an unchecked type conversion when performing a view conversion
1405 to/from a private type. In all other cases use a regular type
1406 conversion to ensure that any relevant checks are properly
1409 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1411 * sem_prag.adb, sem_ch8.adb: Minor reformatting.
1413 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1415 * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
1416 error on case expression that is an entity, when coverage is
1417 incomplete and entity has a static value obtained by local
1419 (Handle_Static_Predicate): New procedure, subsidiary of
1420 Check_Choices, to handle case alternatives that are either
1421 subtype names or subtype indications involving subtypes that
1422 have static predicates.
1424 2017-01-06 Thomas Quinot <quinot@adacore.com>
1426 * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
1427 (GNAT.Socket): Add support for Busy_Polling and Generic_Option
1429 2017-01-06 Bob Duff <duff@adacore.com>
1431 * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
1432 Elaborate_All(P) to P itself. That could happen in obscure cases,
1433 and always introduced a cycle (P body must be elaborated before
1435 * lib-writ.ads: Comment clarification.
1436 * ali-util.ads: Minor comment fix.
1437 * ali.adb: Minor reformatting.
1439 2017-01-06 Tristan Gingold <gingold@adacore.com>
1441 * a-exexpr-gcc.adb: Improve comment.
1443 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
1445 * s-linux-mips.ads: Use correct signal and errno constants.
1446 (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
1448 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
1450 * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
1451 * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
1454 2017-01-01 Eric Botcazou <ebotcazou@adacore.com>
1456 * gnatvsn.ads: Bump copyright year.
1458 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1460 * gnat_ugn.texi: Bump @copying's copyright year.
1461 * gnat_rm.texi: Likewise.
1463 Copyright (C) 2017 Free Software Foundation, Inc.
1465 Copying and distribution of this file, with or without modification,
1466 are permitted in any medium without royalty provided the copyright
1467 notice and this notice are preserved.