|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| | llvm-svn: 217759 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  SomeFunction(function(){});
After:
  SomeFunction(function() {});
llvm-svn: 217236 | 
| | 
| 
| 
| | llvm-svn: 216565 | 
| | 
| 
| 
| 
| 
| 
| 
| | Instead completely cop out of formatting them for now.
This fixes llvm.org/PR20618.
llvm-svn: 216501 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Summary:
http://llvm.org/bugs/show_bug.cgi?id=20587
Added K&R style. It could be enabled by the following option:
```
BreakBeforeBraces: KernighanRitchie
```
This style is like `Attach`, but break *only* before function
declarations.
As I can see, no additional logic required to support this style, any
style different from other styles automagically satisfies K&R.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D4837
llvm-svn: 215354 | 
| | 
| 
| 
| 
| 
| | ScopedLineState
llvm-svn: 215294 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | Seems to be the desired thing to do according to:
  http://www.stroustrup.com/Programming/PPP-style-rev3.pdf
Patch by Jarkko Hietaniemi, thank you!
llvm-svn: 214857 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  Constructor(A... a) : a_(X<A> { std::forward<A>(a) }...) {}
After:
  Constructor(A... a) : a_(X<A>{std::forward<A>(a)}...) {}
llvm-svn: 214720 | 
| | 
| 
| 
| 
| 
| | specifier.
llvm-svn: 214393 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | This worked initially but was broken by r210887.
Before:
  function outer1(a, b) {
    function inner1(a, b) { return a; } inner1(a, b);
  } function outer2(a, b) { function inner2(a, b) { return a; } inner2(a, b); }
After:
  function outer1(a, b) {
    function inner1(a, b) { return a; }
    inner1(a, b);
  }
  function outer2(a, b) {
    function inner2(a, b) { return a; }
    inner2(a, b);
  }
Thanks to Adam Strzelecki for working on this.
llvm-svn: 212038 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  return {a: function SomeFunction(){// ...
                                     return 1;
  }
  }
  ;
After:
  return {
    a: function SomeFunction() {
      // ...
      return 1;
    }
  };
llvm-svn: 210887 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  return [ i, args... ]{};
After:
  return [i, args...] {};
llvm-svn: 210514 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  static_assert(std::is_integral<int> {} + 0, "");
  int a = std::is_integral<int> {}
  + 0;
After:
  static_assert(std::is_integral<int>{} + 0, "");
  int a = std::is_integral<int>{} + 0;
llvm-svn: 209431 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  int foo(int i) {
    return fo1 {}
    (i);
  }
  int foo(int i) {
    return fo1 {}
    (i);
  }
After:
  int foo(int i) { return fo1{}(i); }
  int foo(int i) { return fo1{}(i); }
This fixes llvm.org/PR19812.
llvm-svn: 209428 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | In:
  struct A {
    A()
        noexcept(....) {}
  };
'A()' is not a macro call.
This fixes llvm.org/PR19814.
llvm-svn: 209294 | 
| | 
| 
| 
| | llvm-svn: 209205 | 
| | 
| 
| 
| 
| 
| | Also run clang-format over clang-format's files.
llvm-svn: 208409 | 
| | 
| 
| 
| | llvm-svn: 208392 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Most of this patch was created by Alexander Rojas in
http://reviews.llvm.org/D2555
Thank you!
Synced and addressed review comments.
llvm-svn: 208302 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  return {body: {setAttribute: function(key, val) {this[key] = val;
  }
  , getAttribute : function(key) { return this[key]; }
  , style : {
  direction:
    ''
  }
  }
  }
  ;
After:
  return {
    body: {
      setAttribute: function(key, val) { this[key] = val; },
      getAttribute: function(key) { return this[key]; },
      style: {direction: ''}
    }
  };
llvm-svn: 208292 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  goog.scope(function() {
    var x = a.b;
    var y = c.d;
  });  // goog.scope
After:
  goog.scope(function() {
  var x = a.b;
  var y = c.d;
  });  // goog.scope
llvm-svn: 208088 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
        @interface BSApplicationController () {
    @private
      id _extraIvar;
    }
    @end
After:
    @interface BSApplicationController ()
    {
    @private
      id _extraIvar;
    }
    @end
llvm-svn: 207849 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | definition below all of the header #include lines, clang edition.
If you want more details about this, you can see some of the commits to
Debug.h in LLVM recently. This is just the clang section of a cleanup
I've done for all uses of DEBUG_TYPE in LLVM.
llvm-svn: 206849 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Now correctly formats:
  {
    int a;
    void f() {
      callme(some(parameter1,
  <<<<<<< text by the vcs
                  parameter2),
  ||||||| text by the vcs
                  parameter2),
             parameter3,
  ======= text by the vcs
                  parameter2, parameter3),
  >>>>>>> text by the vcs
             otherparameter);
    }
  }
llvm-svn: 206157 | 
| | 
| 
| 
| 
| 
| 
| | We will need this to correctly handle conflict markers inside macro
definitions.
llvm-svn: 206029 | 
| | 
| 
| 
| | llvm-svn: 205954 | 
| | 
| 
| 
| 
| 
| 
| 
| | This fixes llvm.org/PR17242.
Patch by Brian Green, thank you!
llvm-svn: 205307 | 
| | 
| 
| 
| | llvm-svn: 205193 | 
| | 
| 
| 
| | llvm-svn: 204990 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D3110
llvm-svn: 204156 | 
| | 
| 
| 
| 
| 
| | class.
llvm-svn: 203999 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Summary:
This check hints clang analyzer, that FormatTok may be null, and it
reports a null pointer dereference error:
http://buildd-clang.debian.net/scan-build/report-827c64.html#Path28
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D3040
llvm-svn: 203800 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | This was leading to bad formatting, e.g.:
Before:
  f(^{
      @autoreleasepool {
        if (a) {
          g();
  }
  }
  });
After:
  f(^{
      @autoreleasepool {
        if (a) {
          g();
        }
      }
  });
llvm-svn: 203777 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  int i = (*b)[a] -> f();
After:
  int i = (*b)[a]->f();
llvm-svn: 203557 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  int i = a[a][a] -> f();
After:
  int i = a[a][a]->f();
llvm-svn: 203556 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  int c = []()->int { return 2; }();
After:
  int c = []() -> int { return 2; }();
llvm-svn: 203452 | 
| | 
| 
| 
| 
| 
| | This is a precursor to moving to std::unique_ptr.
llvm-svn: 203275 | 
| | 
| 
| 
| 
| 
| 
| | E.g.:
  Foo([]()->std::vector<int> { return { 2 }; }());
llvm-svn: 201139 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  typedef NS_ENUM(NSInteger, MyType) {
      /// Information about someDecentlyLongValue.
      someDecentlyLongValue,
      /// Information about anotherDecentlyLongValue.
      anotherDecentlyLongValue,
      /// Information about aThirdDecentlyLongValue.
      aThirdDecentlyLongValue};
After:
  typedef NS_ENUM(NSInteger, MyType) {
    /// Information about someDecentlyLongValue.
    someDecentlyLongValue,
    /// Information about anotherDecentlyLongValue.
    anotherDecentlyLongValue,
    /// Information about aThirdDecentlyLongValue.
    aThirdDecentlyLongValue
  };
llvm-svn: 200469 | 
| | 
| 
| 
| 
| 
| 
| 
| | The following snippet would crash:
  #endif
  #if A
llvm-svn: 200381 | 
| | 
| 
| 
| 
| 
| 
| 
| | This was done when we were not able to parse lambdas to handle some
edge cases for block formatting different in return statements, but is
not necessary any more.
llvm-svn: 199982 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  std::unique_ptr<int[]> foo() {}
After:
  std::unique_ptr<int []> foo() {}
Also, the formatting could go severely wrong after such a function
before.
llvm-svn: 199817 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | So clang-format can now format:
  int c = []()->int { return 2; }();
  int c = []()->vector<int> { return { 2 }; }();
llvm-svn: 199368 | 
| | 
| 
| 
| 
| 
| 
| 
| | @implementation block.
PR18406.
llvm-svn: 198770 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  #define LIST(L)                                                     \
    L(FirstElement) L(SecondElement) L(ThirdElement) L(FourthElement) \
        L(FifthElement)
After:
  #define LIST(L)    \
    L(FirstElement)  \
    L(SecondElement) \
    L(ThirdElement)  \
    L(FourthElement) \
    L(FifthElement)
llvm-svn: 198407 | 
| | 
| 
| 
| 
| 
| | Among other things, this fixes llvm.org/PR15269.
llvm-svn: 197900 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Summary:
Added BraceBreakingStyle::BS_GNU. I'm not sure about the correctness of
static initializer formatting, but compound statements should be fine.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2372
llvm-svn: 197138 | 
| | 
| 
| 
| 
| 
| | This should fix llvm.org/PR17241. Maybe it sticks this time :-).
llvm-svn: 195953 | 
| | 
| 
| 
| 
| 
| | This fixes llvm.org/PR17241.
llvm-svn: 195555 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  int count = set<int> { f(), g(), h() }
      .size();
After:
  int count = set<int>{f(), g(), h()}.size();
llvm-svn: 195417 |