aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2019-08-20 09:48:02 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-08-20 09:48:02 +0000
commitb6ad3c0844bd20dece60aa20ccd3a196d34290d9 (patch)
tree048a29a3845164ff05b83eee1463d63b74048858
parent2beee64ae080305808720f839b6ca7bc280aed74 (diff)
downloadgcc-b6ad3c0844bd20dece60aa20ccd3a196d34290d9.zip
gcc-b6ad3c0844bd20dece60aa20ccd3a196d34290d9.tar.gz
gcc-b6ad3c0844bd20dece60aa20ccd3a196d34290d9.tar.bz2
[Ada] Revert change for gnatprove that is no longer needed
Years ago, we adapted Get_Kind_Of_Unit so that gnatprove could use it to detect both bodies and specs of predefined units. However, this wasn't really needed: gnatprove could simply reuse Lib.In_Predefined_Unit and now it does. This patch simply reverts two commits mentioned above. No frontend test provided, because the removed comment is clear that this doesn't affect the compiler. Other tools similarly should not be affected (at least they were not when this change was introduced in 2012). 2019-08-20 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * impunit.adb (Get_Kind_Of_Unit): Revert change for adapting this routine for gnatprove. From-SVN: r274718
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/impunit.adb17
2 files changed, 9 insertions, 13 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index a6f680c..b1640e2 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2019-08-20 Piotr Trojanek <trojanek@adacore.com>
+
+ * impunit.adb (Get_Kind_Of_Unit): Revert change for adapting
+ this routine for gnatprove.
+
2019-08-20 Arnaud Charlet <charlet@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst: Document
diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb
index 4cf8535..7e67569 100644
--- a/gcc/ada/impunit.adb
+++ b/gcc/ada/impunit.adb
@@ -692,19 +692,10 @@ package body Impunit is
return Not_Predefined_Unit;
end if;
- -- To be considered predefined, the file name must end in .ads or .adb.
- -- File names with other extensions (coming from the use of non-standard
- -- file naming schemes) can never be predefined.
-
- -- Note that in the context of a compiler, the .adb case will never
- -- arise. However it can arise for other tools, e.g. gnatprove uses
- -- this routine to detect when a construct comes from an instance of
- -- a generic defined in a predefined unit.
-
- if File (File'Last - 3 .. File'Last) /= ".ads"
- and then
- File (File'Last - 3 .. File'Last) /= ".adb"
- then
+ -- Not predefined if file name does not end in .ads. This can happen
+ -- when non-standard file names are being used.
+
+ if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads" then
return Not_Predefined_Unit;
end if;