aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/doc
AgeCommit message (Collapse)AuthorFilesLines
7 daysada: Pragma Short_Circuit_And_OrBob Duff1-6/+26
Improve documentation of pragma Short_Circuit_And_Or. Also disallow renamings, because the semantics as currently implemented is confusing. gcc/ada/ChangeLog: * doc/gnat_rm/implementation_defined_pragmas.rst (Short_Circuit_And_Or): Add more documentation. * sem_ch8.adb (Analyze_Subprogram_Renaming): Disallow renamings. * gnat_rm.texi: Regenerate.
7 daysada: Correct documentation of policy_identifiers for Assertion_PolicyBob Duff1-1/+1
Follow-on to gnat-945. Change Ignore to Disable; Ignore is defined by the language, Disable is the implementation-defined one. Also minor code cleanup. gcc/ada/ChangeLog: * doc/gnat_rm/implementation_defined_characteristics.rst: Change Ignore to Disable. * sem_ch13.ads (Analyze_Aspect_Specifications): Minor: Remove incorrect comment; there is no need to check Has_Aspects (N) at the call site. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
7 daysada: Support Potentially_Invalid aspect in the frontendJoffrey Huguet1-0/+8
The Potentially_Invalid aspect is used to disable the SPARK assumption that all read data is valid on a case-by-case basis in GNATprove. gcc/ada/ChangeLog: * aspects.ads: Define an identifier for Potentially_Invalid. * doc/gnat_rm/implementation_defined_aspects.rst: Add section for Potentially_Invalid. * sem_attr.adb (Analyze_Attribute_Old_Result): Attribute Old is allowed to occur in a Potentially_Invalid aspect. * sem_ch13.adb (Analyze_Aspect_Specifications): Handle Potentially_Invalid. * sem_util.adb (Has_Potentially_Invalid): Returns True iff an entity is subject to the Potentially_Invalid aspect. * sem_util.ads (Has_Potentially_Invalid): Idem. * snames.ads-tmpl: New name for Potentially_Invalid. * gnat_rm.texi: Regenerate.
9 daysada: Add GNAT LLVM selection in GPR project file.Artur Pietrek1-0/+3
gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst: add GNAT LLVM explicit selection in GPR file * gnat_ugn.texi: Regenerate.
9 daysada: Add "continue" GNAT extensionRonan Desplanques1-0/+16
This extension adds "continue" as a nonreserved keyword, and this is the first occurrence of a nonreserved keyword in GNAT, which causes this patch to add unusual overload resolution code. New node kinds are introduced, but since they are entirely transformed into existing constructs during expansion, back ends that don't turn off expansion do not need to be updated. gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Document new extension. * gen_il-fields.ads (Opt_Field_Enum): Add new fields. * gen_il-types.ads (N_Loop_Flow_Statement, N_Continue_Statement): New node kinds. * gen_il-gen-gen_nodes.adb (N_Loop_Flow_Statement): New abstract node kind. (N_Continue_Statement): New node kind. (N_Exit_Statement): Reparent below N_Loop_Flow_Statement. * sinfo.ads (N_Continue_Statement): Add description. * sinfo-utils.ads (Loop_Flow_Keyword): New function. * sinfo-utils.adb (Loop_Flow_Keyword): New function. * gen_il-gen-gen_entities.adb (E_Loop): Add new field. * einfo.ads (Continue_Mark): Document new field. * sprint.adb (Sprint_Node_Actual): Update for new node kind. * snames.ads-tmpl: Add new keyword. * par-ch5.adb (P_Continue_Statement, Parse_Loop_Flow_Statement): New functions. (P_Sequence_Of_Statements): Handle continue statements. (P_Exit_Statement): Use Parse_Loop_Flow_Statement. * sem.adb (Analyze): Handle new node kind. * sem_ch5.adb (Analyze_Loop_Flow_Statement): New function. (Analyze_Continue_Statement): New procedure. (Analyze_Exit_Statement): Use new Analyze_Loop_Flow_Statement function. * sem_ch5.ads (Analyze_Continue_Statement): New procedure. * expander.adb (Expand): Handle new node kind. * exp_ch5.ads (Expand_N_Continue_Statement): New procedure. * exp_ch5.adb (Expand_Loop_Flow_Statement): New procedure. (Expand_N_Continue_Statement): New procedure. (Expand_N_Exit_Statement): Use new Expand_Loop_Flow_Statement procedure. (Build_Formal_Container_Iteration): Always reuse original loop entity. * gnat_rm.texi: Regenerate.
9 daysada: Drop the chapter listing implemented Ada 2012 AI'sTonu Naks5-1338/+5
We support Ada 2012 fully. The chapter is out of date and would serve no purpose if it was up to date. gcc/ada/ChangeLog: * doc/gnat_rm.rst: remove ref to 2012 chapter * doc/gnat_rm/about_this_guide.rst: remove ref to 2012 chapter * doc/gnat_rm/compatibility_and_porting_guide.rst: update list of supported versions * doc/gnat_rm/implementation_of_ada_2012_features.rst: delete * doc/gnat_rm/specialized_needs_annexes.rst: update list of supported versions * gnat_rm.texi: Regenerate.
9 daysada: Replace references for GLADE with PolyORBTonu Naks4-22/+12
gcc/ada/ChangeLog: * doc/gnat_rm/implementation_advice.rst: remove GLADE * doc/gnat_rm/implementation_defined_characteristics.rst: remove GLADE * doc/gnat_rm/specialized_needs_annexes.rst: remove GLADE * doc/gnat_rm/the_gnat_library.rst: remove GLADE * gnat_rm.texi: Regenerate.
9 daysada: Document sanitizers in mixed-language applicationsJose Ruiz1-1/+54
gcc/ada/ChangeLog: * doc/gnat_ugn/gnat_and_program_execution.rst: Add the documentation about benefits of using sanitizers in mixed-language applications. * gnat_ugn.texi: Regenerate.
10 daysada: Add documentation of implemented Ada 2022 featuresTonu Naks4-4/+2254
gcc/ada/ChangeLog: * doc/gnat_rm.rst: add entry point for the new chapter * doc/gnat_rm/about_this_guide.rst: add reference to the new chapter * doc/gnat_rm/implementation_of_ada_2022_features.rst: new file * doc/gnat_rm/implementation_of_ada_2012_features.rst: update explanation about RM references * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
10 daysada: 'Size'Class and interface types documentationSteve Baird1-76/+113
Update GNAT RM documentation of the Size'Class aspect. gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Update documentation for mutably tagged types and the Size'Class aspect. * gnat_rm.texi: Regenerate.
10 daysada: Fix a couple of typos in the sanitizers for AdaJose Ruiz1-3/+3
gcc/ada/ChangeLog: * doc/gnat_ugn/gnat_and_program_execution.rst: Fix a couple of minor formatting issues. * gnat_ugn.texi: Regenerate.
10 daysada: Document sanitizers for AdaJose Ruiz1-1/+2
gcc/ada/ChangeLog: * doc/gnat_ugn/gnat_and_program_execution.rst: Add the documentation about using sanitizers with Ada code. * gnat_ugn.texi: Regenerate.
10 daysada: Document sanitizers for AdaJose Ruiz1-0/+269
gcc/ada/ChangeLog: * doc/gnat_ugn/gnat_and_program_execution.rst: Add the documentation about using sanitizers with Ada code. * gnat_ugn.texi: Regenerate.
2025-06-12ada: Fix documentation of Generalized Finalization extensionEric Botcazou1-99/+57
The current documentation does not reflect the implementation present in the compiler and contains various other inaccuracies. gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst (Generalized Finalization): Document the actual implementation. (No_Raise): Move to separate section. * gnat_rm.texi: Regenerate.
2025-06-12ada: Small tweak to latest changeEric Botcazou1-2/+1
gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Compiler switches) <-O>: Fix long line. * gnat_ugn.texi: Regenerate.
2025-06-12ada: Implement -gnatRh switch to display holes in record layoutEric Botcazou1-4/+8
This implements the new (sub)switch -gnatRh to display holes in the layout of record types, which are mostly present to fulfill alignment requirements. gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst (List of all switches): Add -gnatRh subswitch. (Debugging Control): Document -gnatRh subswitch. * opt.ads (List_Representation_Info_Holes): New boolean variable. * repinfo.adb: Add with clause for GNAT.Heap_Sort_G. (List_Common_Type_Info): Relax assertion. (List_Object_Info): Replace assertion with additional test. (List_Record_Layout): If -gnatRh is specified, make sure that the components are ordered by increasing offsets. Output a comment line giving the number of unused bits if there is a hole between consecutive components. Streamline the control flow of the loop. (List_Record_Info): Use the original record type giving the layout of components, if any, to display the layout of the record. * switch-c.adb (Scan_Front_End_Switches) <-gnatR>: Add support for -gnatRh subswitch. * usage.adb (Usage): Document -gnatRh subswitch. * gnat_ugn.texi: Regenerate.
2025-06-12ada: Document supported GCC optimization switchesEric Botcazou2-31/+44
In particular the most recently added ones, namely -Og and -Oz. But -Ofast is not documented because it disregards strict compliance with standards. gcc/ada/ChangeLog: * usage.adb (Usage): Justify the documentation of common switches like that of other switches. Rework that of the -O switch. * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Compiler switches) <-O>: Rework and document 'z' and 'g' operands. * doc/gnat_ugn/gnat_and_program_execution.rst (Optimization Levels): Rework and document -Oz and -Og switches. * gnat_ugn.texi: Regenerate.
2025-06-09ada: Pragma Ada_XX not propagated from library level spec to bodyJavier Miranda2-0/+29
Add documentation to pragmas Ada_83, Ada_95, Ada_05, Ada_12, and Ada_2022: when placed before a library level package specification they are not propagated to the corresponding package body; they must be added explicitly to the package body. gcc/ada/ChangeLog: * doc/gnat_rm/implementation_defined_pragmas.rst: Adding documentation. * doc/gnat_ugn/the_gnat_compilation_model.rst: ditto. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2025-06-06ada: Add case for Program_Exit in Exit_CasesClaire Dross1-1/+2
Extend the syntax for Exit_Cases to support exiting the program. gcc/ada/ChangeLog: * doc/gnat_rm/implementation_defined_pragmas.rst (Pragma Exit_Cases): Update the documentation for Exit_Cases. * sem_prag.adb (Anlayze_Pragma): Accept Program_Exit as an exit kind. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2025-06-06ada: Support aspect Program_Exit with no expressionPiotr Trojanek1-1/+1
New aspect Program_Exit for SPARK was originally designed to require an expression, but now we want this expression to be optional. gcc/ada/ChangeLog: * aspects.ads (Aspect_Argument): Argument for Program_Exit is now optional. * doc/gnat_rm/implementation_defined_pragmas.rst (Pragma Program_Exit): Change documentation for pragma syntax. * sem_prag.adb (Analyze_Pragma): Argument for Program_Exit is now optional. (Analyze_Program_Exit_In_Decl_Part): Likewise. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2025-06-06ada: Add new aspect Program_Exit for SPARKPiotr Trojanek2-0/+20
A new aspect Program_Exit is added for SPARK to specify that a subprogram can exit the entire program, e.g. GNAT.System.OS_Exit. The implementation is based on the existing machinery for similar aspects, in particular, for aspects Subprogram_Variant and Always_Terminates. gcc/ada/ChangeLog: * aspects.ads (Aspect_Id): Add new aspect identifier. (Aspect_Argument): Specify argument for the new aspect. (Is_Representation_Aspect): New aspect is not a representation aspect. (Aspect_Names): Map new aspect to name. (Aspect_Delay): New aspect is always delayed. * contracts.adb (Expand_Subprogram_Contract) (Add_Pre_Post_Condition, Add_Contract_Item) (Analyze_Entry_Or_Subprogram_Contract) (Analyze_Entry_Or_Subprogram_Body_Contract) (Analyze_Subprogram_Body_Stub_Contract): Support new aspect. * contracts.ads (Add_Contract_Item, Analyze_Entry_Or_Subprogram_Contract, Analyze_Entry_Or_Subprogram_Body_Contract, Analyze_Subprogram_Body_Stub_Contract): Mention new contract in comment. * doc/gnat_rm/implementation_defined_aspects.rst (Aspect Program_Exit): Document new aspect. * doc/gnat_rm/implementation_defined_pragmas.rst (Pragma Program_Exit): Document new pragma. * einfo-utils.adb (Get_Pragma): Support new pragma. * einfo-utils.ads (Get_Pragma): Mention new pragma in comment. * exp_prag.adb (Expand_Pragma_Program_Exit): Expand new pragma; body. * exp_prag.ads (Expand_Pragma_Program_Exit): Expand new pragma; spec. * inline.adb (Remove_Aspects_And_Pragmas): Support new pragma. * par-prag.adb (Prag): Support new pragma. * sem_attr.adb (Analyze_Attribute_Old_Result): Accept attribute Old in new pragma. * sem_ch12.adb (Implementation of Generic Contracts): Mention new aspect in comment. * sem_ch13.adb (Insert_Pragma, Analyze_Aspect_Specifications): Convert new new aspect to pragma. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Renumber subsequent rule in comment. * sem_prag.adb (Check_Postcondition_Use_In_Inlined_Subprogram) (Contract_Freeze_Error): Mention new pragma in comment. (Analyze_Pragma): Support new pragma; renumber subsequent rule in comment. (Analyze_Program_Exit_In_Decl_Part): Analyze new pragma; body. (Sig_Flags): References in new pragma are significant when detecting unreferenced objects. * sem_prag.ads (Aspect_Specifying_Pragma) (Assertion_Expression_Pragma, Pragma_Significant_To_Subprograms): Support new aspect and pragma. (Analyze_Program_Exit_In_Decl_Part): Analyze new pragma; spec. (Find_Related_Package_Or_Body): Mention new pragma in comment. * sem_util.adb (Is_Subprogram_Contract_Annotation): Support new pragma. * sem_util.ads (Is_Subprogram_Contract_Annotation): Mention new pragma in comment. * sinfo.ads (Is_Generic_Contract_Pragma): Mention new pragma in comment. * snames.ads-tmpl (Preset Names, Pragma_Id): Add name and pragma identifiers. * gnat_rm.texi: Regenerate.
2025-06-06ada: Fix typo in documentation about convention and representationPiotr Trojanek1-1/+1
Currently there are only three exceptions to the general rule; the fourth exception applied to OpenVMS, whose support has been deconstructed. gcc/ada/ChangeLog: * doc/gnat_rm/representation_clauses_and_pragmas.rst (Effect of Convention on Representation): Fix number of list items. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2025-06-06ada: Implement use implies with experimental extensionsquirek1-0/+16
The patch implements the experimental feature to allow use package clauses within the context area to imply with. gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Add documentation. * gnat_rm.texi: Regenerate.
2025-06-05ada: Reject Valid_Value arguments originating from StandardViljar Indus1-3/+3
The constraint for Valid_Value not applying to types from Standard should also apply to all types derived from those types. gcc/ada/ChangeLog: * doc/gnat_rm/implementation_defined_attributes.rst: Update the documentation for Valid_Value. * sem_attr.adb (Analyze_Attribute): Reject types where the root type originates from Standard. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2025-06-05ada: Extend and clarify documentation of stack size settings for WindowsPiotr Trojanek1-3/+4
The original documentation for more recent versions of Windows didn't specify whether the specified stack size acts as a "reserved" or "committed" stack size. Also, clarify the wording for older versions of Windows. gcc/ada/ChangeLog: * doc/gnat_ugn/platform_specific_information.rst (Setting Stack Size from gnatlink): Improve documentation. * gnat-style.texi: Regenerate. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2025-01-13ada: Update gnatdll documentation (-b option removed)Pascal Obry1-13/+6
gcc/ada/ChangeLog: * doc/gnat_ugn/platform_specific_information.rst: Update. * gnat_ugn.texi: Regenerate.
2025-01-07ada: Add "finally" GNAT extensionRonan Desplanques1-0/+43
This patch adds a new reserved word, "finally", and accompanying new syntax that's similar to the Java equivalent. gcc/ada/ChangeLog: * atree.adb (Parent_Or_List_Containing): New function. * atree.ads (Parent_Or_List_Containing): Likewise. * gen_il-fields.ads: Add new field. * gen_il-gen-gen_nodes.adb (Gen_Nodes): Extend handled sequence of statements node. * par-ch11.adb (P_Handled_Sequence_Of_Statements, P_Exception_Handler): Add new syntactic construct. * par-ch5.adb (P_Sequence_Of_Statements): Likewise. * par.adb: Likewise. * par-util.adb (Check_Future_Keyword): Warn that "finally" becomes a reserved word with extensions. * scans.adb (Initialize_Ada_Keywords): Add new reserved word. * snames.adb-tmpl: Likewise. * snames.ads-tmpl: Likewise. * scans.ads: Likewise. * sem_ch11.adb (Analyze_Handled_Statements): Adapt to new node field. * sem_ch5.adb (Analyze_Exit_Statement): Add legality check. (Analyze_Goto_Statement): Likewise. * sem_ch6.adb (Analyze_Return_Statement): Likewise. * sinfo-utils.adb (Lowest_Common_Ancestor, Destroy_Element): New subprograms. * sinfo-utils.ads (Lowest_Common_Ancestor): New function. * sinfo.ads: Add documentation for new field. * xsnamest.adb: Fix typo in comment. * doc/gnat_rm/gnat_language_extensions.rst: Document new extension. * warnsw.adb: Add new option. * warnsw.ads: Likewise. * exp_ch11.adb (Expand_N_Handled_Sequence_Of_Statements): Add abort deferral to finally part. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate. * gcc-interface/trans.cc (Handled_Sequence_Of_Statements_to_gnu): Handle finally statements.
2025-01-06ada: Support new SPARK aspect Exit_CasesClaire Dross2-2/+34
The aspect Exit_Cases allows annotating a subprogram with a list of cases specifying, for all input which satisfy a guard, how the subprogram is allowed to terminate. For now, it can only be either returning normally or propagating an exception. This contract is not checked at runtime, it is only meant for static verification in SPARK. gcc/ada/ChangeLog: * aspects.ads: Add aspect Aspect_Exit_Cases. * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): Handle Exit_Cases. (Expand_Subprogram_Contract): Idem. * einfo-utils.adb (Get_Pragma): Allow Pragma_Exit_Cases. * einfo-utils.ads (Get_Pragma): Idem. * exp_prag.adb (Expand_Pragma_Exit_Cases): Ignore the pragma, currently we don't expand it. * exp_prag.ads (Expand_Pragma_Exit_Cases): Idem. * inline.adb (Remove_Aspects_And_Pragmas): Add Exit_Cases to the list. (Remove_Items): Idem. * par-prag.adb (Last_Arg_Is_Reason): Idem. * sem_ch12.adb: Idem. * sem_ch13.adb: Idem. * sem_util.adb: Idem. * sem_util.ads: Idem. * sinfo.ads: Idem. * snames.ads-tmpl: Add names Name_Exit_Cases, Name_Exception_Raised, and Name_Normal_Return as well as pragma Pragma_Exit_Cases. * sem_prag.adb (Analyze_Exit_Cases_In_Decl_Part): Make sure that a pragma or aspect Exit_Cases is well formed. (Analyze_Pragma): Make sure that a pragma or aspect Exit_Cases is at the right place. * sem_prag.ads (Analyze_Exit_Cases_In_Decl_Part): Declaration. * doc/gnat_rm/implementation_defined_pragmas.rst: Document the Exit_Cases pragma. * doc/gnat_rm/implementation_defined_aspects.rst: Document the Exit_Cases aspect. * gnat_rm.texi: Regenerate.
2025-01-06ada: Fix markup in user's guideRonan Desplanques1-1/+1
gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix markup. * gnat_ugn.texi: Regenerate.
2025-01-06Ada: fix documentation of pragma Unimplemented_UnitEric Botcazou1-3/+3
gcc/ada PR ada/117936 * doc/gnat_rm/implementation_defined_pragmas.rst (Unimplemented_Unit): Adjust the description of the error message. * gnat_rm.texi: Regenerate.
2025-01-03ada: Handle C++ exception hierarchiesAlexandre Oliva1-1/+162
This patch introduces support for defining exceptions in Ada with C++'s notion of exception type compatibility, such as handling occurrences of derived types, and obtaining class-wide access to the thrown/raised objects. As a bonus, it adds support for C++ dependent (wrapped) exceptions, and introduces types and interfaces to match C++'s std::type_info and std::exception. Support for C++ exceptions with base-type matching, added to raise-gcc by calling subprograms in Ada units, requires these units and their dependencies to be linked into programs that link with raise-gcc. gcc/ada/ChangeLog: * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add g-cpp, g-cppstd, and g-cstyin. * doc/gnat_rm/interfacing_to_other_languages.rst (Interfacing to C++): Document class-wide matching and new interfaces. * exp_prag.adb (Expand_Pragma_Import_Or_Interface): Add class-wide exception matching support with 'B' as language identifier. * libgnat/a-exexpr.adb (Setup_Current_Excep): Add Id formal. (Set_Foreign_Occurrence): Likewise. (Propagate_GCC_Exception): Adjust. (Set_Exception_Parameter): Likewise. (Unhandled_Except_Handler): Likewise. * libgnat/g-cpp.ads: New. * libgnat/g-cppexc.adb (Raise_Cpp_Exception): Match 'B' lang id. (Get_Object_Address): New. (Get_Object): Rewrite. (Get_Access_To_Object): New. (Get_Access_To_Tagged_Object): New. (Get_Type_Info): New. (Convert_Caught_Object): New. * libgnat/g-cppexc.ads (Get_Object_Address): New. (Get_Object): Note the Cpp Convention requirement. (Get_Access_To_Object): New. (Get_Access_To_Tagged_Object): New. (Get_Type_Info): New. * libgnat/g-cppstd.adb: New. * libgnat/g-cppstd.ads: New. * libgnat/g-csclex.ads: New, unused. * libgnat/g-cstyin.adb: New. * libgnat/g-cstyin.ads: New. * libgnat/g-excact.adb (Exception_Language): New. (Is_Foreign_Exception): Rewrite. * libgnat/g-excact.ads (Exception_Languages): New. (Exception_Language): New. * libgnat/s-stalib.ads (Lang): Document 'B'. * raise-gcc.c (__gnat_setup_current_excep): Add Exception_Id formal. (CXX_DEPENDENT_EXCEPTION_CLASS): New. (cxx_type_info): New. (__cxa_exception): Rename exceptionType to encompass PrimaryException. (_GNAT_Exception): Drop wrapper. (EID_For): Adjust. (exception_class_eq): Likewise. (__gnat_exception_language_is_cplusplus): New. (__gnat_exception_language_is_ada): New. (__gnat_convert_caught_object): Declare. (__gnat_get_cxx_dependent_exception): New. (__gnat_maybe_get_cxx_dependent_exception): New. (__gnat_get_cxx_exception_type_info): New. (__gnat_obtain_caught_object): New. (is_handled_by): Adjust. [!CERT] Add eid formal, handle dependent exceptions and base-type matches. (get_action_description_for) [!CERT]: Add eid formal. Adjust. (personality_body): Adjust. * gcc-interface/Make-lang.in (GNAT_ADA_OBJS, GNATBIND_OBJS) [!STAGE1]: Add new g-cpp, g-cppstd, g-cstyin + preexisting g-cppexc and i-cstrin. * gnat-style.texi: Regenerate. * gnat_rm.texi: Regenerate.
2024-12-13ada: Fix typo in reference manualRonan Desplanques1-1/+1
gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Fix typo. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-12-13ada: Fix documentation of Ada.Real_Time.Timing_EventsRonan Desplanques1-1/+2
The GNAT reference manual stated that GNAT did not implement this language-defined package, but GNAT in fact does offer an implementation of it. gcc/ada/ChangeLog: * doc/gnat_rm/standard_library_routines.rst: Fix documentation. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-12-12ada: Fix the level of the LLVM chapter in the User's GuideSebastian Poeplau1-1/+1
gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Move the LLVM chapter one level up. * gnat_ugn.texi: Regenerate.
2024-12-12ada: Update documentation for External_InitializationRonan Desplanques1-1/+1
This fixes an omission in the recent change that was made to file lookup for External_Initialization. gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Update External_Initialization section. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-11-26ada: Fix the file documenting the ali formatJose Ruiz1-2/+2
gcc/ada/ChangeLog: * doc/gnat_ugn/the_gnat_compilation_model.rst: The format of the ali file is documented in lib-writ.ads. * gnat_ugn.texi: Regenerate.
2024-11-18ada: Atomic_Synchronization is not a user-visible checkBob Duff3-33/+20
Remove all user-level documentation of the check name "Atomic_Synchronization". The documentation was confusing because this check should never be used in source code, and because it raises the question of whether All_Checks applies to it (it does not). Change the name Atomic_Synchronization to be _Atomic_Synchronization (with a leading underscore) so that it cannot be used in source code. This "check" is not really a check at all; it is used only internally in the implementation of Disable/Enable_Atomic_Synchronization, because the placement and scope of these pragmas match pragma Suppress. gcc/ada/ChangeLog: * doc/gnat_rm/implementation_defined_characteristics.rst: Remove Atomic_Synchronization. * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Likewise. * doc/gnat_rm/implementation_defined_pragmas.rst: DRY. Consolidate documentation of Disable/Enable_Atomic_Synchronization. * checks.adb: Comment fix. * exp_util.ads: Likewise. * targparm.ads: Likewise. * types.ads: Likewise. * gnat1drv.adb: Likewise. DRY. * sem_prag.adb (Process_Disable_Enable_Atomic_Sync): Change name of Atomic_Synchronization to start with underscore. (Process_Suppress_Unsuppress): No need to check Comes_From_Source for Atomic_Synchronization anymore; _Atomic_Synchronization can never come from source. (Anyway, it shouldn't be ignored; it should be an error.) * snames.ads-tmpl (Atomic_Synchronization): Change name to start with underscore. * switch-c.adb (Scan_Front_End_Switches): Minor cleanup: Use 'in'. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-11-12ada: Fix markup typosRichard Kenner2-3/+3
gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix minor markup errors. * doc/gnat_ugn/gnat_utility_programs.rst: Likewise. * gnat_ugn.texi: Regenerate.
2024-11-12ada: Detect sharing of external file in inconsistent read-write modesPiotr Trojanek1-1/+1
When opening files with "shared=yes", as described in GNAT RM 11.10, Sharing Files, we now prevent sharing a single file in inconsistent read-write modes. gcc/ada/ChangeLog: * doc/gnat_rm/the_implementation_of_standard_i_o.rst (Shared Files): Add trailing period. * libgnat/s-ficobl.ads (AFCB): Reflect new behavior in comment. * libgnat/s-fileio.adb (Open): Detect inconsistent sharing, just like we do in System.File_IO.Reset. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-11-12ada: Add documentation about GNAT LLVM to GNAT User's GuideRichard Kenner4-42/+171
Also be consistent on spelling of "back end". gcc/ada/ChangeLog: * doc/gnat_ugn/about_this_guide.rst: Add information about GNAT LLVM. Be consistent about spelling of "back end". * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Likewise. * doc/gnat_ugn/gnat_and_program_execution.rst: Be consistent about spelling of "back end". * doc/gnat_ugn/the_gnat_compilation_model.rst: Likewise. * gnat_ugn.texi: Regenerate.
2024-11-04ada: Add doc for deep delta aggregatesRaphaël AMIARD1-0/+148
gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Adjust documentation. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-10-26Fix old glitch in the GNAT Reference ManualEric Botcazou1-1/+1
gcc/ada PR ada/62122 * doc/gnat_rm/implementation_defined_attributes.rst (Unrestricted_Access): Remove null exclusion. * gnat_rm.texi: Regenerate.
2024-10-25ada: Update GNAT UGRichard Kenner9-2526/+2568
Also add some LLVM-specific information. gcc/ada/ChangeLog: * doc/gnat_ugn/about_this_guide.rst: Numerous changes to language and style and add some LLVM-specific information. * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Likewise. * doc/gnat_ugn/example_of_binder_output.rst: Likewise. * doc/gnat_ugn/getting_started_with_gnat.rst: Likewise. * doc/gnat_ugn/gnat_and_program_execution.rst: Likewise. * doc/gnat_ugn/gnat_utility_programs.rst: Likewise. * doc/gnat_ugn/inline_assembler.rst: Likewise. * doc/gnat_ugn/platform_specific_information.rst: Likewise. * doc/gnat_ugn/the_gnat_compilation_model.rst: Likewise. * gnat_ugn.texi: Regenerate.
2024-10-25ada: Adjust documentation of External_InitializationRonan Desplanques1-5/+1
The parameters Maximum_Size and If_Empty were mentioned during the request for comments phase but are not implemented, at least for now. This patch changes the GNAT reference manual accordingly. It also makes a minor punctuation change. gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Adjust documentation. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-10-25ada: Update simpler accessibility model docTonu Naks1-102/+108
gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: update simpler accessibility model * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-10-25ada: Misc improvements to gnat RMBob Duff1-33/+48
...in the "GNAT language extensions" section. gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Minor wording improvments. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-10-08ada: Remove references to internal gnat RFC'sTonu Naks1-89/+836
gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: replace references to RFC's with appropriate text from the rfc * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-10-08ada: Use semantics from the RFC for declarative items mixed with statementsRaphaël AMIARD1-3/+49
We want to allow statements lists with declarations *and* an exception handler. What follows from this is that declarations declared in the statement list are *not* visible from the exception handler, and that the following code: declare A : Integer := 12; begin A : Integer := 15; <stmts> exception when others => ... Roughly expands to: declare A : Integer := 12; begin declare A : Integer := 15; begin <stmts> exception when others => ... As such, in the code above, there is no more error triggered for conflicting declarations of `A`. Move "Local declarations without block" into curated extensions Restrict legal local decls in statement lists Only accept object declarations & renamings, as well as use clauses for gcc/ada/ChangeLog: * par-ch11.adb (P_Sequence_Of_Statements): Remove Handled parameter. Always wrap the statements in a block when there are declarations in it. * par-ch5.adb: Adapt call to P_Sequence_Of_Statements Update outdated comment, remove useless `Style_Checks` pragma. (P_Sequence_Of_Statements): Don't emit an error in core extensions mode. Emit an error when a non valid declaration is parsed in sequence of statements. * par.adb: Adapt P_Sequence_Of_Statements' signature * doc/gnat_rm/gnat_language_extensions.rst: Adapt documentation now. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-10-08ada: Add External_Initialization extensionRonan Desplanques1-0/+25
This patch introduces a GNAT extension that adds a new aspect, External_Initialization. A section is added to the reference manual with a description of what the aspect does. The implementation reuses existing mechanisms, in particular Sinput.L.Load_Source_File and Sem_Res.Set_String_Literal_Subtype. A new node kind is added, and nodes of that type are present in what is passed to the back ends. That makes it necessary to update the back ends to handle the new node type. The C interface is extended to make that possible. gcc/ada/ChangeLog: * aspects.ads: Add entities for External_Initialization. * checks.adb (Selected_Length_Checks): Add support for N_External_Initializer nodes. * doc/gnat_rm/gnat_language_extensions.rst: Add section for the added extension. * exp_util.adb (Insert_Actions): Add support for N_External_Initializer nodes. * fe.h (C_Source_Buffer): New function. * gen_il-fields.ads: Add new field. * gen_il-gen-gen_nodes.adb: Add N_External_Initializer node kind. * gen_il-gen.adb: Add new field type. * gen_il-types.ads: Add new node kind and new field type. * pprint.adb (Expr_Name): Handle new node kind. * sem.adb (Analyze): Add support for N_External_Initializer nodes. * sem_ch13.adb (Analyze_Aspect_Specifications, Check_Aspect_At_Freeze_Point): Add support for External_Initialization aspect. * sem_ch3.adb (Apply_External_Initialization): New subprogram. (Analyze_Object_Declaration): Add support for External_Initialization aspect. * sem_res.adb (Resolve_External_Initializer): New procedure. (Resolve): Add support for N_External_Initializer nodes. (Set_String_Literal_Subtype): Extend to handle N_External_Initializer nodes. * sinfo-utils.adb (Is_In_Union_Id): Adapt to new field addition. * sinfo.ads: Add documentation for new node kind and new field. * sinput.adb, sinput.ads (C_Source_Buffer): Add new C interface function. * snames.ads-tmpl: Add new aspect identifier. * sprint.adb (Sprint_Node_Actual): Add nop handling of N_External_Initializer nodes. * types.ads: Modify type to allow for new C interface. * gcc-interface/trans.cc (gnat_to_gnu): Handle new GNAT node type. * gcc-interface/Make-lang.in: Update list of stage1 run-time library units. * gnat-style.texi: Regenerate. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-09-02ada: Create usage entry for -gnatw_lViljar Indus1-3/+3
gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: update documentation for the -gnatw_l switch. * usage.adb: Add -gnatw_l entry. * gnat_ugn.texi: Regenerate.