From: Piotr Trojanek Date: Thu, 31 May 2018 10:46:17 +0000 (+0000) Subject: [Ada] Set Etype on rewriteen Max_Queue_Length expressions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7366d29a546c6ea55a6fe8d2a131dc16c892f4b3;p=gcc.git [Ada] Set Etype on rewriteen Max_Queue_Length expressions Rewriting of Max_Queue_Length expression into N_Integer_Literal should probably be done in expansion and not in analysis, but anyway it should not strip the expression from its Etype because backends (e.g. GNATprove) expect that Etype to be present. No frontend test is provided, because GNAT doesn't care about the missing Etype decoration. This patch allows to simplify AST processing in GNATprove. 2018-05-31 Piotr Trojanek gcc/ada/ * sem_prag.adb (Analyze_Pragma): Set Etype on the rewritten Max_Queue_Length expression. From-SVN: r261002 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 45a4bfd0311..a58cfe85b95 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-05-31 Piotr Trojanek + + * sem_prag.adb (Analyze_Pragma): Set Etype on the rewritten + Max_Queue_Length expression. + 2018-05-31 Sergey Rybin * doc/gnat_ugn/gnat_and_program_execution.rst: gnatelim does not need diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index b75b318d2ef..e80c297cd09 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -18833,6 +18833,7 @@ package body Sem_Prag is if Nkind (Arg) /= N_Integer_Literal then Rewrite (Arg, Make_Integer_Literal (Sloc (Arg), Val)); + Set_Etype (Arg, Etype (Original_Node (Arg))); end if; Record_Rep_Item (Entry_Id, N);