|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Summary:
The AllowShortFunctionsOnASingleLine option now controls short function
body placement on a single line independent of the BreakBeforeBraces option.
Updated tests using BreakBeforeBraces other than BS_Attach.
Addresses http://llvm.org/PR17888
Reviewers: klimek, djasper
Reviewed By: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2230
llvm-svn: 195256 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | If we run into the second preprocessor branch chain, the first branch
chain might have already set the maximum branch count on that level to
something > 0.
Fixes PR17645.
llvm-svn: 193153 | 
| | 
| 
| 
| 
| 
| 
| 
| | While it is mostly a user error to have the extra semicolon,
formatting it graciously will correctly format in the cases
where we do not fully understand the code (macros).
llvm-svn: 192543 | 
| | 
| 
| 
| | llvm-svn: 192535 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | We now correctly format:
  void SomeFunction(int param1,
  #ifdef X
                    NoTemplate param2,
  #else
                    template <
  #ifdef A
                        MyType<Some> >
  #else
                        Type1, Type2>
  #endif
                    param2,
  #endif
                    param3) {
    f();
  }
llvm-svn: 192503 | 
| | 
| 
| 
| | llvm-svn: 192094 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before (even with Style.Cpp11BracedListStyle):
  f(MyMap[{ composite, key }]);
After:
  f(MyMap[{composite, key}]);
llvm-svn: 190678 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  enum {
    Bar = Foo < int,
    int > ::value
  };
After:
  enum {
    Bar = Foo<int, int>::value
  };
llvm-svn: 190674 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | The explicit type specified for an enum can actually have a nested name
specifier.
This fixes llvm.org/PR17125.
llvm-svn: 190208 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  double &operator[](int i) { return 0; } int i;
After:
  double &operator[](int i) { return 0; }
  int i;
This fixes llvm.org/PR17134.
llvm-svn: 190207 | 
| | 
| 
| 
| 
| 
| | builds.
llvm-svn: 190061 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
 enum X : int { A, B, C };
After:
 enum X : int {
   A,
   B,
   C
 };
llvm-svn: 190054 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  constexpr char hello [] { "hello" };
After:
  constexpr char hello[]{ "hello" };
llvm-svn: 190046 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  void f() {
    other(x.begin(), x.end(), //
                         [&](int, int) { return 1; });
  }
After:
  void f() {
    other(x.begin(), x.end(), //
          [&](int, int) { return 1; });
  }
llvm-svn: 190039 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Among other things, this enables (better) formatting lambdas and
constructs like:
  MACRO({
          long_statement();
          long_statement_2();
        },
        {
          long_statement();
          long_statement_2();
        },
        { short_statement(); }, "");
This fixes llvm.org/PR15381.
llvm-svn: 190038 | 
| | 
| 
| 
| | llvm-svn: 189933 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | This patch makes sure we produce the right number of unwrapped lines,
a follow-up patch will make the whitespace formatting consistent.
Before:
 void f() {
   int i = {[operation setCompletionBlock : ^{ [self onOperationDone];
 }]
 }
 ;
 }
After:
 void f() {
   int i = {[operation setCompletionBlock : ^{
     [self onOperationDone];
   }] };
 }
llvm-svn: 189932 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
 int c = [ &, &a, a]{
   [ =, c, &d]{
     return b++;
   }();
 }();
After:
 int c = [&, &a, a] {
   [=, c, &d] {
     return b++;
   }();
 }();
llvm-svn: 189924 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Implements parsing of lambdas in the UnwrappedLineParser.
This introduces the correct line breaks; the formatting of
lambda captures are still incorrect, and the braces are also
still formatted as if they were braced init lists instead of
blocks.
llvm-svn: 189818 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  #define OPERATION_CASE(name)           \
    case OP_name:                        \
    return operations::Operation##name
After:
  #define OPERATION_CASE(name)           \
    case OP_name:                        \
      return operations::Operation##name
llvm-svn: 189743 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  namespace n {
  enum Type {
    One,
    Two, // missing };
    int i;
  } void g() {
  }
After:
  namespace n {
  enum Type {
    One,
    Two, // missing };
    int i;
  }
  void g() {}
llvm-svn: 189662 |