diff options
author | Ghjuvan Lacambre <lacambre@adacore.com> | 2021-06-17 10:01:33 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-07-09 12:35:32 +0000 |
commit | d35d546a7fcaf7e48e8d15abb8428d1e0b618948 (patch) | |
tree | 45283218b21a4e47c7fb6e58d23bc7c71ffe32cf /gcc/ada/par-ch6.adb | |
parent | f377685e3d82193b0f69bb0742e7f470f63532b2 (diff) | |
download | gcc-d35d546a7fcaf7e48e8d15abb8428d1e0b618948.zip gcc-d35d546a7fcaf7e48e8d15abb8428d1e0b618948.tar.gz gcc-d35d546a7fcaf7e48e8d15abb8428d1e0b618948.tar.bz2 |
[Ada] par-ch6: do not mark subprogram as missing "is" if imported
gcc/ada/
* par-ch6.adb (Contains_Import_Aspect): New function.
(P_Subprogram): Acknowledge `Import` aspects.
Diffstat (limited to 'gcc/ada/par-ch6.adb')
-rw-r--r-- | gcc/ada/par-ch6.adb | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb index e3b3155..be85d09 100644 --- a/gcc/ada/par-ch6.adb +++ b/gcc/ada/par-ch6.adb @@ -201,6 +201,28 @@ package body Ch6 is -- Error recovery: cannot raise Error_Resync function P_Subprogram (Pf_Flags : Pf_Rec) return Node_Id is + + function Contains_Import_Aspect (Aspects : List_Id) return Boolean; + -- Return True if Aspects contains an Import aspect. + + ---------------------------- + -- Contains_Import_Aspect -- + ---------------------------- + + function Contains_Import_Aspect (Aspects : List_Id) return Boolean is + Aspect : Node_Id := First (Aspects); + begin + while Present (Aspect) loop + if Chars (Identifier (Aspect)) = Name_Import then + return True; + end if; + + Next (Aspect); + end loop; + + return False; + end Contains_Import_Aspect; + Specification_Node : Node_Id; Name_Node : Node_Id; Aspects : List_Id; @@ -982,10 +1004,12 @@ package body Ch6 is if Pf_Flags.Pbod -- Disconnect this processing if we have scanned a null procedure - -- because in this case the spec is complete anyway with no body. + -- or an Import aspect because in this case the spec is complete + -- anyway with no body. and then (Nkind (Specification_Node) /= N_Procedure_Specification or else not Null_Present (Specification_Node)) + and then not Contains_Import_Aspect (Aspects) then SIS_Labl := Scopes (Scope.Last).Labl; SIS_Sloc := Scopes (Scope.Last).Sloc; |