Add Comments::const_child_iterator and (const_)child_range

Andre Vehreschild via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 1 07:49:06 PDT 2016


Hi all,

this is my first patch, so please be patient. I normaly submit to gfortran and their policies for submission are somewhat different.

Subject of the patch: 

The patch adds the missing const_child_iterator to all Comment classes and changes the mutable child_iterator to be mutable again. This of course needed some changes in other places: where formerly the immutable child_iterator was used now the const_child_iterator is needed. These changes are also applied by the patch. A comment at the child_iterator describes the change and advises the use of the const_-version when compile issues are encountered in tools using clang.

Furthermore does the patch add the range-accessor to all Comment classes enabling the use of children() in the for-range loop. This is modelled using the Stmt::children() implementation as a blueprint.

Regtests ok on x86_64-linux-gnu/F23 and x86_64-win64/Win7 using Visual Studio 12.

Any comment?

Regards,
Andre
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CommentsIteratorRange.patch
Type: application/octet-stream
Size: 22349 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160601/dedad066/attachment-0001.obj>


More information about the cfe-commits mailing list