diff mbox series

[Ada] Refine type of a multi unit index number

Message ID 20201217105008.GA112678@adacore.com
State New
Headers show
Series [Ada] Refine type of a multi unit index number | expand

Commit Message

Pierre-Marie de Rodat Dec. 17, 2020, 10:50 a.m. UTC
With multi unit naming scheme (e.g. "unit.1.ada" and "unit.2.ada"
instead of "unit.ads" and "unit.adb") the Multiple_Unit_Index global
variable keeps the current index number. It is only assigned by routines
that return non-negative numbers.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* opt.ads (Multiple_Unit_Index): Refine type from Int to Nat.
diff mbox series

Patch

diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads
--- a/gcc/ada/opt.ads
+++ b/gcc/ada/opt.ads
@@ -1135,7 +1135,7 @@  package Opt is
    --  make it easier to interface with back ends that implement C semantics.
    --  There is a section in Sinfo which describes the transformations made.
 
-   Multiple_Unit_Index : Int := 0;
+   Multiple_Unit_Index : Nat := 0;
    --  GNAT
    --  This is set non-zero if the current unit is being compiled in multiple
    --  unit per file mode, meaning that the current unit is selected from the