diff options
author | Daniel Jasper <djasper@google.com> | 2013-11-25 11:08:59 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-11-25 11:08:59 +0000 |
commit | 5500f6163fbe80ab1991434e03244a1f62f7fdce (patch) | |
tree | cdb5109a91cc44efeef447c621e79f8310c7b05c /clang/lib/Format/TokenAnnotator.h | |
parent | 89ccb616bd1781fdcdfd4761166748ea42211e45 (diff) | |
download | bcm5719-llvm-5500f6163fbe80ab1991434e03244a1f62f7fdce.tar.gz bcm5719-llvm-5500f6163fbe80ab1991434e03244a1f62f7fdce.zip |
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.
llvm-svn: 195634
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.h')
-rw-r--r-- | clang/lib/Format/TokenAnnotator.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.h b/clang/lib/Format/TokenAnnotator.h index aa49b2a5c07..8bdf758bc1b 100644 --- a/clang/lib/Format/TokenAnnotator.h +++ b/clang/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; |