]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/ada/checks.adb
2007-12-19 Bob Duff <duff@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Dec 2007 16:22:40 +0000 (16:22 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Dec 2007 16:22:40 +0000 (16:22 +0000)
commit8f6e4fd5198fe412bfe9e39f4ef8262a3feea6ba
tree332b098dbd6b86d59d72a861304c31b6b5b32d63
parent959a86c677baec8142b74c3de2ac67bd24d19604
2007-12-19  Bob Duff  <duff@adacore.com>

* atree.ads, atree.adb (Traverse_Func): Walk Field2 last, and eliminate
the resulting tail recursion by hand. This prevents running out of
memory on deeply nested concatenations, since Field2 is where the left
operand of concatenations is stored.
Fix bug (was returning OK_Orig in some cases). Fix return subtype to
clarify that it can only return OK or Abandon.

* sem_res.adb (Resolve_Op_Concat): Replace the recursion on the left
operand by iteration, in order to avoid running out of memory on
deeply-nested concatenations. Use the Parent pointer to get back up the
tree.
(Resolve_Op_Concat_Arg, Resolve_Op_Concat_First,
 Resolve_Op_Concat_Rest): New procedures split out of
Resolve_Op_Concat, so the iterative algorithm in Resolve_Op_Concat is
clearer.

* checks.adb (Remove_Checks): Use Traverse_Proc instead of
Traverse_Func, because the former already takes care of discarding the
result.

* errout.adb (First_Node): Use Traverse_Proc instead of Traverse_Func,
because the former already takes care of discarding the result.
(Remove_Warning_Messages): Use appropriate subtype for Status and
Discard

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131070 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/atree.adb
gcc/ada/atree.ads
gcc/ada/checks.adb
gcc/ada/errout.adb
gcc/ada/sem_res.adb