]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Accept concatentation arguments to pragma Annotate
authorSteve Baird <baird@adacore.com>
Thu, 19 Sep 2019 08:14:52 +0000 (08:14 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 19 Sep 2019 08:14:52 +0000 (08:14 +0000)
commit0c27222c60b26cd21588576f140abd04f1d8a853
tree644c9e9873f147c02c00846ae01ab92a4e3d0feb
parentc3a75a09b8424c192b32a39fa273d27db5b9c039
[Ada] Accept concatentation arguments to pragma Annotate

In cases where pragma Annotate accepts a string literal as an argument,
we now also accept a concatenation of string literals.

2019-09-19  Steve Baird  <baird@adacore.com>

gcc/ada/

* sem_prag.adb (Preferred_String_Type): A new function. Given an
expression, determines whether the preference rules defined for
the third-and-later arguments of pragma Annotate suffice to
determine the type of the expression. If so, then the preferred
type is returned; if not then Empty is returned. Handles
concatenations.
(Analyze_Pragma): Replace previous code, which dealt only with
string literals, with calls to the new Preferred_String_Type
function, which also handles concatenations.
* doc/gnat_rm/implementation_defined_pragmas.rst: Update
documentation for pragma Annotate.
* gnat_rm.texi: Regenerate.

gcc/testsuite/

* gnat.dg/annotation1.adb: New testcase.

From-SVN: r275957
gcc/ada/ChangeLog
gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
gcc/ada/gnat_rm.texi
gcc/ada/sem_prag.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/annotation1.adb [new file with mode: 0644]