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