Skip to content
Snippets Groups Projects
Commit 5697da32 authored by Ronan Desplanques's avatar Ronan Desplanques Committed by Marc Poulhiès
Browse files

ada: Add "finally" GNAT extension

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.
parent a47c6d8a
No related branches found
No related tags found
Loading
Showing
with 396 additions and 46 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment