summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/Format.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r--clang/lib/Format/Format.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 1bc0562bc0b..22833ad3293 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -438,14 +438,14 @@ private:
}
for (std::deque<StateNode *>::iterator I = Path.begin(), E = Path.end();
I != E; ++I) {
+ unsigned Penalty = Indenter->addTokenToState(State, (*I)->NewLine, false);
DEBUG({
if ((*I)->NewLine) {
- llvm::dbgs() << "Penalty for splitting before "
+ llvm::dbgs() << "Penalty for placing "
<< (*I)->Previous->State.NextToken->Tok.getName() << ": "
- << (*I)->Previous->State.NextToken->SplitPenalty << "\n";
+ << Penalty << "\n";
}
});
- Indenter->addTokenToState(State, (*I)->NewLine, false);
}
}
@@ -459,11 +459,6 @@ private:
return;
if (!NewLine && Indenter->mustBreak(PreviousNode->State))
return;
- if (NewLine) {
- if (!PreviousNode->State.Stack.back().ContainsLineBreak)
- Penalty += 15;
- Penalty += PreviousNode->State.NextToken->SplitPenalty;
- }
StateNode *Node = new (Allocator.Allocate())
StateNode(PreviousNode->State, NewLine, PreviousNode);
OpenPOWER on IntegriCloud