aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/TokenAnnotator.h
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-11-25 11:08:59 +0000
committerDaniel Jasper <djasper@google.com>2013-11-25 11:08:59 +0000
commitf876984cc6be6c1c07fbe0df1084c1b755585414 (patch)
tree7bbaa1df674ce504cb931a3cb8d5cc1c74330d7d /lib/Format/TokenAnnotator.h
parent7cee9a7cf9e84036771d7b51bffd4b4aaa1f9831 (diff)
clang-format: Refactor calculation of lines intersecting with -lines.
No functional changes intended. However, it seems to have found a buggy behavior in one of the tests. I think this structure is generally desirable and it will make a planned bugfix significantly easier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195634 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/TokenAnnotator.h')
-rw-r--r--lib/Format/TokenAnnotator.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Format/TokenAnnotator.h b/lib/Format/TokenAnnotator.h
index aa49b2a5c0..8bdf758bc1 100644
--- a/lib/Format/TokenAnnotator.h
+++ b/lib/Format/TokenAnnotator.h
@@ -41,7 +41,8 @@ public:
: First(Line.Tokens.front().Tok), Level(Line.Level),
InPPDirective(Line.InPPDirective),
MustBeDeclaration(Line.MustBeDeclaration), MightBeFunctionDecl(false),
- StartsDefinition(false) {
+ StartsDefinition(false), Affected(false),
+ LeadingEmptyLinesAffected(false) {
assert(!Line.Tokens.empty());
// Calculate Next and Previous for all tokens. Note that we must overwrite
@@ -87,6 +88,14 @@ public:
bool MightBeFunctionDecl;
bool StartsDefinition;
+ /// \c True if this line should be formatted, i.e. intersects directly or
+ /// indirectly with one of the input ranges.
+ bool Affected;
+
+ /// \c True if the leading empty lines of this line intersect with one of the
+ /// input ranges.
+ bool LeadingEmptyLinesAffected;
+
private:
// Disallow copying.
AnnotatedLine(const AnnotatedLine &) LLVM_DELETED_FUNCTION;