1d6b5c95869ad1e7c70022daac4c3cd5c917d860
[gcc.git] / gcc / ada / ChangeLog
1 2017-01-13 Arnaud Charlet <charlet@adacore.com>
2
3 * doc/gnat_ugn/getting_started_with_gnat.rst,
4 doc/gnat_ugn/inline_assembler.rst,
5 doc/gnat_ugn/building_executable_programs_with_gnat.rst,
6 doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
7 doc/gnat_ugn/about_this_guide.rst,
8 doc/gnat_ugn/platform_specific_information.rst,
9 doc/gnat_ugn/example_of_binder_output.rst,
10 doc/gnat_ugn/gnat_and_program_execution.rst,
11 doc/gnat_ugn/gnat_utility_programs.rst,
12 doc/gnat_ugn/the_gnat_compilation_model.rst,
13 doc/gnat_rm/implementation_defined_attributes.rst,
14 doc/gnat_rm/compatibility_and_porting_guide.rst,
15 doc/gnat_rm/standard_library_routines.rst,
16 doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
17 doc/gnat_rm/implementation_defined_pragmas.rst,
18 doc/gnat_rm/the_gnat_library.rst,
19 doc/gnat_rm/obsolescent_features.rst,
20 doc/gnat_rm/about_this_guide.rst,
21 doc/gnat_rm/the_implementation_of_standard_i_o.rst,
22 doc/gnat_rm/implementation_of_ada_2012_features.rst,
23 doc/gnat_rm/interfacing_to_other_languages.rst,
24 doc/gnat_rm/implementation_defined_aspects.rst,
25 doc/gnat_rm.rst: Update documentation.
26 * gnat_rm.texi, gnat_ugn.texi: Regenerated.
27
28 2017-01-13 Ed Schonberg <schonberg@adacore.com>
29
30 * einfo.ads: minor grammar fixes in comment of Normalized_Position_Max.
31 * scil_ll.adb: Minor style fix in comment.
32 * sem_ch8.adb (Analyze_Expanded_Name): Perform dimension analysis
33 even if entity is already set, because the node may be renalyzed
34 after inlining transformations.
35
36 2017-01-13 Javier Miranda <miranda@adacore.com>
37
38 * sem_res.adb (Resolve_Call): Do not establish a transient scope
39 for a call to inlinable expression function (since the call will
40 be replaced by its returned object).
41 * exp_ch6.ads (Is_Inlinable_Expression_Function): New subprogram.
42 * exp_ch6.adb (Expression_Of_Expression_Function): New subprogram.
43 (Expand_Call): For inlinable expression function call replace the
44 call by its returned object.
45 (Is_Inlinable_Expression_Function): New subprogram.
46
47 2017-01-13 Gary Dismukes <dismukes@adacore.com>
48
49 * checks.adb: Minor typo fix and reformatting.
50
51 2017-01-13 Javier Miranda <miranda@adacore.com>
52
53 * contracts.adb (Contract_Only_Subprograms): Remove formal.
54 (Copy_Original_Specification): Removed.
55 (Skip_Contract_Only_Subprogram): Move here checks previously
56 located in the caller of this routine (to leave the code more clean).
57 (Build_Contract_Only_Subprogram): Code cleanup.
58 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
59 (Get_Contract_Only_Missing_Body_Name): Removed.
60
61 2017-01-13 Javier Miranda <miranda@adacore.com>
62
63 * sem_ch6.adb (Cloned_Expression): New subprogram.
64 (Freeze_Expr_Types): Complete previous patch since the expression
65 of an expression-function may have iterators and loops with
66 defining identifiers which, as part of the preanalysis of the
67 expression, may be left decorated with itypes that will not be
68 available in the tree passed to the backend.
69
70 2017-01-13 Ed Schonberg <schonberg@adacore.com>
71
72 * checks.adb (Apply_Type_Conversion_Checks): Optimize a type
73 conversion to Integer of an expression that is an attribute
74 reference 'Pos on an enumeration type.
75
76 2017-01-13 Bob Duff <duff@adacore.com>
77
78 * atree.ads: Minor comment fix.
79
80 2017-01-13 Justin Squirek <squirek@adacore.com>
81
82 * sem_ch6.adb (Check_Aggregate_Accessibility): Ignore function
83 calls in accessibility check on return statement.
84
85 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
86
87 * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
88 Ensure that the input body is a subprogram body before trying to
89 determine whether it denoted an expression function. Note that
90 subprogram body stubs cannot denote expression functions.
91
92 2017-01-13 Gary Dismukes <dismukes@adacore.com>
93
94 * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
95 and typo fixes.
96
97 2017-01-13 Javier Miranda <miranda@adacore.com>
98
99 * einfo.ads (Component_Bit_Offset): Fix documentation.
100 * sem_ch13.adb (Check_Record_Representation_Clause): Skip check
101 on record holes for components with unknown compile-time offsets.
102
103 2017-01-13 Bob Duff <duff@adacore.com>
104
105 * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag.
106 * g-locfil.ads: Minor comment fix.
107
108 2017-01-13 Bob Duff <duff@adacore.com>
109
110 * binde.adb (Elab_New): New elaboration order algorithm
111 that is expected to cause fewer ABE issues. This is a work in
112 progress. The new algorithm is currently disabled, and can be
113 enable by the -dp switch, or by modifying the Do_Old and Do_New
114 etc. flags and rebuilding. Experimental code is included to
115 compare the results of the old and new algorithms.
116 * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we
117 can have multiple of these tables, so the old and new algorithms
118 can coexist.
119 * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in'
120 parameter of type array. This avoids the global variable, and
121 allows bounds checking (which is normally defeated by the tables
122 packages). It also ensures that the Elab_Order is read-only
123 to Bindgen.
124 * bindgen.adb: Pass Elab_Order as an 'in' parameter to all
125 subprograms that need it, as above.
126 * debug.adb: Document new -dp switch. Modify doc of old -do
127 switch.
128 * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde
129 and Bindgen. Move writing of closure (-R and -Ra switches)
130 to Binde; that's more convenient.
131
132 2017-01-13 Ed Schonberg <schonberg@adacore.com>
133
134 * sem_ch6.adb (Analyze_Expression_Function): If the expression
135 function is a completion, all entities referenced in the
136 expression are frozen. As a consequence, a reference to an
137 uncompleted private type from an enclosing scope is illegal.
138
139 2017-01-13 Javier Miranda <miranda@adacore.com>
140
141 * sem_ch6.adb (Freeze_Expr_Types): New subprogram.
142 (Analyze_Subprogram_Body_Helper): At the occurrence of an
143 expression function declaration that is a completion, its
144 expression causes freezing (AI12-0103).
145
146 2017-01-13 Vadim Godunko <godunko@adacore.com>
147
148 * a-coinho-shared.adb: Fix memory leaks in Constant_Reference and
149 Reference functions of Ada.Containers.Indefinite_Holders.
150
151 2017-01-13 Bob Duff <duff@adacore.com>
152
153 * s-os_lib.ads: Minor comment fixes.
154
155 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
156
157 * exp_ch3.adb (Default_Initialize_Object): Do not default
158 initialize an object when it is of a task type and restriction
159 No_Tasking is in effect because the initialization is obsolete.
160 * exp_ch9.adb (Build_Master_Entity): Do not generate a master when
161 restriction No_Tasking is in effect.
162 (Build_Master_Renaming): Do not rename a master when restriction
163 No_Tasking is in effect.
164
165 2017-01-13 Ed Schonberg <schonberg@adacore.com>
166
167 * sem_aggr.adb (Resolve_Array_Aggregate): The code that verifies
168 the legality of An others clause applies as well to a choice in
169 an Iterated_component_ association.
170 (Resolve_Iterated_Component_Association): An others choice
171 is legal.
172 * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): An
173 Iterated_Component_Association is not static.
174
175 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
176
177 * exp_ch3.adb (Freeze_Type): Mark the Ghost mode as set in case
178 control is passed to the expresion handler before the new mode
179 is set.
180 * sem_ch12.adb (Analyze_Package_Instantiation,
181 Analyze_Subprogram_Instantiation): Mark the Ghost mode as set
182 in case control is passed to the expresion handler before the
183 new mode is set.
184
185 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
186
187 * sem_aggr.adb, sem_ch3.adb, inline.adb, sem_util.adb, exp_ch4.adb,
188 exp_aggr.adb: Minor reformatting.
189
190 2017-01-13 Gary Dismukes <dismukes@adacore.com>
191
192 * inline.adb: Minor reformatting and typo fix.
193
194 2017-01-13 Ed Schonberg <schonberg@adacore.com>
195
196 * sem_util.ads, sem_util.adb (Choice_List): Move function here
197 from sem_aggr.adb, for use elsewhere.
198 * sem_ch3.adb (Analyze_Object_Declaration): Use Choice_List.
199 * sem_aggr.adb (Resolve_Array_Aggregate): Remove
200 Iterated_Component_Present.
201 * exp_aggr.adb: Use Choice_List throughout, to handle
202 Iterated_Component_Associations.
203 (Gen_Loop): Generate proper loop for an
204 Iterated_Component_Association: loop variable has the identifier
205 of the original association. Generate a loop even for a single
206 component choice, in order to make loop parameter visible in
207 expression.
208 (Flatten): An Iterated_Component_Association is not static.
209
210 2017-01-13 Yannick Moy <moy@adacore.com>
211
212 * exp_ch4.adb (Expand_N_Op_Expon): Ensure that the value of
213 float exponentiation for statically known small negative values
214 is the reciprocal of the exponentiation for the opposite value
215 of the exponent.
216 * s-exnllf.adb (Exn_Float, Exn_Long_Float, Exn_Long_Long_Float):
217 Ensure that the value of float exponentiation for negative values
218 is the reciprocal of the exponentiation for the opposite value
219 of the exponent.
220 * inline.adb (Expand_Inlined_Call): Fix the count
221 for the number of generated gotos.
222
223 2017-01-13 Yannick Moy <moy@adacore.com>
224
225 * inline.adb: Code cleanup.
226 * sem_util.adb (Is_OK_Volatile_Context): Add
227 expression in delay statement as OK for volatile context.
228
229 2017-01-13 Ed Schonberg <schonberg@adacore.com>
230
231 * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
232 mode a choice that is a subtype with a static predicate is
233 replaced by the values it covers. This transformation must not
234 be performed in ASIS mode, to preserve the source for analysis.
235
236 2017-01-13 Justin Squirek <squirek@adacore.com>
237
238 * nlists.ads: Correct minor typo.
239
240 2017-01-13 Gary Dismukes <dismukes@adacore.com>
241
242 * sem_ch13.adb: Minor reformatting and typo fix.
243
244 2017-01-13 Ed Schonberg <schonberg@adacore.com>
245
246 * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
247 Iterated_Component_Association is a named association in an
248 array aggregate.
249 * sem_aggr.adb (Resolve_Iterated_Component_Association): New
250 procedure, subsidiary of Resolve_Array_Aggregate, to analyze
251 and resolve the discrete choices and the expression of the
252 new construct.
253 * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
254 Loop_Actions and Box_Present are attributes of
255 N_Iterated_Component_Association nodes. Box_Present is always
256 False in this case.
257 * sprint.adb (Sprint_Node): An Iterated_Component_Association
258 has a Discrete_Choices list, as specified in the RM. A
259 Component_Association for aggregate uses instead a Choices list.
260 We have to live with this small inconsistency because the new
261 construct also has a defining identifier, and there is no way
262 to merge the two node structures.
263
264 2017-01-13 Yannick Moy <moy@adacore.com>
265
266 * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
267 list of pragmas to remove. Remove pragmas from the list of
268 statements in the body to inline.
269 * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
270
271 2017-01-13 Ed Schonberg <schonberg@adacore.com>
272
273 * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
274 Analyze_Declarations, to analyze and resolve the expressions of
275 aspect specifications in the current declarative list, so that
276 the expressions have proper entity and type info. This is needed
277 for ASIS when there is no subsequent expansion to generate this
278 semantic information.
279 * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
280 original expression, to suppress cascaded errors when expression
281 has been constant-folded.
282 (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
283 ASIS mode, because there is no subsequent expansion to decorate
284 the tree.
285
286 2017-01-13 Yannick Moy <moy@adacore.com>
287
288 * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
289 New function to detect when a call may be inlined or not in
290 GNATprove mode.
291 (Expand_Inlined_Call): Ensure that a temporary
292 is always created in the cases where a type conversion may be
293 needed on an input parameter in GNATprove mode, so that GNATprove
294 sees the check to perform.
295 * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
296 when not applicable due to actual requiring type conversion
297 with possible check but no temporary value can be copied for
298 GNATprove to see the check.
299
300 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
301
302 * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
303 exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
304 layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
305 exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
306 exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
307 g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
308 sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
309 prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
310 a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
311 get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
312 g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
313 sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
314 s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
315 contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
316 g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
317 g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
318 a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
319 ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
320 get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
321 prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
322 exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
323 s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
324 a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
325 a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
326 g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
327 par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
328 uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
329 a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
330 statements to reflect the new style for case alternatives. Various
331 code clean up and reformatting.
332
333 2017-01-13 Gary Dismukes <dismukes@adacore.com>
334
335 * exp_util.adb: Minor reformatting.
336
337 2017-01-13 Yannick Moy <moy@adacore.com>
338
339 * exp_spark.adb: Code cleanup.
340 * sem_ch9.adb (Analyze_Delay_Until): Resolve
341 expression so that calls are identified as such inside delay
342 until.
343
344 2017-01-13 Ed Schonberg <schonberg@adacore.com>
345
346 * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
347 * par-ch3.adb (P_Discrete_Choice_List): An
348 Iterated_Component_Association is an array aggregate component.
349 * par-ch4.adb (P_Iterated_Component_Association): New procedure.
350 (Is_Quantified_Expression): New function that performs a lookahead
351 to distinguish quantified expressions from iterated component
352 associations.
353 (P_Aggregate_Or_Paren_Expr): Recognize iterated component
354 associations.
355 (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
356 * sem.adb (Analyze): Handle Iterated_Component_Association.
357 * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
358 component associations.
359 * sinfo.ads, sinfo.adb: Entries for for
360 N_Iterated_Component_Association and its fields.
361 * sprint.adb (Sprint_Node_Actual): Handle
362 N_Iterated_Component_Association.
363
364 2017-01-13 Justin Squirek <squirek@adacore.com>
365
366 * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
367 of the style check until after preanalysis of acutals.
368
369 2017-01-13 Yannick Moy <moy@adacore.com>
370
371 * sem_ch13.adb: Minor reformatting.
372 * par-ch11.adb: minor style fix in whitespace
373 * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
374 reduced to Add_Artificial_ALI_File; style fix in declaration of
375 Text; grammar fix in comment.
376 * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
377 * freeze.adb: Cleanup to pass pragma instead of
378 expression to call.
379 * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
380 replace System'To_Address by equivalent call.
381
382 2017-01-13 Arnaud Charlet <charlet@adacore.com>
383
384 * bindusg.adb: Improve usage output for -f switch.
385
386 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
387
388 * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
389 Minor reformatting.
390
391 2017-01-13 Ed Schonberg <schonberg@adacore.com>
392
393 * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
394 treat comparisons on strings as legal in a Static_Predicate.
395 (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
396 a function call that is the expansion of a string comparison.The
397 function call is built when compiling the corresponding predicate
398 function, but the expression has been found legal as a static
399 predicate during earlier analysis.
400 * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
401 properly a function call that is the expansion of a string
402 comparison operation, in order to recover the Static_Predicate
403 expression and apply it to a static argument when needed.
404
405 2017-01-13 Tristan Gingold <gingold@adacore.com>
406
407 * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
408 (Open_Read): Re-implement using Open_Read_No_Exception.
409 (Open_Write): Raise exception in case of error.
410 * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
411 * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
412 reaise exception.
413 * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
414
415 2017-01-13 Yannick Moy <moy@adacore.com>
416
417 * checks.adb: Code cleanup.
418
419 2017-01-13 Yannick Moy <moy@adacore.com>
420
421 * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
422 expression instead of unanalyzed aspect expression for checking
423 the validity of inheriting an operation. Also copy the expression
424 being passing it to Build_Class_Wide_Expression, as this call
425 modifies its argument.
426 * sem_util.ads Fix comment to reference correct function name
427 New_Copy_Tree.
428
429 2017-01-13 Javier Miranda <miranda@adacore.com>
430
431 * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
432 when we propagate information about the indexes back to the original
433 indexing mode and the prefix of the index is a function call, do not
434 remove any parameter from such call.
435
436 2017-01-13 Gary Dismukes <dismukes@adacore.com>
437
438 * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
439 * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
440 a build-in-place function whose result type is tagged.
441
442 2017-01-13 Yannick Moy <moy@adacore.com>
443
444 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
445 Do not generate a wrapper when the only candidate is a class-wide
446 subprogram.
447 (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
448 inside a generic context.
449
450 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
451
452 * exp_util.adb (Add_Inherited_Tagged_DIC):
453 Pass the object parameters of both the parent and the derived
454 type DIC procedure to the reference replacement circuitry.
455 (Find_DIC_Type): Modify the circuitry to present the partial
456 view of a private type in case the private type defines its own
457 DIC pragma.
458 (Replace_Object_And_Primitive_References): Add two
459 optional formal parameters. Update the comment on usage. Update
460 the replacement of references to object parameters.
461
462 2017-01-13 Gary Dismukes <dismukes@adacore.com>
463
464 * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
465
466 2017-01-13 Ed Schonberg <schonberg@adacore.com>
467
468 * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
469 an out parameter that is a type conversion, independently of th
470 range check that may apply to the expression of the conversion,
471 for use in GNATProve.
472
473 2017-01-13 Yannick Moy <moy@adacore.com>
474
475 * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
476 GNATprove_Mode here to Frontend.
477 * frontend.adb (Frontend): Move the implicit with for System
478 in GNATprove_Mode here as it ismore correct this way; the old
479 place only worked by chance, since there were no overloaded names.
480 * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
481 * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
482 four attributes identified in SRM 9(18), add an implicit with
483 to Ada.Task_Identification.
484 * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
485 Deal specially with the wrapper introduced for AI05-0071 in GNATprove
486 mode.
487 * checks.adb (Apply_Discriminant_Check,
488 Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
489 In GNATprove mode, we do not apply the checks, but we still
490 analyze the expression to possibly issue errors on SPARK
491 code when a run-time error can be detected at compile time.
492 (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
493 in GNATprove mode.
494
495 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
496
497 * expander.adb (Expand): Add a warning about using return
498 statements in Ghost management code.
499 * exp_ch3.adb (Freeze_Type): Add a warning about using return
500 statements in Ghost management code.
501 * exp_ch7.adb (Build_Invariant_Procedure_Body,
502 Build_Invariant_Procedure_Declaration): Add a warning about
503 using return statements in Ghost management code.
504 * exp_disp.adb (Make_DT): Add a warning about using return
505 statements in Ghost management code.
506 * exp_util.adb (Build_DIC_Procedure_Body,
507 Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
508 warning about using return statements in Ghost management code.
509 * freeze.adb (Freeze_Entity): Add a warning about using return
510 statements in Ghost management code.
511 * sem.adb (Analyze, Do_Analyze): Add a warning about using return
512 statements in Ghost management code.
513 * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
514 a warning about using return statements in Ghost management code.
515 * sem_ch5.adb (Analyze_Assignment): Add a warning about using
516 return statements in Ghost management code.
517 * sem_ch6.adb (Analyze_Procedure_Call,
518 Analyze_Subprogram_Body_Helper): Add a warning about using return
519 statements in Ghost management code.
520 * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
521 using return statements in Ghost management code.
522 * sem_ch12.adb (Analyze_Package_Instantiation,
523 Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
524 Instantiate_Subprogram_Body): Add a warning about using return
525 statements in Ghost management code.
526 * sem_ch13.adb (Build_Predicate_Functions,
527 Build_Predicate_Function_Declarations): Add a warning about
528 using return statements in Ghost management code.
529 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
530 Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
531 Analyze_Pre_Post_Condition_In_Decl_Part): Add a warning about
532 using return statements in Ghost management code.
533
534 2017-01-13 Tristan Gingold <gingold@adacore.com>
535
536 * s-mmosin-mingw.adb: Fix pragma import.
537
538 2017-01-13 Arnaud Charlet <charlet@adacore.com>
539
540 * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
541 codepeer mode.
542
543 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
544
545 * atree.adb (Allocate_Initialize_Node): A newly created node is
546 no longer marked as Ghost at this level.
547 (Mark_New_Ghost_Node): New routine.
548 (New_Copy): Mark the copy as Ghost.
549 (New_Entity): Mark the entity as Ghost.
550 (New_Node): Mark the node as Ghost.
551 * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
552 apply to unanalyzed entities.
553 (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
554 entities.
555 (Set_Is_Checked_Ghost_Entity): This attribute now
556 applies to all entities as well as unanalyzed entities.
557 (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
558 all entities as well as unanalyzed entities.
559 * expander.adb Add with and use clauses for Ghost.
560 (Expand): Install and revert the Ghost region associated with the node
561 being expanded.
562 * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
563 (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
564 (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
565 (Expand_Freeze_Record_Type): Remove all Ghost-related code.
566 (Freeze_Type): Install and revert the Ghost region associated
567 with the type being frozen.
568 * exp_ch5.adb Remove with and use clauses for Ghost.
569 (Expand_N_Assignment_Statement): Remove all Ghost-related code.
570 * exp_ch6.adb Remove with and use clauses for Ghost.
571 (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
572 (Expand_N_Subprogram_Body): Remove all Ghost-related code.
573 * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
574 Ghost region of the working type.
575 (Build_Invariant_Procedure_Declaration): Install and revert
576 the Ghost region of the working type.
577 (Expand_N_Package_Body): Remove all Ghost-related code.
578 * exp_ch8.adb Remove with and use clauses for Ghost.
579 (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
580 code.
581 (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
582 (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
583 (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
584 code.
585 * exp_ch13.adb Remove with and use clauses for Ghost.
586 (Expand_N_Freeze_Entity): Remove all Ghost-related code.
587 * exp_disp.adb (Make_DT): Install and revert the Ghost region of
588 the tagged type. Move the generation of various entities within
589 the Ghost region of the type.
590 * exp_prag.adb Remove with and use clauses for Ghost.
591 (Expand_Pragma_Check): Remove all Ghost-related code.
592 (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
593 (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
594 (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
595 * exp_util.adb (Build_DIC_Procedure_Body): Install
596 and revert the Ghost region of the working types.
597 (Build_DIC_Procedure_Declaration): Install and revert the
598 Ghost region of the working type.
599 (Make_Invariant_Call): Install and revert the Ghost region of the
600 associated type.
601 (Make_Predicate_Call): Reimplemented. Install and revert the
602 Ghost region of the associated type.
603 * freeze.adb (Freeze_Entity): Install and revert the Ghost region
604 of the entity being frozen.
605 (New_Freeze_Node): Removed.
606 * ghost.adb Remove with and use clauses for Opt.
607 (Check_Ghost_Completion): Update the parameter profile
608 and all references to formal parameters.
609 (Ghost_Entity): Update the comment on usage.
610 (Install_Ghost_Mode): New routines.
611 (Is_Ghost_Assignment): New routine.
612 (Is_Ghost_Declaration): New routine.
613 (Is_Ghost_Pragma): New routine.
614 (Is_Ghost_Procedure_Call): New routine.
615 (Is_Ghost_Renaming): Removed.
616 (Is_OK_Declaration): Reimplemented.
617 (Is_OK_Pragma): Reimplemented.
618 (Is_OK_Statement): Reimplemented.
619 (Is_Subject_To_Ghost): Update the comment on usage.
620 (Mark_And_Set_Ghost_Assignment): New routine.
621 (Mark_And_Set_Ghost_Body): New routine.
622 (Mark_And_Set_Ghost_Completion): New routine.
623 (Mark_And_Set_Ghost_Declaration): New routine.
624 (Mark_And_Set_Ghost_Instantiation): New routine.
625 (Mark_And_Set_Ghost_Procedure_Call): New routine.
626 (Mark_Full_View_As_Ghost): Removed.
627 (Mark_Ghost_Declaration_Or_Body): New routine.
628 (Mark_Ghost_Pragma): New routine.
629 (Mark_Ghost_Renaming): New routine.
630 (Mark_Pragma_As_Ghost): Removed.
631 (Mark_Renaming_As_Ghost): Removed.
632 (Propagate_Ignored_Ghost_Code): Update the comment on usage.
633 (Prune_Node): Freeze nodes no longer need special pruning, they
634 are processed by the general ignored Ghost code mechanism.
635 (Restore_Ghost_Mode): New routine.
636 (Set_Ghost_Mode): Reimplemented.
637 (Set_Ghost_Mode_From_Entity): Removed.
638 * ghost.ads Add with and use clauses for Ghost.
639 (Check_Ghost_Completion): Update the parameter profile
640 along with the comment on usage.
641 (Install_Ghost_Mode): New routine.
642 (Is_Ghost_Assignment): New routine.
643 (Is_Ghost_Declaration): New routine.
644 (Is_Ghost_Pragma): New routine.
645 (Is_Ghost_Procedure_Call): New routine.
646 (Mark_And_Set_Ghost_Assignment): New routine.
647 (Mark_And_Set_Ghost_Body): New routine.
648 (Mark_And_Set_Ghost_Completion): New routine.
649 (Mark_And_Set_Ghost_Declaration): New routine.
650 (Mark_And_Set_Ghost_Instantiation): New routine.
651 (Mark_And_Set_Ghost_Procedure_Call): New routine.
652 (Mark_Full_View_As_Ghost): Removed.
653 (Mark_Ghost_Pragma): New routine.
654 (Mark_Ghost_Renaming): New routine.
655 (Mark_Pragma_As_Ghost): Removed.
656 (Mark_Renaming_As_Ghost): Removed.
657 (Restore_Ghost_Mode): New routine.
658 (Set_Ghost_Mode): Redefined.
659 (Set_Ghost_Mode_From_Entity): Removed.
660 * sem.adb (Analyze): Install and revert the Ghost region of the
661 node being analyzed.
662 (Do_Analyze): Change the way a clean Ghost
663 region is installed and reverted.
664 * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
665 all Ghost-related code.
666 (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
667 (Analyze_Number_Declaration): Remove all Ghost-related code.
668 (Analyze_Object_Declaration): Install and revert the Ghost region of
669 a deferred object declaration's completion.
670 (Array_Type_Declaration): Remove all Ghost-related code.
671 (Build_Derived_Type): Update the comment on
672 the propagation of Ghost attributes from a parent to a derived type.
673 (Derive_Subprogram): Remove all Ghost-related code.
674 (Make_Class_Wide_Type): Remove all Ghost-related code.
675 (Make_Implicit_Base): Remove all Ghost-related code.
676 (Process_Full_View): Install and revert the Ghost region of
677 the partial view. There is no longer need to check the Ghost
678 completion here.
679 * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
680 region of the left hand side.
681 * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
682 all Ghost-related code.
683 (Analyze_Expression_Function): Remove all Ghost-related code.
684 (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
685 (Analyze_Procedure_Call): Install and revert the Ghost region of
686 the procedure being called.
687 (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
688 region of the spec or body.
689 (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
690 (Build_Subprogram_Declaration): Remove all Ghost-related code.
691 (Find_Corresponding_Spec): Remove all Ghost-related code.
692 (Process_Formals): Remove all Ghost-related code.
693 * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
694 the Ghost region of the spec.
695 (Analyze_Package_Declaration): Remove all Ghost-related code.
696 * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
697 Ghost when it aliases a Ghost entity.
698 (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
699 a Ghost entity.
700 (Analyze_Object_Renaming): Mark a renaming as Ghost when
701 it aliases a Ghost entity.
702 (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
703 a Ghost entity.
704 (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
705 aliases a Ghost entity.
706 * sem_ch11.adb Remove with and use clauses for Ghost.
707 (Analyze_Exception_Declaration): Remove all Ghost-related code.
708 * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
709 Ghost-related code.
710 (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
711 code.
712 (Analyze_Package_Instantiation): Install and revert the Ghost region
713 of the package instantiation.
714 (Analyze_Subprogram_Instantiation): Install
715 and revert the Ghost region of the subprogram instantiation.
716 (Instantiate_Package_Body): Code clean up. Install and revert the
717 Ghost region of the package body.
718 (Instantiate_Subprogram_Body): Code clean up. Install and revert the
719 Ghost region of the subprogram body.
720 * sem_ch13.adb (Build_Predicate_Functions): Install
721 and revert the Ghost region of the related type.
722 (Build_Predicate_Function_Declaration): Code clean up. Install
723 and rever the Ghost region of the related type.
724 * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
725 Install and revert the Ghost region of the pragma.
726 (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
727 Ghost region of the pragma.
728 (Analyze_Pragma): Install and revert the Ghost region of various
729 pragmas. Mark a pragma as Ghost when it is related to a Ghost entity
730 or encloses a Ghost entity.
731 (Analyze_Pre_Post_Condition): Install and revert the Ghost
732 region of the pragma.
733 (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
734 Ghost region of the pragma.
735 * sem_res.adb (Resolve): Remove all Ghost-related code.
736 * sem_util.adb (Is_Declaration): Reimplemented.
737 (Is_Declaration_Other_Than_Renaming): New routine.
738 * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
739 * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
740 (Is_Ghost_Pragma): Removed.
741 (Is_Ignored_Ghost_Pragma): New routine.
742 (Set_Is_Checked_Ghost_Pragma): New routine.
743 (Set_Is_Ghost_Pragma): Removed.
744 (Set_Is_Ignored_Ghost_Pragma): New routine.
745 * sinfo.ads: Update the documentation on Ghost mode and
746 Ghost regions. New attributes Is_Checked_Ghost_Pragma
747 and Is_Ignored_Ghost_Pragma along with usages in nodes.
748 Remove attribute Is_Ghost_Pragma along with usages in nodes.
749 (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
750 (Is_Ghost_Pragma): Removed along with pragma Inline.
751 (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
752 (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
753 (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
754 (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
755
756 2017-01-12 Tristan Gingold <gingold@adacore.com>
757
758 * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
759 s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
760
761 2017-01-12 Yannick Moy <moy@adacore.com>
762
763 * errout.adb, errout.ads (Initialize): Factor common treatment
764 in Reset_Warnings.
765 (Reset_Warnings): New procedure to reset counts related to warnings.
766 (Record_Compilation_Errors): New variable to store the presence of an
767 error, used in gnat2why to allow changing the Warning_Mode.
768 (Compilation_Errors): Use new variable Record_Compilation_Errors to
769 store the presence of an error.
770
771 2017-01-12 Javier Miranda <miranda@adacore.com>
772
773 * sem_ch13.adb (Analyze_Aspect_Specifications):
774 For Interrupt_Handler and Attach_ Handler aspects, decorate the
775 internally built reference to the protected procedure as coming
776 from sources and force its analysis.
777
778 2017-01-12 Ed Schonberg <schonberg@adacore.com>
779
780 * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
781 inherit predicates if any from the first_subtype of the parent,
782 not from the anonymous parent type.
783 * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
784 predicate is not a static subtype.
785
786 2017-01-12 Gary Dismukes <dismukes@adacore.com>
787
788 * freeze.adb (Check_Suspicious_Convention): New procedure
789 performing a warning check on discriminated record types with
790 convention C or C++. Factored out of procedure Freeze_Record_Type,
791 and changed to only apply to base types (to avoid spurious
792 warnings on subtypes). Minor improvement of warning messages
793 to refer to discriminated rather than variant record types.
794 (Freeze_Record_Type): Remove code for performing a suspicious
795 convention check.
796 (Freeze_Entity): Only call Freeze_Record_Type
797 on types that aren't declared within any enclosing generic units
798 (rather than just excluding the type when the innermost scope
799 is generic). Call Check_Suspicious_Convention whether or not
800 the type is declared within a generic unit.
801 * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
802 * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
803 from Sem_Ch8).
804
805 2017-01-12 Tristan Gingold <gingold@adacore.com>
806
807 * sysdep.c, adaint.c, rtinit.c, ming32.h:
808 (__gnat_current_codepage): Renamed from CurrentCodePage
809 (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
810
811 2017-01-12 Ed Schonberg <schonberg@adacore.com>
812
813 * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
814 quantified expressions, following AI12-050: the loop parameters
815 of two quantified expressions are conformant if they have the
816 same identifier.
817
818 2017-01-12 Arnaud Charlet <charlet@adacore.com>
819
820 * gcc-interface/Makefile.in: Clean up VxWorks targets.
821
822 2017-01-12 Ed Schonberg <schonberg@adacore.com>
823
824 * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
825 Hnadle properly the attribute reference when it appears as part
826 of an expression in another loop aspect.
827
828 2017-01-12 Ed Schonberg <schonberg@adacore.com>
829
830 * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
831 subsidiary of Build_Initialization_Call, to complete generation
832 of predicate checks on discriminants whose (sub)types have
833 predicates, and to add checks on variants that do not have an
834 others clause.
835 * sem_util.adb (Gather_Components): A missing Others alternative is
836 not an error when the type of the discriminant is a static predicate
837 (and coverage has been checked when analyzing the case statement). A
838 runtime check is generated to verify that a given discriminant
839 satisfies the predicate (RM 3.8.1. (21.1/2)).
840
841 2017-01-12 Yannick Moy <moy@adacore.com>
842
843 * gnat1drv.adb (Adjust_Global_Switches): Only
844 perform checking of exception mechanism when generating code.
845
846 2017-01-12 Justin Squirek <squirek@adacore.com>
847
848 * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
849 Remove handling of access component with invariant.
850 (Build_Invariant_Procedure_Declaration): Remove return on class
851 wide type.
852 * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
853 conditional exception for component or array so Has_Own_Invariants
854 flag is not falsly set.
855 * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
856 wide type to have no invariant flags.
857
858 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
859
860 * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
861 sem_ch13.adb: Minor reformatting.
862
863 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
864
865 * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
866 adjustment primitive when the ancestor type was not properly frozen.
867 (Gen_Assign): Guard against a missing initialization
868 primitive when the component type was not properly frozen.
869 (Initialize_Array_Component): Guard against a missing adjustment
870 primitive when the component type was not properly frozen.
871 (Initialize_Record_Component): Guard against a missing adjustment
872 primitive when the component type was not properly frozen.
873 (Process_Transient_Component_Completion): The transient object may
874 not be finalized when its associated type was not properly frozen.
875 * exp_ch3.adb (Build_Assignment): Guard against a missing
876 adjustment primitive when the component type was not properly frozen.
877 (Build_Initialization_Call): Guard against a missing
878 initialization primitive when the associated type was not properly
879 frozen.
880 (Expand_N_Object_Declaration): Guard against a missing
881 adjustment primitive when the base type was not properly frozen.
882 (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
883 body when there is no adjustment primitive available. Create an
884 empty Deep_Finalize body when there is no finalization primitive
885 available.
886 * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
887 missing finalization primitive when the designated type was
888 not properly frozen.
889 (Expand_N_Allocator): Guard against a missing initialization primitive
890 when the designated type was not properly frozen.
891 * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
892 only when the corresponding adjustment primitive is available.
893 * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
894 adjustment/finalization statements only when there is an available
895 primitive to carry out the action.
896 (Build_Initialize_Statements): Generate the initialization/finalization
897 statements only when there is an available primitive to carry out the
898 action.
899 (Make_Adjust_Call): Do not generate a call when the underlying
900 type is not present due to a possible missing full view.
901 (Make_Final_Call): Do not generate a call when the underlying
902 type is not present due to a possible missing full view.
903 (Make_Finalize_Address_Stmts): Generate an empty body when the
904 designated type lacks a finalization primitive.
905 (Make_Init_Call): Do not generate a call when the underlying type is
906 not present due to a possible missing full view.
907 (Process_Component_For_Adjust): Add the adjustment call only when the
908 corresponding adjustment primitive is available.
909 (Process_Component_For_Finalize): Add the finalization call only when
910 the corresponding finalization primitive is available.
911 (Process_Object_Declaration): Use a null statement to emulate a
912 missing call to the finalization primitive of the object type.
913 * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
914 (Make_Final_Call): Update the comment on usage.
915 (Make_Init_Call): Update the comment on usage.
916 * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
917
918 2017-01-12 Arnaud Charlet <charlet@adacore.com>
919
920 * einfo.ads: Update documentation of Address_Taken.
921 * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
922 [Access_Attribute]): Only consider 'Access/'Unchecked_Access
923 for subprograms when setting Address_Taken flag.
924
925 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
926
927 * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
928 Configurable_Run_Time_Mode off when analysing with'ed predefined
929 libraries.
930
931 2017-01-12 Gary Dismukes <dismukes@adacore.com>
932
933 * sem_prag.adb: Minor reformatting.
934 * sem_util.adb (Unique_Entity): fix result for
935 bodies of entry families.
936
937 2017-01-12 Justin Squirek <squirek@adacore.com>
938
939 * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
940 Resolve_Suppressible in the pragma Assertion_Policy case.
941 (Resolve_Suppressible): Created this function to factor out
942 common code used to resolve Suppress to either Ignore or Check
943 * snames.ads-tmpl: Add name for Suppressible.
944
945 2017-01-12 Gary Dismukes <dismukes@adacore.com>
946
947 * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
948 reformatting.
949 * debug.adb: Minor comment fixes.
950
951 2017-01-12 Arnaud Charlet <charlet@adacore.com>
952
953 * sem_util.adb (Unique_Entity): For concurrent
954 bodies that are defined with stubs and complete a declaration
955 of a single concurrent object return the entity of an implicit
956 concurrent type, not the entity of the anonymous concurrent
957 object.
958 * debug.adb: -gnatd.J is no longer used.
959 * make.adb (Globalize): Removed, no longer used.
960 * sem_ch9.adb: minor typo in comment for entry index
961
962 2017-01-12 Patrick Bernardi <bernardi@adacore.com>
963
964 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
965 * exp_ch3.adb (Build_Init_Statements): As part of initialising
966 the value record of a task, set its _Secondary_Stack_Size field
967 if present.
968 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
969 a _Secondary_Stack_Size field in the value record of
970 the task if a Secondary_Stack_Size rep item is present.
971 (Make_Task_Create_Call): Include secondary stack size
972 parameter. If No_Secondary_Stack restriction is in place, passes
973 stack size of 0.
974 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
975 Secondary_Stack_Size.
976 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
977 function to define the overhead of the secondary stack.
978 * s-tarest.adb (Create_Restricted_Task,
979 Create_Restricted_Task_Sequential): Functions now include
980 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
981 * s-tarest.adb (Create_Restricted_Task,
982 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
983 include Secondary_Stack_Size parameter.
984 (Task_Wrapper): Secondary stack now allocated to the size specified by
985 the Secondary_Stack_Size parameter in the task's ATCB.
986 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
987 Secondary_Stack_Size component.
988 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
989 Create_Restricted_Task_Sequential): Function now include
990 Secondary_Stack_Size parameter.
991 (Task_Wrapper): Secondary stack now allocated to the size
992 specified by the Secondary_Stack_Size parameter in the task's
993 ATCB.
994 * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
995 to include Secondary_Stack_Size parameter.
996 * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
997 Secondary_Stack_Size aspect, turning the aspect into its corresponding
998 internal attribute.
999 (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
1000 * snames.adb-tmpl, snames.ads-tmpl: Added names
1001 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
1002 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
1003
1004 2017-01-12 Yannick Moy <moy@adacore.com>
1005
1006 * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
1007 subtree.
1008
1009 2017-01-12 Justin Squirek <squirek@adacore.com>
1010
1011 * exp_attr.adb (Expand_N_Attribute_Reference):
1012 Fix Finalization_Size case by properly resolving the type after
1013 rewritting the node.
1014
1015 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
1016
1017 * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
1018 the tree.
1019 (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
1020 * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
1021 exp_sel.ads: Minor reformatting.
1022
1023 2017-01-12 Justin Squirek <squirek@adacore.com>
1024
1025 * exp_ch6.adb (Expand_Call): Add guard to prevent
1026 invariant checks from being created for internally generated
1027 subprograms.
1028
1029 2017-01-12 Bob Duff <duff@adacore.com>
1030
1031 * lib-writ.ads: Remove incorrect comment.
1032
1033 2017-01-12 Javier Miranda <miranda@adacore.com>
1034
1035 * debug.adb (-gnatd.K): Enable generation of contract-only
1036 procedures in CodePeer mode.
1037 * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
1038 New subprogram.
1039 (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
1040 set.
1041 * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
1042 subprogram.
1043 (Get_Contract_Only_Missing_Body_Name): New subprogram.
1044 (Get_Contract_Only_Body): New subprogram.
1045 (Set_Contract_Only_Body): New subprogram.
1046 (Is_Contract_Only_Body): New subprogram.
1047 (Set_Is_Contract_Only_Body): New subprogram.
1048 (SCIL_Nodes): Replace table by hash-table.
1049
1050 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
1051
1052 * exp_ch6.adb: Minor reformatting.
1053 * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
1054
1055 2017-01-12 Bob Duff <duff@adacore.com>
1056
1057 * binde.adb (Forced): New reason for a dependence.
1058 (Force_Elab_Order): Implementation of the new switch.
1059 * binde.ads: Minor comment fixes.
1060 * bindusg.adb: Add -f switch. Apparently, there was an -f switch
1061 long ago that is no longer supported; removed comment about that.
1062 * opt.ads (Force_Elab_Order_File): Name of file specified for
1063 -f switch.
1064 * switch-b.adb: Parse -f switch.
1065
1066 2017-01-12 Justin Squirek <squirek@adacore.com>
1067
1068 * exp_ch6.adb (Check_View_Conversion): Created this function
1069 to properly chain calls to check type invariants that may be
1070 present in a subprogram call after the subprogram.
1071 (Expand_Call): Add a conditional to identify when a view conversion
1072 needs to be checked.
1073 * nlists.adb, nlists.ads (Prepend_New): New routine.
1074 (Prepend_New_To): New routine.
1075
1076 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
1077
1078 * sinfo.ads: Minor reformatting.
1079
1080 2017-01-12 Gary Dismukes <dismukes@adacore.com>
1081
1082 * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
1083 reformatting.
1084
1085 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com>
1086
1087 * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
1088 variable Definite. Create a local object and pass its 'Access to the
1089 BIP function when the result type is either definite or it does not
1090 require any finalization or secondary stack management.
1091
1092 2017-01-12 Bob Duff <duff@adacore.com>
1093
1094 * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
1095 exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
1096 frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
1097 par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
1098 sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
1099 sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
1100 sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
1101 sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
1102 Change name to Pragma_Name_Unmapped.
1103 (Pragma_Name_Mapped): Change name to Pragma_Name.
1104 This is because the "mapped" version should be the usual case.
1105
1106 2017-01-09 Hristian Kirtchev <kirtchev@adacore.com>
1107
1108 * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
1109 Is_Default_Init_Cond_Procedure, and
1110 Has_Inherited_Default_Init_Cond. Add uses of flags
1111 Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
1112 (Default_Init_Cond_Procedure): Removed.
1113 (DIC_Procedure): New routine.
1114 (Has_Default_Init_Cond): Removed.
1115 (Has_DIC): New routine.
1116 (Has_Inheritable_Invariants): The attribute applies to the base type.
1117 (Has_Inherited_Default_Init_Cond): Removed.
1118 (Has_Inherited_DIC): New routine.
1119 (Has_Inherited_Invariants): The attribute applies to the base type.
1120 (Has_Own_DIC): New routine.
1121 (Has_Own_Invariants): The attribute applies to the base type.
1122 (Is_Default_Init_Cond_Procedure): Removed.
1123 (Is_DIC_Procedure): New routine.
1124 (Set_Default_Init_Cond_Procedure): Removed.
1125 (Set_DIC_Procedure): New routine.
1126 (Set_Has_Default_Init_Cond): Removed.
1127 (Set_Has_Inheritable_Invariants): The attribute applies
1128 to the base type.
1129 (Set_Has_Inherited_Default_Init_Cond): Removed.
1130 (Set_Has_Inherited_DIC): New routine.
1131 (Set_Has_Inherited_Invariants): The attribute applies to the base type.
1132 (Set_Has_Own_DIC): New routine.
1133 (Set_Has_Own_Invariants): The attribute applies to the base type.
1134 (Set_Is_Default_Init_Cond_Procedure): Removed.
1135 (Set_Is_DIC_Procedure): New routine.
1136 (Write_Entity_Flags): Update the output of all flags related to
1137 default initial condition.
1138 * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
1139 of the call to the DIC procedure.
1140 (Freeze_Type): Generate the body of the DIC procedure.
1141 * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
1142 all occurrences of Create_Append with Append_New_To. Do
1143 not generate an invariant procedure for a class-wide type.
1144 The generated body acts as a freeze action of the working type.
1145 (Build_Invariant_Procedure_Declaration): Do not generate an
1146 invariant procedure for a class-wide type.
1147 (Create_Append): Removed.
1148 * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
1149 sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
1150 class-wide pre/postcondition description and data structures from
1151 Sem_Prag.
1152 (Build_Class_Wide_Expression): Moved from Sem_Prag.
1153 (Build_DIC_Call): New routine.
1154 (Build_DIC_Procedure_Body): New routine.
1155 (Build_DIC_Procedure_Declaration): New routine.
1156 (Entity_Hash): Moved from Sem_Prag.
1157 (Find_DIC_Type): New routine.
1158 (Update_Primitives_Mapping): Reimplemented.
1159 (Update_Primitives_Mapping_Of_Types): New routine.
1160 * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
1161 (Build_DIC_Call): New routine.
1162 (Build_DIC_Procedure_Body): New routine.
1163 (Build_DIC_Procedure_Declaration): New routine.
1164 (Update_Primitives_Mapping): Moved from Sem_Prag.
1165 (Update_Primitives_Mapping_Of_Types): New routine.
1166 * nlists.adb (Append_New): New routine.
1167 (Append_New_To): New routine.
1168 * nlists.ads (Append_New): New routine.
1169 (Append_New_To): New routine.
1170 * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
1171 of DIC procedures here. This is now done at the end of the
1172 visible declarations, private declarations, and at the freeze
1173 point of a type.
1174 (Analyze_Private_Extension_Declaration):
1175 A private extension inherits the DIC pragma of a parent type.
1176 (Analyze_Subtype_Declaration): No need to propagate invariant
1177 attributes to a subtype as those apply to the base type.
1178 (Build_Derived_Record_Type): No need to inherit invariants here
1179 as this is now done in Build_Derived_Type.
1180 (Build_Derived_Type): Inherit both the DIC pragma and invariants from
1181 a parent type.
1182 (Process_Full_View): Update the propagation of DIC attributes.
1183 (Propagate_Default_Init_Cond_Attributes): Removed.
1184 * sem_ch7.adb Add with and use clauses for Exp_Util.
1185 (Analyze_Package_Specification): Create the body of the DIC
1186 procedure at the end of the visible and private declarations.
1187 (Preserve_Full_Attributes): Propagate DIC attributes.
1188 * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
1189 DIC attributes.
1190 (Analyze_Task_Type_Declaration): Propagate DIC attributes.
1191 * sem_elab.adb (Check_A_Call): Update the call to
1192 Is_Nontrivial_Default_Init_Cond_Procedure.
1193 * sem_prag.adb Remove the with and use clauses for
1194 GNAT.HTable. Move the handling of class- wide pre/postcondition
1195 description and data structures to Exp_Util.
1196 (Analyze_Pragma): Create the declaration of the DIC procedure. There
1197 is no need to propagate invariant-related attributes at this point
1198 as this is done in Build_Invariant_Procedure_Declaration.
1199 (Build_Class_Wide_Expression): Moved to Exp_Util.
1200 (Entity_Hash): Moved to Exp_Util.
1201 (Update_Primitives_Mapping): Moved to Exp_Util.
1202 * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
1203 (Update_Primitives_Mapping): Moved to Exp_Util.
1204 * sem_util.adb: Remove with and use clauses for Ghost
1205 and Sem_Ch13.
1206 (Build_Default_Init_Cond_Call): Removed.
1207 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
1208 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
1209 (Get_Views): Reimplemented.
1210 (Has_Full_Default_Initialization): Reimplement the section on DIC.
1211 (Inherit_Default_Init_Cond_Procedure): Removed.
1212 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
1213 (Is_Nontrivial_DIC_Procedure): New routine.
1214 (Is_Verifiable_DIC_Pragma): New routine.
1215 (Propagate_DIC_Attributes): New routine.
1216 * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
1217 (Build_Default_Init_Cond_Procedure_Bodies): Removed.
1218 (Build_Default_Init_Cond_Procedure_Declaration): Removed.
1219 (Inherit_Default_Init_Cond_Procedure): Removed.
1220 (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
1221 (Is_Nontrivial_DIC_Procedure): New routine.
1222 (Is_Verifiable_DIC_Pragma): New routine.
1223 (Propagate_DIC_Attributes): New routine.
1224 * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
1225 on DIC.
1226 * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
1227 usage in nodes.
1228 (Expression_Copy): New routine along with pragma Inline.
1229 (Set_Expression_Copy): New routine along with pragma Inline.
1230
1231 2017-01-06 Bob Duff <duff@adacore.com>
1232
1233 * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
1234 "Bind_Main_Program" to "not Bind_For_Library", because otherwise
1235 we won't generate the call to s_stalib_adafinal when the main
1236 is not written in Ada.
1237
1238 2017-01-06 Bob Duff <duff@adacore.com>
1239
1240 * sem_prag.adb: Minor: remove pragma Warnings.
1241
1242 2017-01-06 Tristan Gingold <gingold@adacore.com>
1243
1244 * Makefile.rtl: Do not compile s-stchop by default.
1245
1246 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
1247
1248 * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
1249 sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
1250 snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
1251 s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
1252 Reverted previous change for now.
1253
1254 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1255
1256 * exp_ch3.adb (Build_Initialization_Call): Apply predicate
1257 check to default discriminant value if checks are enabled.
1258 (Build_Assignment): If type of component has static predicate,
1259 apply check to its default value, if any.
1260
1261 2017-01-06 Patrick Bernardi <bernardi@adacore.com>
1262
1263 * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
1264 * exp_ch3.adb (Build_Init_Statements): As part of initialising
1265 the value record of a task, set its _Secondary_Stack_Size field
1266 if present.
1267 * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
1268 a _Secondary_Stack_Size field in the value record of
1269 the task if a Secondary_Stack_Size rep item is present.
1270 (Make_Task_Create_Call): Include secondary stack size
1271 parameter. If No_Secondary_Stack restriction is in place, passes
1272 stack size of 0.
1273 * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
1274 Secondary_Stack_Size.
1275 * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
1276 function to define the overhead of the secondary stack.
1277 * s-tarest.adb (Create_Restricted_Task,
1278 Create_Restricted_Task_Sequential): Functions now include
1279 Secondary_Stack_Size parameter to pass to Initialize_ATCB.
1280 * s-tarest.adb (Create_Restricted_Task,
1281 Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
1282 now include Secondary_Stack_Size parameter.
1283 (Task_Wrapper):
1284 Secondary stack now allocated to the size specified by the
1285 Secondary_Stack_Size parameter in the task's ATCB.
1286 * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
1287 Secondary_Stack_Size component.
1288 * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
1289 Create_Restricted_Task_Sequential): Function now include
1290 Secondary_Stack_Size parameter.
1291 (Task_Wrapper): Secondary stack
1292 now allocated to the size specified by the Secondary_Stack_Size
1293 parameter in the task's ATCB.
1294 * sem_ch13.adb (Analyze_Aspect_Specification): Add support
1295 for Secondary_Stack_Size aspect, turning the aspect into its
1296 corresponding internal attribute.
1297 (Analyze_Attribute_Definition):
1298 Process Secondary_Stack_Size attribute.
1299 * snames.adb-tmpl, snames.ads-tmpl: Added names
1300 Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
1301 Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
1302
1303 2017-01-06 Pascal Obry <obry@adacore.com>
1304
1305 * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
1306 Sequential_IO and Direct_IO.
1307
1308 2017-01-06 Bob Duff <duff@adacore.com>
1309
1310 * snames.ads-tmpl (Renamed): New name for the pragma argument.
1311 * par-ch2.adb: Allow the new pragma (with analysis deferred
1312 to Sem_Prag).
1313 * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
1314 Keep a mapping from new pragma names to old names.
1315 * sem_prag.adb: Check legality of pragma Rename_Pragma, and
1316 implement it by calling Map_Pragma_Name.
1317 * checks.adb, contracts.adb, einfo.adb, errout.adb,
1318 * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
1319 * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
1320 * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
1321 * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
1322 * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
1323 * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
1324 as appropriate.
1325
1326 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1327
1328 * exp_ch9.adb: Minor reformatting.
1329
1330 2017-01-06 Tristan Gingold <gingold@adacore.com>
1331
1332 * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
1333 * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
1334 (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
1335 (unused).
1336 * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
1337 Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
1338 * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
1339 Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
1340
1341 2017-01-06 Bob Duff <duff@adacore.com>
1342
1343 * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
1344 dummy implementation of Map_Pragma_Name.
1345
1346 2017-01-06 Tristan Gingold <gingold@adacore.com>
1347
1348 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
1349 entry_body variable constant.
1350 * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
1351 * s-tpoben.ads (Protected_Entry_Body_Access): Now access
1352 to constant.
1353 * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
1354 now access to constant.
1355
1356 2017-01-06 Gary Dismukes <dismukes@adacore.com>
1357
1358 * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
1359 reformatting and typo fixes.
1360
1361 2017-01-06 Bob Duff <duff@adacore.com>
1362
1363 * snames.ads-tmpl: New names for pragma renaming.
1364 * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
1365 * par-prag.adb: Add new pragma name to case statement.
1366 * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
1367 of the pragma.
1368 * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
1369 Dummy implementation of Pragma_Name_Mapped.
1370
1371 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1372
1373 * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
1374 better detect call within an entry_wrapper.
1375 * sem_res.adb (Resolve_Call): A protected call within an
1376 entity_wrapper is analyzed in the context of the protected
1377 object but corresponds to a pre-analysis and is not an access
1378 before elaboration.
1379 * sem_attr.adb: Minor reformatting.
1380
1381 2017-01-06 Justin Squirek <squirek@adacore.com>
1382
1383 * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
1384 Finalization_Size to allow a prefix of any non-class-wide type.
1385 * sem_attr.ads Modify comment for Finalization_Size to include
1386 definite type use case.
1387
1388 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1389
1390 * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
1391 on procedures that are wrappers created for entries that have
1392 preconditions.
1393 * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
1394 body is an entry_wrapper, compile it in the context of the
1395 synchronized type, because a precondition may refer to funtions
1396 of the type.
1397 * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
1398 body entity.
1399 * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
1400 within an Entry_Wrapper this is an external call whose target
1401 is the synchronized object that is the actual in the call to
1402 the wrapper.
1403
1404 2017-01-06 Yannick Moy <moy@adacore.com>
1405
1406 * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
1407 in tree, which means not analyzing the previous prefix if the node has
1408 been rewritten into its prefix.
1409
1410 2017-01-06 Gary Dismukes <dismukes@adacore.com>
1411
1412 * s-tpobop.adb: Minor reformatting.
1413
1414 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1415
1416 * checks.adb (Ensure_Valid): Do not generate a validity check
1417 within a generated predicate function, validity checks will have
1418 been applied earlier when required.
1419
1420 2017-01-06 Tristan Gingold <gingold@adacore.com>
1421
1422 * s-tpoben.ads (Protection_Entries): Add comment and reorder
1423 components for performances.
1424 * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
1425 semantic.
1426
1427 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1428
1429 * sem_eval.adb (Check_Expression_Against_Static_Predicate):
1430 If expression is compile-time known and obeys a static predicate
1431 it must be labelled as static, to prevent spurious warnings and
1432 run-time errors, e.g. in case statements. This is relevant when
1433 the expression is the result of constant-folding a type conversion
1434 whose expression is a variable with a known static value.
1435
1436 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1437
1438 * exp_attr.adb, sem_attr.ads: Minor reformatting.
1439
1440 2017-01-06 Justin Squirek <squirek@adacore.com>
1441
1442 * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
1443 expansion of Finalization_Size attribute.
1444 * sem_attr.adb (Analyze_Attribute): Add entry to check the
1445 semantics of Finalization_Size.
1446 (Eval_Attribute): Add null entry for Finalization_Size.
1447 * sem_attr.ads: Add Finalization_Size to the implementation
1448 dependent attribute list.
1449 * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
1450
1451 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1452
1453 * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
1454 iterator specification with a serious syntactic error, transform
1455 construct into an infinite loop in order to continue analysis
1456 and prevent a compiler abort.
1457
1458 2017-01-06 Tristan Gingold <gingold@adacore.com>
1459
1460 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
1461 max_queue_lengths_array if unused.
1462
1463 2017-01-06 Bob Duff <duff@adacore.com>
1464
1465 * errout.adb (Set_Msg_Text): Protect against out-of-bounds
1466 array access, in case "\" is at the end of Text.
1467 * stylesw.adb (Set_Style_Check_Options): Don't include input
1468 characters in the error message template, because they could
1469 be control characters such as "\", which Errout will try to
1470 interpret.
1471
1472 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1473
1474 * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
1475 For a private type examine the visible declarations that follow
1476 the partial view, not just the private declarations that follow
1477 the full view.
1478
1479 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1480
1481 * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
1482 code cleanup.
1483
1484 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1485
1486 * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
1487 alias of the inherited op is the parent iterator, no need to
1488 examine dispatch table positions which might not be established
1489 yet if type is not frozen.
1490 * sem_disp.adb (Check_Controlling_Formals): The formal of a
1491 predicate function may be a subtype of a tagged type.
1492 * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
1493 of representation items for the completion of a type extension
1494 where a predicate applies to the partial view.
1495 * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
1496 parameter that designates function whose actual receives a
1497 predicate check, to improve warning message when the check will
1498 lead to infinite recursion.
1499 * sem_res.adb (Resolve_Actuals): Pass additional parameter to
1500 Apply_Predicate_Check.
1501
1502 2017-01-06 Tristan Gingold <gingold@adacore.com>
1503
1504 * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
1505 Gnat_Extended_Ravenscar.
1506 * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
1507
1508 2017-01-06 Gary Dismukes <dismukes@adacore.com>
1509
1510 * sem_util.ads: Minor typo fix and reformatting.
1511
1512 2017-01-06 Yannick Moy <moy@adacore.com>
1513
1514 * ghost.adb Minor fixing of references to SPARK RM.
1515 (Check_Ghost_Context): Check whether reference is to a lvalue
1516 before issuing an error about violation of SPARK RM 6.9(13)
1517 when declaration has Ghost policy Check and reference has Ghost
1518 policy Ignore.
1519 * sem_util.adb Minor indentation.
1520 * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
1521 Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
1522 * sem_util.ads (Unique_Defining_Entity): Document the result
1523 for package body stubs.
1524
1525 2017-01-06 Tristan Gingold <gingold@adacore.com>
1526
1527 * raise-gcc.c (abort): Macro to call Abort_Propagation.
1528 * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
1529 constant.
1530 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
1531 Do not generate the Entry_Max_Queue_Lengths_Array if all default
1532 values.
1533 * exp_util.adb (Corresponding_Runtime_Package): Consider
1534 Max_Queue_Length pragma.
1535
1536 2017-01-06 Justin Squirek <squirek@adacore.com>
1537
1538 * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
1539 Remove declaration generation in the case of
1540 System_Tasking_Protected_Objects_Single_Entry being used,
1541 and add a warning message when this is detected to occur.
1542 (Make_Initialize_Protection): Remove reference pass in the case
1543 of System_Tasking_Protected_Objects_Single_Entry.
1544 * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
1545 * s-tposen.adb (Initialize_Protection_Entry): Remove
1546 Entry_Queue_Max parameter.
1547 * s-tposen.ads: Remove the types use to store the entry queue
1548 maximum.
1549 * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
1550
1551 2017-01-06 Yannick Moy <moy@adacore.com>
1552
1553 * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
1554 behavior of function, to also accept out of range positions
1555 and raise Constraint_Error in such case, and to copy sloc from
1556 literal if No_Location passed as location.
1557 * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
1558 of functions to raise Constraint_Error in case of value not in
1559 appropriate range.
1560
1561 2017-01-06 Tristan Gingold <gingold@adacore.com>
1562
1563 * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
1564 Invalidate_Stack_Cache.
1565
1566 2017-01-06 Eric Botcazou <ebotcazou@adacore.com>
1567
1568 * s-os_lib.adb: Minor fix to the signature of Readlink.
1569
1570 2017-01-06 Javier Miranda <miranda@adacore.com>
1571
1572 * sem_ch6.adb (Conforming_Types): Handle another
1573 confusion between views in a nested instance with an actual
1574 private type whose full view is not in scope.
1575
1576 2017-01-06 Arnaud Charlet <charlet@adacore.com>
1577
1578 * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
1579 mark a rewritten if statement as explicit (Comes_From_Source).
1580
1581 2017-01-06 Gary Dismukes <dismukes@adacore.com>
1582
1583 * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
1584
1585 2017-01-06 Tristan Gingold <gingold@adacore.com>
1586
1587 * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
1588
1589 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1590
1591 * sem_case.adb: Minor reformatting.
1592
1593 2017-01-06 Thomas Quinot <quinot@adacore.com>
1594
1595 * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
1596
1597 2017-01-06 Justin Squirek <squirek@adacore.com>
1598
1599 * aspects.adb: Register aspect in Canonical_Aspect.
1600 * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
1601 into respective tables.
1602 * einfo.ads, einfo.adb: Add a new attribute for
1603 handling the parameters for Pragma_Max_Entry_Queue
1604 (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
1605 for accessing and setting were added as well.
1606 * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
1607 * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
1608 declaration for pramga arguments and store them in the protected
1609 type node.
1610 (Make_Initialize_Protection): Pass a reference to
1611 the Entry_Max_Queue_Lengths_Array in the protected type node to
1612 the runtime.
1613 * rtsfind.adb: Minor grammar fix.
1614 * rtsfind.ads: Register new types taken from the
1615 runtime libraries RE_Protected_Entry_Queue_Max and
1616 RE_Protected_Entry_Queue_Max_Array
1617 * s-tposen.adb, s-tpoben.adb
1618 (Initialize_Protection_Entry/Initialize_Protection_Entries):
1619 Add extra parameter and add assignment to local object.
1620 * s-tposen.ads, s-tpoben.ads: Add new types to
1621 store entry queue maximums and a field to the entry object record.
1622 * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
1623 for Aspect_Max_Queue_Length.
1624 (Check_Aspect_At_Freeze_Point):
1625 Add aspect to list of aspects that don't require delayed analysis.
1626 * sem_prag.adb (Analyze_Pragma): Add case statement for
1627 Pragma_Max_Queue_Length, check semantics, and register arugments
1628 in the respective entry nodes.
1629 * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
1630 and Has_Max_Queue_Length
1631 * snames.ads-tmpl: Add constant for the new aspect-name
1632 Name_Max_Queue_Length and corrasponding pragma.
1633
1634 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1635
1636 * exp_util.adb (Is_Controlled_Function_Call):
1637 Reimplemented. Consider any node which has an entity as the
1638 function call may appear in various ways.
1639
1640 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1641
1642 * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
1643 an unchecked type conversion when performing a view conversion
1644 to/from a private type. In all other cases use a regular type
1645 conversion to ensure that any relevant checks are properly
1646 installed.
1647
1648 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com>
1649
1650 * sem_prag.adb, sem_ch8.adb: Minor reformatting.
1651
1652 2017-01-06 Ed Schonberg <schonberg@adacore.com>
1653
1654 * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
1655 error on case expression that is an entity, when coverage is
1656 incomplete and entity has a static value obtained by local
1657 propagation.
1658 (Handle_Static_Predicate): New procedure, subsidiary of
1659 Check_Choices, to handle case alternatives that are either
1660 subtype names or subtype indications involving subtypes that
1661 have static predicates.
1662
1663 2017-01-06 Thomas Quinot <quinot@adacore.com>
1664
1665 * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
1666 (GNAT.Socket): Add support for Busy_Polling and Generic_Option
1667
1668 2017-01-06 Bob Duff <duff@adacore.com>
1669
1670 * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
1671 Elaborate_All(P) to P itself. That could happen in obscure cases,
1672 and always introduced a cycle (P body must be elaborated before
1673 P body).
1674 * lib-writ.ads: Comment clarification.
1675 * ali-util.ads: Minor comment fix.
1676 * ali.adb: Minor reformatting.
1677
1678 2017-01-06 Tristan Gingold <gingold@adacore.com>
1679
1680 * a-exexpr-gcc.adb: Improve comment.
1681
1682 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
1683
1684 * s-linux-mips.ads: Use correct signal and errno constants.
1685 (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
1686
1687 2017-01-03 James Cowgill <James.Cowgill@imgtec.com>
1688
1689 * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
1690 * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
1691 sections.
1692
1693 2017-01-01 Eric Botcazou <ebotcazou@adacore.com>
1694
1695 * gnatvsn.ads: Bump copyright year.
1696
1697 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1698
1699 * gnat_ugn.texi: Bump @copying's copyright year.
1700 * gnat_rm.texi: Likewise.
1701 \f
1702 Copyright (C) 2017 Free Software Foundation, Inc.
1703
1704 Copying and distribution of this file, with or without modification,
1705 are permitted in any medium without royalty provided the copyright
1706 notice and this notice are preserved.