public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-1635] [Ada] Simplify rewriting of attributes into Boolean literals
@ 2022-07-12 12:26 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-07-12 12:26 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:a24614ec4918d00f0c0761ba987cd15374b3ac43
commit r13-1635-ga24614ec4918d00f0c0761ba987cd15374b3ac43
Author: Piotr Trojanek <trojanek@adacore.com>
Date: Tue Jan 11 20:41:13 2022 +0100
[Ada] Simplify rewriting of attributes into Boolean literals
Code cleanup; semantics is unaffected.
gcc/ada/
* sem_attr.adb (Set_Boolean_Result): Simplify using
Boolean_Literals.
Diff:
---
gcc/ada/sem_attr.adb | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index cab2461a39c..adeda43bd87 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -12778,13 +12778,8 @@ package body Sem_Attr is
------------------------
procedure Set_Boolean_Result (N : Node_Id; B : Boolean) is
- Loc : constant Source_Ptr := Sloc (N);
begin
- if B then
- Rewrite (N, New_Occurrence_Of (Standard_True, Loc));
- else
- Rewrite (N, New_Occurrence_Of (Standard_False, Loc));
- end if;
+ Rewrite (N, New_Occurrence_Of (Boolean_Literals (B), Sloc (N)));
end Set_Boolean_Result;
--------------------------------
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-12 12:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 12:26 [gcc r13-1635] [Ada] Simplify rewriting of attributes into Boolean literals Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).