This is an archive of the discontinued LLVM Phabricator instance.

Fixes issue with Allman BreakBeforeBraces for Objective C @interface (PR19511)
ClosedPublic

Authored by dinesh.d on Apr 30 2014, 4:33 AM.

Details

Reviewers
klimek
djasper
Summary

I am not sure if this is real issue. But if we decide to fix this, we may use this patch.

issue:
libformat has code comment stating that if interface has instance variables, it keeps '{' in
same line ragardless of BreakBeforeBraces setting.

UnwrappedLineParser::parseObjCInterfaceOrImplementation()
{
...
// If instance variables are present, keep the '{' on the first line too.

if (FormatTok->Tok.is(tok::l_brace))
  parseBlock(/*MustBeDeclaration=*/true);

...
}

But for Allman and GNU style of BreakBeforeBraces, we should break before '{'

Diff Detail

Event Timeline

dinesh.d updated this revision to Diff 8968.Apr 30 2014, 4:33 AM
dinesh.d retitled this revision from to Fixes issue with Allman BreakBeforeBraces for Objective C @interface (PR19511).
dinesh.d updated this object.
dinesh.d edited the test plan for this revision. (Show Details)
dinesh.d added reviewers: djasper, klimek.
dinesh.d added a subscriber: Unknown Object (MLST).
klimek accepted this revision.Apr 30 2014, 5:54 AM
klimek edited edge metadata.

Looks good (not that I have an idea about objective C, but it seems to make sense).
Do you have commit access or do you need one of us to commit it?

This revision is now accepted and ready to land.Apr 30 2014, 5:54 AM

Thanks for review.

I do not have commit access. I need help in committing this.

dinesh.d closed this revision.May 2 2014, 10:10 AM

Submitted (r207849).

I got my commit access yesterday. Thanks for review and support.