]> granicus.if.org Git - clang/commit
Cut-off clang-format analysis.
authorDaniel Jasper <djasper@google.com>
Wed, 22 May 2013 05:27:42 +0000 (05:27 +0000)
committerDaniel Jasper <djasper@google.com>
Wed, 22 May 2013 05:27:42 +0000 (05:27 +0000)
commit54b4e4468ec2bcd381ede70e1391bcdb59b8fd1a
tree8bbde35c87706a5c4b7105b8eca19413428e9bc2
parent61dfd6f160f7501e140704990db9c449d29f8649
Cut-off clang-format analysis.

If clang-format is confronted with long and deeply nested lines (e.g.
complex static initializers or function calls), it can currently try too
hard to find the optimal solution and never finish. The reason is that
the memoization does not work effectively for deeply nested lines.

This patch removes an earlier workaround and instead opts for
accepting a non-optimal solution in rare cases. However, it only does
so only in cases where it would have to analyze an excessive number of
states (currently set to 10000 - the most complex line in Format.cpp
requires ~800 states) so this should not change the behavior in a
relevant way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182449 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/Format.cpp
lib/Format/TokenAnnotator.cpp
lib/Format/TokenAnnotator.h
unittests/Format/FormatTest.cpp