================
Comment at: lib/Format/TokenAnnotator.cpp:541
@@ -540,1 +540,3 @@
+ } else if (Current.is(tok::kw_return) || Current.is(tok::kw_throw) ||
(Current.is(tok::l_paren) && !Line.MustBeDeclaration &&
+ (Current.Parent == NULL || Current.Parent->isNot(tok::kw_for)))) {
----------------
Manuel Klimek wrote:
> Indent.
Done.
================
Comment at: lib/Format/TokenAnnotator.cpp:532
@@ -529,3 +531,3 @@
Contexts.back().IsExpression = true;
- AnnotatedToken *Previous = Current.Parent;
- while (Previous != NULL && Previous->isNot(tok::comma)) {
+ for (AnnotatedToken *Previous = Current.Parent;
+ Previous && Previous->isNot(tok::comma);
----------------
Manuel Klimek wrote:
> Just out of curiosity: why do you prefer a for loop here?
Loops of the form
init;
while(condition) {
// ...
update;
}
// no use of loop variable after loop
read nicer as for loops for me, and Previous is slightly tighter scoped this
way. But I can change it back if you like the old form better.
http://llvm-reviews.chandlerc.com/D384
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits