Commit 27572ba3 by Yannick Moy Committed by Pierre-Marie de Rodat

[Ada] Allow multiple units per file in GNATprove

For analysis tools that rely on information generated in ALI files, but
do not generate object files, the frontend did not generate the special
extension names like file~2.ali for unit 2 in the file. This is needed
to be able to analyze files with multiple units. Now fixed.

There is no impact on compilation.

2019-07-10  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* osint-c.adb (Set_File_Name): Always add extension for multiple
	units per file mode.

From-SVN: r273339
parent 9ab234e5
2019-07-10 Yannick Moy <moy@adacore.com>
* osint-c.adb (Set_File_Name): Always add extension for multiple
units per file mode.
2019-07-10 Corentin Gay <gay@adacore.com> 2019-07-10 Corentin Gay <gay@adacore.com>
* sysdep.c: Put include directive for 'vxWorks.h' before any * sysdep.c: Put include directive for 'vxWorks.h' before any
......
...@@ -385,18 +385,8 @@ package body Osint.C is ...@@ -385,18 +385,8 @@ package body Osint.C is
end if; end if;
end loop; end loop;
-- Make sure that the output file name matches the source file name. -- If we are in multiple-units-per-file mode, then add a ~nnn extension
-- To compare them, remove file name directories and extensions. -- to the name.
if Output_Object_File_Name /= null then
-- Make sure there is a dot at Dot_Index. This may not be the case
-- if the source file name has no extension.
Name_Buffer (Dot_Index) := '.';
-- If we are in multiple unit per file mode, then add ~nnn
-- extension to the name before doing the comparison.
if Multiple_Unit_Index /= 0 then if Multiple_Unit_Index /= 0 then
declare declare
...@@ -410,6 +400,16 @@ package body Osint.C is ...@@ -410,6 +400,16 @@ package body Osint.C is
end; end;
end if; end if;
-- Make sure that the output file name matches the source file name.
-- To compare them, remove file name directories and extensions.
if Output_Object_File_Name /= null then
-- Make sure there is a dot at Dot_Index. This may not be the case
-- if the source file name has no extension.
Name_Buffer (Dot_Index) := '.';
-- Remove extension preparing to replace it -- Remove extension preparing to replace it
declare declare
......
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