<div dir="ltr">On Tue, May 14, 2013 at 8:18 AM, Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>></span> wrote:<div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5">On Mon, May 13, 2013 at 6:51 AM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: klimek<br>
Date: Mon May 13 07:51:40 2013<br>
New Revision: 181700<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=181700&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=181700&view=rev</a><br>
Log:<br>
Implements brace breaking styles.<br>
<br>
We now support "Linux" and "Stroustrup" brace breaking styles, which<br>
gets us one step closer to support formatting WebKit, KDE & Linux code.<br>
<br>
Linux brace breaking style:<br>
namespace a<br>
{<br>
class A<br>
{<br>
  void f()<br>
  {<br>
    if (x) {<br>
      f();<br>
    } else {<br>
      g();<br>
    }<br>
  }<br>
}<br>
}<br>
<br>
Stroustrup brace breaking style:<br>
namespace a {<br>
class A {<br>
  void f()<br>
  {<br>
    if (x) {<br>
      f();<br>
    } else {<br>
      g();<br>
    }<br>
  }<br>
}<br>
}<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/Format/Format.h<br>
    cfe/trunk/lib/Format/Format.cpp<br>
    cfe/trunk/lib/Format/UnwrappedLineParser.cpp<br>
    cfe/trunk/unittests/Format/FormatTest.cpp<br>
<br>
Modified: cfe/trunk/include/clang/Format/Format.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?rev=181700&r1=181699&r2=181700&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?rev=181700&r1=181699&r2=181700&view=diff</a><br>


==============================================================================<br>
--- cfe/trunk/include/clang/Format/Format.h (original)<br>
+++ cfe/trunk/include/clang/Format/Format.h Mon May 13 07:51:40 2013<br>
@@ -101,6 +101,20 @@ struct FormatStyle {<br>
   /// tab characters.<br>
   bool UseTab;<br>
<br>
+  /// \brief Different ways to attach braces to their surrounding context.<br>
+  enum BraceBreakingStyle {<br>
+    /// Always attach braces to surrounding context.<br>
+    BS_Attach,<br>
+    /// Like \c Attach, but break before braces on function, namespace and<br>
+    /// class definitions.<br>
+    BS_Linux,<br></blockquote><div> </div></div></div><div>How exactly do "namespace and class definitions" come into play with Linux code (all C)? Seems confusing to name it like that.</div></div></div></div>
</blockquote><div><br></div><div style>astyle calls this kind of breaking "Linux". If you can come up with a better name I'm open to changing it.</div><div style><br></div><div style>Cheers,</div><div style>
/Manuel</div></div></div></div>