diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2021-05-19 14:05:01 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-07-07 16:23:18 +0000 |
commit | e1eb4441733ca9b80faf4f51a29418d720014ae1 (patch) | |
tree | 275585797eb326fac7d5b65edd6572895f420a69 | |
parent | 9e76a063f11197aee9667b59ed8aa071e83237aa (diff) | |
download | gcc-e1eb4441733ca9b80faf4f51a29418d720014ae1.zip gcc-e1eb4441733ca9b80faf4f51a29418d720014ae1.tar.gz gcc-e1eb4441733ca9b80faf4f51a29418d720014ae1.tar.bz2 |
[Ada] Simplify code by reusing Remove on list of primitive operations
gcc/ada/
* sem_prag.adb (Analyze_Pragma): Simplify processing of pragma
CPP_Constructor.
-rw-r--r-- | gcc/ada/sem_prag.adb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 41e887d..5705aa7 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -14738,7 +14738,6 @@ package body Sem_Prag is -- [, [Link_Name =>] static_string_EXPRESSION ]); when Pragma_CPP_Constructor => CPP_Constructor : declare - Elmt : Elmt_Id; Id : Entity_Id; Def_Id : Entity_Id; Tag_Typ : Entity_Id; @@ -14805,12 +14804,7 @@ package body Sem_Prag is then Tag_Typ := Etype (Def_Id); - Elmt := First_Elmt (Primitive_Operations (Tag_Typ)); - while Present (Elmt) and then Node (Elmt) /= Def_Id loop - Next_Elmt (Elmt); - end loop; - - Remove_Elmt (Primitive_Operations (Tag_Typ), Elmt); + Remove (Primitive_Operations (Tag_Typ), Def_Id); Set_Is_Dispatching_Operation (Def_Id, False); end if; |