summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-10-11 21:25:45 +0000
committerManuel Klimek <klimek@google.com>2013-10-11 21:25:45 +0000
commit71814b44658523f5fc747475ad8b40c9197565e2 (patch)
treefa39904587c053d3ec68c96d7d11de801ddfd182 /clang/lib/Format/ContinuationIndenter.cpp
parent4c42732cf869d167e48a15afe280cb847984e7a5 (diff)
downloadbcm5719-llvm-71814b44658523f5fc747475ad8b40c9197565e2.tar.gz
bcm5719-llvm-71814b44658523f5fc747475ad8b40c9197565e2.zip
Support formatting of preprocessor branches.
We now correctly format: void SomeFunction(int param1, #ifdef X NoTemplate param2, #else template < #ifdef A MyType<Some> > #else Type1, Type2> #endif param2, #endif param3) { f(); } llvm-svn: 192503
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index 560e65ea684..aaddc34499b 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -221,7 +221,7 @@ unsigned ContinuationIndenter::addTokenToState(LineState &State, bool Newline,
void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
unsigned ExtraSpaces) {
- const FormatToken &Current = *State.NextToken;
+ FormatToken &Current = *State.NextToken;
const FormatToken &Previous = *State.NextToken->Previous;
if (Current.is(tok::equal) &&
(State.Line->First->is(tok::kw_for) || State.ParenLevel == 0) &&
@@ -301,7 +301,7 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State,
bool DryRun) {
- const FormatToken &Current = *State.NextToken;
+ FormatToken &Current = *State.NextToken;
const FormatToken &Previous = *State.NextToken->Previous;
// If we are continuing an expression, we want to indent an extra 4 spaces.
unsigned ContinuationIndent =
OpenPOWER on IntegriCloud