diff options
author | Alexander Kornienko <alexfh@google.com> | 2013-08-29 17:32:57 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2013-08-29 17:32:57 +0000 |
commit | d7b837e78d805ffee8bde8f0182bfe85c2841aeb (patch) | |
tree | 48e72068cde417110ef8b34914385dd979c24c9b /clang/lib/Format/ContinuationIndenter.h | |
parent | 5533ec5c559bf8c9624916cccb148ed8d0d9494e (diff) | |
download | bcm5719-llvm-d7b837e78d805ffee8bde8f0182bfe85c2841aeb.tar.gz bcm5719-llvm-d7b837e78d805ffee8bde8f0182bfe85c2841aeb.zip |
Better support for multiline string literals (including C++11 raw string literals).
Summary:
Calculate characters in the first and the last line correctly so that
we only break before the literal when needed.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1544
llvm-svn: 189595
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.h')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.h b/clang/lib/Format/ContinuationIndenter.h index 81d14ad0a22..70b87bb2fbd 100644 --- a/clang/lib/Format/ContinuationIndenter.h +++ b/clang/lib/Format/ContinuationIndenter.h @@ -84,6 +84,14 @@ private: unsigned breakProtrudingToken(const FormatToken &Current, LineState &State, bool DryRun); + /// \brief Adds a multiline string literal to the \p State. + /// + /// \returns Extra penalty for the first line of the literal: last line is + /// handled in \c addNextStateToQueue, and the penalty for other lines doesn't + /// matter, as we don't change them. + unsigned addMultilineStringLiteral(const FormatToken &Current, + LineState &State); + /// \brief Returns \c true if the next token starts a multiline string /// literal. /// |