Commit bded454f by Robert Dewar Committed by Arnaud Charlet

Makefile.rtl: Add entries for s-conca?

2009-04-16  Robert Dewar  <dewar@adacore.com>

	* Makefile.rtl: Add entries for s-conca?

	* debug.adb: Add debug flags -gnatd.c and -gnatd.C to control behavior
	of concatenation expansion

	* exp_ch4.adb (Expand_Concatenation): Generate calls for certain
	string cases instead of expanding assignments inline.

	* opt.ads (Optimize_Size): New flag

	* s-conca2.ads, s-conca2.adb, s-conca3.adb, s-conca3.ads,
	s-conca4.adb, s-conca4.ads, s-conca5.adb, s-conca5.ads, s-conca6.adb,
	s-conca6.ads, s-conca7.ads, s-conca7.adb, s-conca8.adb, s-conca8.ads,
	s-conca9.adb, s-conca9.ads: New file.

From-SVN: r146161
parent 4a3b249c
2009-04-16 Robert Dewar <dewar@adacore.com> 2009-04-16 Robert Dewar <dewar@adacore.com>
* Makefile.rtl: Add entries for s-conca?
* debug.adb: Add debug flags -gnatd.c and -gnatd.C to control behavior
of concatenation expansion
* exp_ch4.adb (Expand_Concatenation): Generate calls for certain
string cases instead of expanding assignments inline.
* opt.ads (Optimize_Size): New flag
* s-conca2.ads, s-conca2.adb, s-conca3.adb, s-conca3.ads,
s-conca4.adb, s-conca4.ads, s-conca5.adb, s-conca5.ads, s-conca6.adb,
s-conca6.ads, s-conca7.ads, s-conca7.adb, s-conca8.adb, s-conca8.ads,
s-conca9.adb, s-conca9.ads: New file.
2009-04-16 Robert Dewar <dewar@adacore.com>
* exp_ch6.adb: Add comments * exp_ch6.adb: Add comments
* rtsfind.ads: Add entries for s-conca? routines * rtsfind.ads: Add entries for s-conca? routines
...@@ -416,6 +416,14 @@ GNATRTL_NONTASKING_OBJS= \ ...@@ -416,6 +416,14 @@ GNATRTL_NONTASKING_OBJS= \
s-caun32$(objext) \ s-caun32$(objext) \
s-caun64$(objext) \ s-caun64$(objext) \
s-chepoo$(objext) \ s-chepoo$(objext) \
s-conca2$(objext) \
s-conca3$(objext) \
s-conca4$(objext) \
s-conca5$(objext) \
s-conca6$(objext) \
s-conca7$(objext) \
s-conca8$(objext) \
s-conca9$(objext) \
s-crtl$(objext) \ s-crtl$(objext) \
s-crc32$(objext) \ s-crc32$(objext) \
s-direio$(objext) \ s-direio$(objext) \
......
...@@ -93,7 +93,7 @@ package body Debug is ...@@ -93,7 +93,7 @@ package body Debug is
-- d.a -- d.a
-- d.b -- d.b
-- d.c -- d.c Generate inline concatenation, do not call procedure
-- d.d -- d.d
-- d.e -- d.e
-- d.f Inhibit folding of static expressions -- d.f Inhibit folding of static expressions
...@@ -120,7 +120,7 @@ package body Debug is ...@@ -120,7 +120,7 @@ package body Debug is
-- d.A -- d.A
-- d.B -- d.B
-- d.C -- d.C Generate concatenation call, do not generate inline code
-- d.D -- d.D
-- d.E -- d.E
-- d.F -- d.F
...@@ -498,6 +498,10 @@ package body Debug is ...@@ -498,6 +498,10 @@ package body Debug is
-- - In case of abstract subprograms the text "is abstract" is -- - In case of abstract subprograms the text "is abstract" is
-- added at the end of the line. -- added at the end of the line.
-- d.c Generate inline concatenation, instead of calling one of the
-- System.Concat_n.Str_Concat_n routines in cases where the latter
-- routines would normally be called.
-- d.f Suppress folding of static expressions. This of course results -- d.f Suppress folding of static expressions. This of course results
-- in seriously non-conforming behavior, but is useful sometimes -- in seriously non-conforming behavior, but is useful sometimes
-- when tracking down handling of complex expressions. -- when tracking down handling of complex expressions.
...@@ -542,6 +546,9 @@ package body Debug is ...@@ -542,6 +546,9 @@ package body Debug is
-- fully compiled and analyzed, they just get eliminated from the -- fully compiled and analyzed, they just get eliminated from the
-- code generation step. -- code generation step.
-- d.C Generate call to System.Concat_n.Str_Concat_n routines in cases
-- where we would normally generate inline concatenation code.
-- d.I Inspector mode. Relevant for VM_Target /= None. Try to generate -- d.I Inspector mode. Relevant for VM_Target /= None. Try to generate
-- byte code, even in case of unsupported construct, for the sake -- byte code, even in case of unsupported construct, for the sake
-- of static analysis tools. -- of static analysis tools.
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
with Atree; use Atree; with Atree; use Atree;
with Checks; use Checks; with Checks; use Checks;
with Debug; use Debug;
with Einfo; use Einfo; with Einfo; use Einfo;
with Elists; use Elists; with Elists; use Elists;
with Errout; use Errout; with Errout; use Errout;
...@@ -2757,9 +2758,10 @@ package body Exp_Ch4 is ...@@ -2757,9 +2758,10 @@ package body Exp_Ch4 is
Right_Opnd => Make_Artyp_Literal (1)))); Right_Opnd => Make_Artyp_Literal (1))));
-- Note that calculation of the high bound may cause overflow in some -- Note that calculation of the high bound may cause overflow in some
-- very weird cases, so in the general case we need an overflow check -- very weird cases, so in the general case we need an overflow check on
-- on the high bound. We can avoid this for the common case of string -- the high bound. We can avoid this for the common case of string types
-- types since we chose a wider range for the arithmetic type. -- and other types whose index is Positive, since we chose a wider range
-- for the arithmetic type.
if Istyp /= Standard_Positive then if Istyp /= Standard_Positive then
Activate_Overflow_Check (High_Bound); Activate_Overflow_Check (High_Bound);
...@@ -2813,6 +2815,82 @@ package body Exp_Ch4 is ...@@ -2813,6 +2815,82 @@ package body Exp_Ch4 is
-- Now we will generate the assignments to do the actual concatenation -- Now we will generate the assignments to do the actual concatenation
-- There is one case in which we will not do this, namely when all the
-- following conditions are met:
-- The result type is Standard.String
-- There are nine or fewer retained (non-null) operands
-- The optimization level is -O0 or -Os
-- The corresponding System.Concat_n.Str_Concat_n routine is
-- available in the run time.
-- The debug flag gnatd.c is not set
-- If all these conditions are met then we generate a call to the
-- relevant concatenation routine. The purpose of this is to avoid
-- undesirable code bloat at -O0.
if Atyp = Standard_String
and then NN in 2 .. 9
and then (Opt.Optimization_Level = 0
or else Opt.Optimize_Size = 1
or else Debug_Flag_Dot_CC)
and then not Debug_Flag_Dot_C
then
declare
RR : constant array (Nat range 2 .. 9) of RE_Id :=
(RE_Str_Concat_2,
RE_Str_Concat_3,
RE_Str_Concat_4,
RE_Str_Concat_5,
RE_Str_Concat_6,
RE_Str_Concat_7,
RE_Str_Concat_8,
RE_Str_Concat_9);
begin
if RTE_Available (RR (NN)) then
declare
Opnds : constant List_Id :=
New_List (New_Occurrence_Of (Ent, Loc));
begin
for J in 1 .. NN loop
if Is_List_Member (Operands (J)) then
Remove (Operands (J));
end if;
if Base_Type (Etype (Operands (J))) = Ctyp then
Append_To (Opnds,
Make_Aggregate (Loc,
Component_Associations => New_List (
Make_Component_Association (Loc,
Choices => New_List (
Make_Integer_Literal (Loc, 1)),
Expression => Operands (J)))));
else
Append_To (Opnds, Operands (J));
end if;
end loop;
Insert_Action (Cnode,
Make_Procedure_Call_Statement (Loc,
Name => New_Reference_To (RTE (RR (NN)), Loc),
Parameter_Associations => Opnds));
Result := New_Reference_To (Ent, Loc);
goto Done;
end;
end if;
end;
end if;
-- Not special case so generate the assignments
Known_Non_Null_Operand_Seen := False; Known_Non_Null_Operand_Seen := False;
for J in 1 .. NN loop for J in 1 .. NN loop
......
...@@ -908,13 +908,20 @@ package Opt is ...@@ -908,13 +908,20 @@ package Opt is
Optimization_Level : Int; Optimization_Level : Int;
pragma Import (C, Optimization_Level, "optimize"); pragma Import (C, Optimization_Level, "optimize");
-- Constant reflecting the optimization level (0,1,2,3 for -O0,-O1,-O2,-O3) -- Constant reflecting the optimization level (0,1,2,3 for -O0,-O1,-O2,-O3)
-- See jmissing.c and aamissing.c for definitions for dotnet/jgnat and
-- GNAAMP back ends.
Optimize_Size : Int;
pragma Import (C, Optimize_Size, "optimize_size");
-- Constant reflecting setting of -Os (optimize for size). Set to 1 in
-- -Os mode and set to 0 otherwise. See jmissing.c and aamissing.c for
-- definitions for dotnet/jgnat and GNAAMP backends
Output_File_Name_Present : Boolean := False; Output_File_Name_Present : Boolean := False;
-- GNATBIND, GNAT, GNATMAKE, GPRMAKE -- GNATBIND, GNAT, GNATMAKE, GPRMAKE
-- Set to True when the output C file name is given with option -o -- Set to True when the output C file name is given with option -o for
-- for GNATBIND, when the object file name is given with option -- GNATBIND, when the object file name is given with option -gnatO for GNAT
-- -gnatO for GNAT or when the executable is given with option -o -- or when the executable is given with option -o for GNATMAKE or GPRMAKE.
-- for GNATMAKE or GPRMAKE.
Output_Linker_Option_List : Boolean := False; Output_Linker_Option_List : Boolean := False;
-- GNATBIND -- GNATBIND
......
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 2 --
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package body System.Concat_2 is
pragma Suppress (All_Checks);
------------------
-- Str_Concat_2 --
------------------
procedure Str_Concat_2 (R : out String; S1, S2 : String) is
F, L : Natural;
begin
F := R'First;
L := F + S1'Length - 1;
R (F .. L) := S1;
F := L + 1;
L := R'Last;
R (F .. L) := S2;
end Str_Concat_2;
end System.Concat_2;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 2 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains a procedure for runtime concatenation of two string
-- operands. It is used when we want to save space in the generated code.
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package System.Concat_2 is
procedure Str_Concat_2 (R : out String; S1, S2 : String);
-- Performs the operation R := S1 & S2. The bounds of R are known to be
-- correct, so no bounds checks are required, and it is known that none
-- of the input operands overlaps R. No assumptions can be made about
-- the lower bounds of any of the operands.
end System.Concat_2;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 3 --
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package body System.Concat_3 is
pragma Suppress (All_Checks);
------------------
-- Str_Concat_3 --
------------------
procedure Str_Concat_3 (R : out String; S1, S2, S3 : String) is
F, L : Natural;
begin
F := R'First;
L := F + S1'Length - 1;
R (F .. L) := S1;
F := L + 1;
L := F + S2'Length - 1;
R (F .. L) := S2;
F := L + 1;
L := R'Last;
R (F .. L) := S3;
end Str_Concat_3;
end System.Concat_3;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 3 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains a procedure for runtime concatenation of three string
-- operands. It is used when we want to save space in the generated code.
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package System.Concat_3 is
procedure Str_Concat_3 (R : out String; S1, S2, S3 : String);
-- Performs the operation R := S1 & S2 & S3. The bounds of R are known to
-- be correct, so no bounds checks are required, and it is known that none
-- of the input operands overlaps R. No assumptions can be made about
-- the lower bounds of any of the operands.
end System.Concat_3;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 4 --
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package body System.Concat_4 is
pragma Suppress (All_Checks);
------------------
-- Str_Concat_4 --
------------------
procedure Str_Concat_4 (R : out String; S1, S2, S3, S4 : String) is
F, L : Natural;
begin
F := R'First;
L := F + S1'Length - 1;
R (F .. L) := S1;
F := L + 1;
L := F + S2'Length - 1;
R (F .. L) := S2;
F := L + 1;
L := F + S3'Length - 1;
R (F .. L) := S3;
F := L + 1;
L := R'Last;
R (F .. L) := S4;
end Str_Concat_4;
end System.Concat_4;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 4 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains a procedure for runtime concatenation of four string
-- operands. It is used when we want to save space in the generated code.
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package System.Concat_4 is
procedure Str_Concat_4 (R : out String; S1, S2, S3, S4 : String);
-- Performs the operation R := S1 & S2 & S3 & S4. The bounds of R are known
-- to be correct, so no bounds checks are required, and it is known that
-- none of the input operands overlaps R. No assumptions can be made about
-- the lower bounds of any of the operands.
end System.Concat_4;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 5 --
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package body System.Concat_5 is
pragma Suppress (All_Checks);
------------------
-- Str_Concat_5 --
------------------
procedure Str_Concat_5 (R : out String; S1, S2, S3, S4, S5 : String) is
F, L : Natural;
begin
F := R'First;
L := F + S1'Length - 1;
R (F .. L) := S1;
F := L + 1;
L := F + S2'Length - 1;
R (F .. L) := S2;
F := L + 1;
L := F + S3'Length - 1;
R (F .. L) := S3;
F := L + 1;
L := F + S4'Length - 1;
R (F .. L) := S4;
F := L + 1;
L := R'Last;
R (F .. L) := S5;
end Str_Concat_5;
end System.Concat_5;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 5 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains a procedure for runtime concatenation of five string
-- operands. It is used when we want to save space in the generated code.
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package System.Concat_5 is
procedure Str_Concat_5 (R : out String; S1, S2, S3, S4, S5 : String);
-- Performs the operation R := S1 & S2 & S3 & S4 & S5. The bounds of R are
-- known to be correct, so no bounds checks are required, and it is known
-- that none of the input operands overlaps R. No assumptions can be made
-- about the lower bounds of any of the operands.
end System.Concat_5;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 6 --
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package body System.Concat_6 is
pragma Suppress (All_Checks);
------------------
-- Str_Concat_6 --
------------------
procedure Str_Concat_6 (R : out String; S1, S2, S3, S4, S5, S6 : String) is
F, L : Natural;
begin
F := R'First;
L := F + S1'Length - 1;
R (F .. L) := S1;
F := L + 1;
L := F + S2'Length - 1;
R (F .. L) := S2;
F := L + 1;
L := F + S3'Length - 1;
R (F .. L) := S3;
F := L + 1;
L := F + S4'Length - 1;
R (F .. L) := S4;
F := L + 1;
L := F + S5'Length - 1;
R (F .. L) := S5;
F := L + 1;
L := R'Last;
R (F .. L) := S6;
end Str_Concat_6;
end System.Concat_6;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 6 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains a procedure for runtime concatenation of six string
-- operands. It is used when we want to save space in the generated code.
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package System.Concat_6 is
procedure Str_Concat_6 (R : out String; S1, S2, S3, S4, S5, S6 : String);
-- Performs the operation R := S1 & S2 & S3 & S4 & S5 & S6. The bounds of
-- R are known to be correct, so no bounds checks are required, and it is
-- known that none of the input operands overlaps R. No assumptions can be
-- made about the lower bounds of any of the operands.
end System.Concat_6;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 7 --
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package body System.Concat_7 is
pragma Suppress (All_Checks);
------------------
-- Str_Concat_7 --
------------------
procedure Str_Concat_7
(R : out String;
S1, S2, S3, S4, S5, S6, S7 : String)
is
F, L : Natural;
begin
F := R'First;
L := F + S1'Length - 1;
R (F .. L) := S1;
F := L + 1;
L := F + S2'Length - 1;
R (F .. L) := S2;
F := L + 1;
L := F + S3'Length - 1;
R (F .. L) := S3;
F := L + 1;
L := F + S4'Length - 1;
R (F .. L) := S4;
F := L + 1;
L := F + S5'Length - 1;
R (F .. L) := S5;
F := L + 1;
L := F + S6'Length - 1;
R (F .. L) := S6;
F := L + 1;
L := R'Last;
R (F .. L) := S7;
end Str_Concat_7;
end System.Concat_7;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 7 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains a procedure for runtime concatenation of seven string
-- operands. It is used when we want to save space in the generated code.
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package System.Concat_7 is
procedure Str_Concat_7
(R : out String;
S1, S2, S3, S4, S5, S6, S7 : String);
-- Performs the operation R := S1 & S2 & S3 & S4 & S5 & S6 & S7. The bounds
-- of R are known to be correct, so no bounds checks are required, and it
-- is known that none of the input operands overlaps R. No assumptions can
-- be made about the lower bounds of any of the operands.
end System.Concat_7;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 8 --
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package body System.Concat_8 is
pragma Suppress (All_Checks);
------------------
-- Str_Concat_8 --
------------------
procedure Str_Concat_8
(R : out String;
S1, S2, S3, S4, S5, S6, S7, S8 : String)
is
F, L : Natural;
begin
F := R'First;
L := F + S1'Length - 1;
R (F .. L) := S1;
F := L + 1;
L := F + S2'Length - 1;
R (F .. L) := S2;
F := L + 1;
L := F + S3'Length - 1;
R (F .. L) := S3;
F := L + 1;
L := F + S4'Length - 1;
R (F .. L) := S4;
F := L + 1;
L := F + S5'Length - 1;
R (F .. L) := S5;
F := L + 1;
L := F + S6'Length - 1;
R (F .. L) := S6;
F := L + 1;
L := F + S7'Length - 1;
R (F .. L) := S7;
F := L + 1;
L := R'Last;
R (F .. L) := S8;
end Str_Concat_8;
end System.Concat_8;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 8 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains a procedure for runtime concatenation of eight string
-- operands. It is used when we want to save space in the generated code.
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package System.Concat_8 is
procedure Str_Concat_8
(R : out String;
S1, S2, S3, S4, S5, S6, S7, S8 : String);
-- Performs the operation R := S1 & S2 & S3 & S4 & S5 & S6 & S7 & S8. The
-- bounds of R are known to be correct, so no bounds checks are required,
-- and it is known that none of the input operands overlaps R. No
-- assumptions can be made about the lower bounds of any of the operands.
end System.Concat_8;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 9 --
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package body System.Concat_9 is
pragma Suppress (All_Checks);
------------------
-- Str_Concat_9 --
------------------
procedure Str_Concat_9
(R : out String;
S1, S2, S3, S4, S5, S6, S7, S8, S9 : String)
is
F, L : Natural;
begin
F := R'First;
L := F + S1'Length - 1;
R (F .. L) := S1;
F := L + 1;
L := F + S2'Length - 1;
R (F .. L) := S2;
F := L + 1;
L := F + S3'Length - 1;
R (F .. L) := S3;
F := L + 1;
L := F + S4'Length - 1;
R (F .. L) := S4;
F := L + 1;
L := F + S5'Length - 1;
R (F .. L) := S5;
F := L + 1;
L := F + S6'Length - 1;
R (F .. L) := S6;
F := L + 1;
L := F + S7'Length - 1;
R (F .. L) := S7;
F := L + 1;
L := F + S8'Length - 1;
R (F .. L) := S8;
F := L + 1;
L := R'Last;
R (F .. L) := S9;
end Str_Concat_9;
end System.Concat_9;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 9 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains a procedure for runtime concatenation of eight string
-- operands. It is used when we want to save space in the generated code.
pragma Warnings (Off);
pragma Compiler_Unit;
pragma Warnings (On);
package System.Concat_9 is
procedure Str_Concat_9
(R : out String;
S1, S2, S3, S4, S5, S6, S7, S8, S9 : String);
-- Performs the operation R := S1 & S2 & S3 & S4 & S5 & S6 & S7 & S8 & S9.
-- The bounds of R are known to be correct, so no bounds checks are
-- required, and it is known that none of the input operands overlaps R. No
-- assumptions can be made about the lower bounds of any of the operands.
end System.Concat_9;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment