summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.h
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-05-22 05:27:42 +0000
committerDaniel Jasper <djasper@google.com>2013-05-22 05:27:42 +0000
commitf8114cf6217da880d567db27776754c32df7ca8e (patch)
treeb7dd4ea3b2b5e6e68669795675ed7ff48ebd35f7 /clang/lib/Format/TokenAnnotator.h
parent3fdbaff3b9750bbf326a99d21d3bd41309657d64 (diff)
downloadbcm5719-llvm-f8114cf6217da880d567db27776754c32df7ca8e.tar.gz
bcm5719-llvm-f8114cf6217da880d567db27776754c32df7ca8e.zip
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. llvm-svn: 182449
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.h')
-rw-r--r--clang/lib/Format/TokenAnnotator.h16
1 files changed, 1 insertions, 15 deletions
diff --git a/clang/lib/Format/TokenAnnotator.h b/clang/lib/Format/TokenAnnotator.h
index 227dd523960..be4390a5926 100644
--- a/clang/lib/Format/TokenAnnotator.h
+++ b/clang/lib/Format/TokenAnnotator.h
@@ -78,8 +78,7 @@ public:
ParameterCount(0), TotalLength(FormatTok.TokenLength),
BindingStrength(0), SplitPenalty(0), LongestObjCSelectorName(0),
DefinesFunctionType(false), Parent(NULL), FakeRParens(0),
- LastInChainOfCalls(false), PartOfMultiVariableDeclStmt(false),
- NoMoreTokensOnLevel(false) {}
+ LastInChainOfCalls(false), PartOfMultiVariableDeclStmt(false) {}
bool is(tok::TokenKind Kind) const { return FormatTok.Tok.is(Kind); }
@@ -189,19 +188,6 @@ public:
/// Only set if \c Type == \c TT_StartOfName.
bool PartOfMultiVariableDeclStmt;
- /// \brief Set to \c true for "("-tokens if this is the last token other than
- /// ")" in the next higher parenthesis level.
- ///
- /// If this is \c true, no more formatting decisions have to be made on the
- /// next higher parenthesis level, enabling optimizations.
- ///
- /// Example:
- /// \code
- /// aaaaaa(aaaaaa());
- /// ^ // Set to true for this parenthesis.
- /// \endcode
- bool NoMoreTokensOnLevel;
-
/// \brief Returns the previous token ignoring comments.
AnnotatedToken *getPreviousNoneComment() const;
OpenPOWER on IntegriCloud