aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch5.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-04-15 14:52:48 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-04-15 14:52:48 +0200
commit4a13695ca1f5a81aa054ff52e15705b88016bd17 (patch)
treec697b3c422f469e9dda6aebd785df1cac6bb0330 /gcc/ada/sem_ch5.adb
parentc3b36d484f5b232e882a0535bf275329dc91f3a4 (diff)
downloadgcc-4a13695ca1f5a81aa054ff52e15705b88016bd17.zip
gcc-4a13695ca1f5a81aa054ff52e15705b88016bd17.tar.gz
gcc-4a13695ca1f5a81aa054ff52e15705b88016bd17.tar.bz2
[multiple changes]
2009-04-15 Bob Duff <duff@adacore.com> * sem_ch5.adb (Analyze_Loop_Statement): Don't check for infinite loop warnings unless the loop comes from source, because checking generated loops is a waste of time, and makes it harder to debug Check_Infinite_Loop_Warning. * sem_warn.adb (Check_Infinite_Loop_Warning): If the local variable tested in the while loop is a renaming, do not warn. Otherwise, we get false alarms, because it's usually renaming something that we can't deal with (an indexed component, a global variable, ...). * gnat_rm.texi: Fix typo 2009-04-15 Thomas Quinot <quinot@adacore.com> * sem_ch6.adb: Minor reformatting From-SVN: r146111
Diffstat (limited to 'gcc/ada/sem_ch5.adb')
-rw-r--r--gcc/ada/sem_ch5.adb7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 6a387d6..dab9871 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -2031,7 +2031,12 @@ package body Sem_Ch5 is
Process_End_Label (Loop_Statement, 'e', Ent);
End_Scope;
Kill_Current_Values;
- Check_Infinite_Loop_Warning (N);
+
+ -- No point in checking for warnings in code we generated
+
+ if Comes_From_Source (N) then
+ Check_Infinite_Loop_Warning (N);
+ end if;
-- Code after loop is unreachable if the loop has no WHILE or FOR
-- and contains no EXIT statements within the body of the loop.