@@ -4915,8 +4915,40 @@ package body Tree_Walk is
49154915 -- be called from Ada, or a foreign-language variable to be
49164916 -- accessed from Ada. This would (probably) require gnat2goto to
49174917 -- understand the foreign code, which we do not at the moment.
4918- Put_Line (Standard_Error,
4919- " Warning: Multi-language analysis unsupported." );
4918+ -- However, if the calling convention is specified as "Intrinsic"
4919+ -- then the subprogram is built into the compiler and gnat2goto
4920+ -- can safely ignore the pragma.
4921+ declare
4922+ -- If the pragma is specified with positional parameter
4923+ -- association, then the calling convention is the first
4924+ -- parameter. Check to see if it is Intrinsic.
4925+ Next_Ass : Node_Id := First (Pragma_Argument_Associations (N));
4926+ Is_Intrinsic : Boolean := Present (Next_Ass) and then
4927+ Nkind (Expression (Next_Ass)) = N_Identifier and then
4928+ Get_Name_String (Chars (Expression (Next_Ass))) = " intrinsic" ;
4929+ begin
4930+ -- If the first parameter is not Intrinsic, check named
4931+ -- parameters for calling convention
4932+ while not Is_Intrinsic and Present (Next_Ass) loop
4933+ if Chars (Next_Ass) /= No_Name and then
4934+ Get_Name_String (Chars (Next_Ass)) = " convention"
4935+ then
4936+ -- The named parameter is Convention, check to see if it
4937+ -- is Intrinsic
4938+ Is_Intrinsic :=
4939+ Get_Name_String (Chars (Expression (Next_Ass))) =
4940+ " intrinsic" ;
4941+ end if ;
4942+ -- Get the next parameter association
4943+ Next_Ass := Next (Next_Ass);
4944+ end loop ;
4945+
4946+ if not Is_Intrinsic then
4947+ Put_Line (Standard_Error,
4948+ " Warning: Multi-language analysis unsupported." );
4949+ end if ;
4950+ end ;
4951+
49204952 when Name_Elaborate =>
49214953 -- Specifies that the body of the named library unit is elaborated
49224954 -- before the current library_item. We will support packages.
0 commit comments