diff options
Diffstat (limited to 'gcc/ada/lib.adb')
-rw-r--r-- | gcc/ada/lib.adb | 60 |
1 files changed, 17 insertions, 43 deletions
diff --git a/gcc/ada/lib.adb b/gcc/ada/lib.adb index c4afe04d0e4..7c5db5df88b 100644 --- a/gcc/ada/lib.adb +++ b/gcc/ada/lib.adb @@ -447,49 +447,23 @@ package body Lib is return False; end Entity_Is_In_Main_Unit; - --------------------------------- - -- Generic_Separately_Compiled -- - --------------------------------- - - function Generic_Separately_Compiled (E : Entity_Id) return Boolean is - begin - -- We do not generate object files for internal generics, because - -- the only thing they would contain is the elaboration boolean, and - -- we are careful to elaborate all predefined units first anyway, so - -- this boolean is not needed. - - if Is_Internal_File_Name - (Fname => Unit_File_Name (Get_Source_Unit (E)), - Renamings_Included => True) - then - return False; - - -- All other generic units do generate object files - - else - return True; - end if; - end Generic_Separately_Compiled; - - function Generic_Separately_Compiled - (Sfile : File_Name_Type) return Boolean - is - begin - -- Exactly the same as previous function, but works directly on a file - -- name. - - if Is_Internal_File_Name - (Fname => Sfile, - Renamings_Included => True) - then - return False; - - -- All other generic units do generate object files - - else - return True; - end if; - end Generic_Separately_Compiled; + -------------------------- + -- Generic_May_Lack_ALI -- + -------------------------- + + function Generic_May_Lack_ALI (Sfile : File_Name_Type) return Boolean is + begin + -- We allow internal generic units to be used without having a + -- corresponding ALI files to help bootstrapping with older compilers + -- that did not support generating ALIs for such generics. It is safe + -- to do so because the only thing the generated code would contain + -- is the elaboration boolean, and we are careful to elaborate all + -- predefined units first anyway. + + return Is_Internal_File_Name + (Fname => Sfile, + Renamings_Included => True); + end Generic_May_Lack_ALI; ----------------------------- -- Get_Code_Or_Source_Unit -- |