diff options
author | Geert Bosch <bosch@adacore.com> | 2007-04-06 11:23:23 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-04-06 11:23:23 +0200 |
commit | 815f44d0cd91db97ee2793bcdf007f498f78f8aa (patch) | |
tree | 3dae18939bf7386b4ee86c6180790a3c352c21c5 /gcc/ada/impunit.adb | |
parent | 0ee3046437815605b29af1b39aa17596286078ca (diff) | |
download | gcc-815f44d0cd91db97ee2793bcdf007f498f78f8aa.zip gcc-815f44d0cd91db97ee2793bcdf007f498f78f8aa.tar.gz gcc-815f44d0cd91db97ee2793bcdf007f498f78f8aa.tar.bz2 |
i-fortra.ads: Add Double_Complex type.
2007-04-06 Geert Bosch <bosch@adacore.com>
Robert Dewar <dewar@adacore.com>
* i-fortra.ads: Add Double_Complex type.
* impunit.adb: (Is_Known_Unit): New function
Add Gnat.Byte_Swapping
Add GNAT.SHA1
Add new Ada 2005 units
Ada.Numerics.Generic_Complex_Arrays, Ada.Numerics.Generic_Real_Arrays,
Ada.Numerics.Complex_Arrays, Ada.Numerics.Real_Arrays,
Ada.Numerics.Long_Complex_Arrays, Ada.Numerics.Long_Long_Complex_Arrays,
Ada.Numerics.Long_Long_Real_Arrays and Ada.Numerics.Long_Real_Arrays
* impunit.ads (Is_Known_Unit): New function
* a-ngcoar.adb, a-ngcoar.ads, a-ngrear.adb,
a-ngrear.ads, a-nlcoar.ads, a-nllcar.ads, a-nllrar.ads, a-nlrear.ads,
a-nucoar.ads, a-nurear.ads, g-bytswa.adb, g-bytswa-x86.adb,
g-bytswa.ads, g-sha1.adb, g-sha1.ads, i-forbla.ads, i-forlap.ads,
s-gearop.adb, s-gearop.ads, s-gecobl.adb, s-gecobl.ads, s-gecola.adb,
s-gecola.ads, s-gerebl.adb, s-gerebl.ads, s-gerela.adb, s-gerela.ads:
New files.
* Makefile.rtl: Add g-bytswa, g-sha1, a-fzteio and a-izteio
* a-fzteio.ads, a-izteio.ads: New Ada 2005 run-time units.
From-SVN: r123579
Diffstat (limited to 'gcc/ada/impunit.adb')
-rw-r--r-- | gcc/ada/impunit.adb | 89 |
1 files changed, 87 insertions, 2 deletions
diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb index e849797..ff5e88b 100644 --- a/gcc/ada/impunit.adb +++ b/gcc/ada/impunit.adb @@ -24,8 +24,12 @@ -- -- ------------------------------------------------------------------------------ -with Lib; use Lib; -with Namet; use Namet; +with Atree; use Atree; +with Sinfo; use Sinfo; +with Fname.UF; use Fname.UF; +with Lib; use Lib; +with Namet; use Namet; +with Uname; use Uname; package body Impunit is @@ -207,6 +211,7 @@ package body Impunit is "g-bubsor", -- GNAT.Bubble_Sort "g-busora", -- GNAT.Bubble_Sort_A "g-busorg", -- GNAT.Bubble_Sort_G + "g-bytswa", -- Gnat.Byte_Swapping "g-calend", -- GNAT.Calendar "g-casuti", -- GNAT.Case_Util "g-catiio", -- GNAT.Calendar.Time_IO @@ -246,6 +251,7 @@ package body Impunit is "g-regpat", -- GNAT.Regpat "g-semaph", -- GNAT.Semaphores "g-sestin", -- GNAT.Secondary_Stack_Info + "g-sha1 ", -- GNAT.SHA1 "g-signal", -- GNAT.Signals "g-socket", -- GNAT.Sockets "g-souinf", -- GNAT.Source_Info @@ -359,6 +365,10 @@ package body Impunit is "a-dispat", -- Ada.Dispatching "a-envvar", -- Ada.Environment_Variables "a-rttiev", -- Ada.Real_Time.Timing_Events + "a-ngcoar", -- Ada.Numerics.Generic_Complex_Arrays + "a-ngrear", -- Ada.Numerics.Generic_Real_Arrays + "a-nucoar", -- Ada.Numerics.Complex_Arrays + "a-nurear", -- Ada.Numerics.Real_Arrays "a-stboha", -- Ada.Strings.Bounded.Hash "a-stfiha", -- Ada.Strings.Fixed.Hash "a-strhas", -- Ada.Strings.Hash @@ -401,6 +411,10 @@ package body Impunit is "a-llctio", -- Ada.Long_Long_Complex_Text_IO "a-llfzti", -- Ada.Long_Long_Float_Wide_Wide_Text_IO "a-llizti", -- Ada.Long_Long_Integer_Wide_Wide_Text_IO + "a-nlcoar", -- Ada.Numerics.Long_Complex_Arrays + "a-nllcar", -- Ada.Numerics.Long_Long_Complex_Arrays + "a-nllrar", -- Ada.Numerics.Long_Long_Real_Arrays + "a-nlrear", -- Ada.Numerics.Long_Real_Arrays "a-scteio", -- Ada.Short_Complex_Text_IO "a-sfztio", -- Ada.Short_Float_Wide_Wide_Text_IO "a-siztio", -- Ada.Short_Integer_Wide_Wide_Text_IO @@ -536,4 +550,75 @@ package body Impunit is return Implementation_Unit; end Get_Kind_Of_Unit; + ------------------- + -- Is_Known_Unit -- + ------------------- + + function Is_Known_Unit (Nam : Node_Id) return Boolean is + Unam : Unit_Name_Type; + Fnam : File_Name_Type; + + begin + -- If selector is not an identifier (e.g. it is a character literal or + -- some junk from a previous error), then definitely not a known unit. + + if Nkind (Selector_Name (Nam)) /= N_Identifier then + return False; + end if; + + -- Otherwise get corresponding file name + + Unam := Get_Unit_Name (Nam); + Fnam := Get_File_Name (Unam, Subunit => False); + Get_Name_String (Fnam); + + -- Remove extension from file name + + if Name_Buffer (Name_Len - 3 .. Name_Len) = ".adb" then + Name_Len := Name_Len - 4; + else + return False; + end if; + + -- Pad name to 8 characters + + while Name_Len < 8 loop + Name_Len := Name_Len + 1; + Name_Buffer (Name_Len) := ' '; + end loop; + + -- If length more than 8, definitely not a match + + if Name_Len /= 8 then + return False; + end if; + + -- If length is 8, search our tables + + for J in Non_Imp_File_Names_95'Range loop + if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J) then + return True; + end if; + end loop; + + for J in Non_Imp_File_Names_05'Range loop + if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J) then + return True; + end if; + end loop; + + -- If not found, not known + + return False; + + -- A safety guard, if we get an exception during this processing then it + -- is most likely the result of a previous error, or a peculiar case we + -- have not thought of. Since this routine is only used for error message + -- refinement, we will just return False. + + exception + when others => + return False; + end Is_Known_Unit; + end Impunit; |