aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorViljar Indus <indus@adacore.com>2023-10-11 13:53:10 +0300
committerMarc Poulhiès <poulhies@adacore.com>2023-11-07 10:15:01 +0100
commita4a24e5868c5e2b626f399cd657573a6bf81e646 (patch)
tree07da4d6bf674d0c5aef0a7b266e469bb53d435d9 /gcc
parent95b8d1b5b5507200724445a98d6c54e0f5bef7c5 (diff)
downloadgcc-a4a24e5868c5e2b626f399cd657573a6bf81e646.zip
gcc-a4a24e5868c5e2b626f399cd657573a6bf81e646.tar.gz
gcc-a4a24e5868c5e2b626f399cd657573a6bf81e646.tar.bz2
ada: Simplify code for Ignore_Style_Checks_Pragmas
gcc/ada/ * sem_prag.adb: (Analyze_Pragma): Reduce the number of nested if statements.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_prag.adb26
1 files changed, 11 insertions, 15 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index b765575..c391e27 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -25109,6 +25109,10 @@ package body Sem_Prag is
else
Check_Arg_Count (1);
+ if Ignore_Style_Checks_Pragmas then
+ return;
+ end if;
+
if Nkind (A) = N_String_Literal then
S := Strval (A);
@@ -25129,9 +25133,7 @@ package body Sem_Prag is
-- them in the parser.
if J = Slen then
- if not Ignore_Style_Checks_Pragmas then
- Set_Style_Check_Options (Options);
- end if;
+ Set_Style_Check_Options (Options);
exit;
end if;
@@ -25142,23 +25144,17 @@ package body Sem_Prag is
elsif Nkind (A) = N_Identifier then
if Chars (A) = Name_All_Checks then
- if not Ignore_Style_Checks_Pragmas then
- if GNAT_Mode then
- Set_GNAT_Style_Check_Options;
- else
- Set_Default_Style_Check_Options;
- end if;
+ if GNAT_Mode then
+ Set_GNAT_Style_Check_Options;
+ else
+ Set_Default_Style_Check_Options;
end if;
elsif Chars (A) = Name_On then
- if not Ignore_Style_Checks_Pragmas then
- Style_Check := True;
- end if;
+ Style_Check := True;
elsif Chars (A) = Name_Off then
- if not Ignore_Style_Checks_Pragmas then
- Style_Check := False;
- end if;
+ Style_Check := False;
end if;
end if;
end if;