[clang-format] Make parseUnaryOperator non-recursive, NFCI
authorKrasimir Georgiev <krasimir@google.com>
Wed, 1 Nov 2017 18:20:41 +0000 (18:20 +0000)
committerKrasimir Georgiev <krasimir@google.com>
Wed, 1 Nov 2017 18:20:41 +0000 (18:20 +0000)
commit87b42549ee3a93dc17806b9e99fa699bb65a360c
tree5c987d9ea43a1b63e8a70c3aee66ef0d5ec60739
parentca1aa83cbe22e5b3aa7345a6fd7d0e4d4b1f1d64
[clang-format] Make parseUnaryOperator non-recursive, NFCI

Summary:
This patch makes the implementation of parseUnaryOperator non-recursive. We had
a problem with a file starting with tens of thousands of +'es and -'es which
caused clang-format to stack overflow.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D39498

llvm-svn: 317113
clang/lib/Format/TokenAnnotator.cpp