[Ada] Tune discovery of No_Elaboration_Code restriction
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 17 May 2021 22:55:27 +0000 (00:55 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 7 Jul 2021 16:23:12 +0000 (16:23 +0000)
gcc/ada/

* lib-writ.adb (Write_ALI): Exit from loop after seeing first
unit that violates No_Elaboration_Code restriction.

gcc/ada/lib-writ.adb

index 1b02b1c..3564f0f 100644 (file)
@@ -1256,6 +1256,7 @@ package body Lib.Writ is
          if Units.Table (Unit).Generate_Code or else Unit = Main_Unit then
             if not Has_No_Elaboration_Code (Cunit (Unit)) then
                Main_Restrictions.Violated (No_Elaboration_Code) := True;
+               exit;
             end if;
          end if;
       end loop;