* g-comlin.adb (Set_Usage): Additional optional argument to set help
message.
(Display_Help): display the user given help message, if available.
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (OK_For_Limited_Init_In_05): The expression
is legal if the original node is an identifier that is a
parameterless function call.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178547
138bc75d-0d04-0410-961f-
82ee72b054a4
+2011-09-05 Johannes Kanig <kanig@adacore.com>
+
+ * g-comlin.adb (Set_Usage): Additional optional argument to set help
+ message.
+ (Display_Help): display the user given help message, if available.
+
+2011-09-05 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (OK_For_Limited_Init_In_05): The expression
+ is legal if the original node is an identifier that is a
+ parameterless function call.
+
2011-09-05 Pascal Obry <obry@adacore.com>
* prj-nmsc.adb: Minor reformatting.
---------------
procedure Set_Usage
- (Config : in out Command_Line_Configuration;
- Usage : String := "[switches] [arguments]";
- Help : String := "")
+ (Config : in out Command_Line_Configuration;
+ Usage : String := "[switches] [arguments]";
+ Help : String := "";
+ Help_Msg : String := "")
is
begin
if Config = null then
end if;
Free (Config.Usage);
- Config.Usage := new String'(Usage);
- Config.Help := new String'(Help);
+ Config.Usage := new String'(Usage);
+ Config.Help := new String'(Help);
+ Config.Help_Msg := new String'(Help_Msg);
end Set_Usage;
------------------
& " [switches] [arguments]");
end if;
- Display_Section_Help ("");
-
- if Config.Sections /= null and then Config.Switches /= null then
- for S in Config.Sections'Range loop
- Display_Section_Help (Config.Sections (S).all);
- end loop;
+ if Config.Help_Msg /= null and then Config.Help_Msg.all /= "" then
+ Put_Line (Config.Help_Msg.all);
+ else
+ Display_Section_Help ("");
+ if Config.Sections /= null and then Config.Switches /= null then
+ for S in Config.Sections'Range loop
+ Display_Section_Help (Config.Sections (S).all);
+ end loop;
+ end if;
end if;
end Display_Help;
-- Output is always initialized to the empty string.
procedure Set_Usage
- (Config : in out Command_Line_Configuration;
- Usage : String := "[switches] [arguments]";
- Help : String := "");
+ (Config : in out Command_Line_Configuration;
+ Usage : String := "[switches] [arguments]";
+ Help : String := "";
+ Help_Msg : String := "");
-- Defines the general format of the call to the application, and a short
- -- help text. These are both displayed by Display_Help
+ -- help text. These are both displayed by Display_Help. When a non-empty
+ -- Help_Msg is given, it is used by Display_Help instead of the
+ -- automatically generated list of supported switches.
procedure Display_Help (Config : Command_Line_Configuration);
-- Display the help for the tool (ie its usage, and its supported switches)
Aliases : Alias_Definitions_List;
Usage : GNAT.OS_Lib.String_Access;
Help : GNAT.OS_Lib.String_Access;
+ Help_Msg : GNAT.OS_Lib.String_Access;
Switches : Switch_Definitions_List;
-- List of expected switches (Used when expanding switch groups)
end record;
Anon_Scope := Scope (Defining_Entity (Related_Nod));
end if;
- -- For an access type definition, if the current scope is a child
- -- unit it is the scope of the type.
+ -- For an access type definition, if the current scope is a child
+ -- unit it is the scope of the type.
elsif Is_Compilation_Unit (Current_Scope) then
Anon_Scope := Current_Scope;
Set_Can_Use_Internal_Rep
(Anon_Type, not Always_Compatible_Rep_On_Target);
- -- If the anonymous access is associated with a protected operation
+ -- If the anonymous access is associated with a protected operation,
-- create a reference to it after the enclosing protected definition
-- because the itype will be used in the subsequent bodies.
Make_Object_Declaration (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uMaster),
- Constant_Present => True,
- Object_Definition =>
+ Constant_Present => True,
+ Object_Definition =>
New_Reference_To (RTE (RE_Master_Id), Loc),
- Expression =>
+ Expression =>
Make_Explicit_Dereference (Loc,
New_Reference_To (RTE (RE_Current_Master), Loc)));
-- function calls. The function call may have been given in prefixed
-- notation, in which case the original node is an indexed component.
-- If the function is parameterless, the original node was an explicit
- -- dereference.
+ -- dereference. The function may also be parameterless, in which case
+ -- the source node is just an identifier.
case Nkind (Original_Node (Exp)) is
when N_Aggregate | N_Extension_Aggregate | N_Function_Call | N_Op =>
return True;
+ when N_Identifier =>
+ return Present (Entity (Original_Node (Exp)))
+ and then Ekind (Entity (Original_Node (Exp))) = E_Function;
+
when N_Qualified_Expression =>
return
OK_For_Limited_Init_In_05