summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Format/Format.cpp12
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp4
2 files changed, 8 insertions, 8 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index f66d95c9109..79048536891 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -127,7 +127,7 @@ namespace format {
void setDefaultPenalties(FormatStyle &Style) {
Style.PenaltyBreakComment = 45;
- Style.PenaltyBreakFirstLessLess = 180;
+ Style.PenaltyBreakFirstLessLess = 120;
Style.PenaltyBreakString = 1000;
Style.PenaltyExcessCharacter = 1000000;
}
@@ -854,7 +854,7 @@ private:
// If this ends the array subscript expr, reset the corresponding value.
const FormatToken *NextNonComment = Current.getNextNonComment();
if (NextNonComment && NextNonComment->isNot(tok::l_square))
- State.Stack.back().StartOfArraySubscripts = 0;
+ State.Stack.back().StartOfArraySubscripts = 0;
}
// Remove scopes created by fake parenthesis.
@@ -1339,10 +1339,10 @@ public:
: Style(Style), Lex(Lex), SourceMgr(SourceMgr),
Whitespaces(SourceMgr, Style), Ranges(Ranges),
Encoding(encoding::detectEncoding(Lex.getBuffer())) {
- DEBUG(llvm::dbgs()
- << "File encoding: "
- << (Encoding == encoding::Encoding_UTF8 ? "UTF8" : "unknown")
- << "\n");
+ DEBUG(llvm::dbgs() << "File encoding: "
+ << (Encoding == encoding::Encoding_UTF8 ? "UTF8"
+ : "unknown")
+ << "\n");
}
virtual ~Formatter() {}
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index b903597b437..3bed432b19c 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1082,9 +1082,9 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
Content = Content.drop_back(1).drop_front(1).trim();
if (Content.size() > 1 &&
(Content.back() == ':' || Content.back() == '='))
- return 50;
+ return 25;
}
- return prec::Shift;
+ return 1; // Breaking at a << is really cheap.
}
if (Left.Type == TT_ConditionalExpr)
return prec::Conditional;
OpenPOWER on IntegriCloud