|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  for (var i of[2, 3]) {}
After:
  for (var i of [2, 3]) {}
llvm-svn: 260518 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | r256750 has been leading to an undesired behavior:
  aaaaaaaaaa
      .aaaaaaaaaaaaaaaaaaaaaaaa.aaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
This change increases penalty for wrapping before member accesses that aren't
calls. Thus, this is again formatted as (as it has been before r256750):
  aaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaa.aaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
llvm-svn: 256830 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  function foo(check: Object): check
  is{foo: string, bar: string, baz: string, foobar: string} {
    return 'bar' in check;
  }
After:
  function foo(check: Object):
      check is {foo: string, bar: string, baz: string, foobar: string} {
    return 'bar' in check;
  }
llvm-svn: 256631 | 
| | 
| 
| 
| 
| 
| | Patch by Alexander Richardson, thank you!
llvm-svn: 254407 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  extend.foo.Bar {
  }
After:
  extend .foo.Bar {
  }
llvm-svn: 253667 | 
| | 
| 
| 
| 
| 
| 
| 
| | Specifically, don't wrap between the {} of an empty constructor if the
"}" falls on column 81 and ConstructorInitializerAllOnOneLineOrOnePerLine
is set.
llvm-svn: 251406 | 
| | 
| 
| 
| 
| 
| | Patch by Martin Probst. Thank you!
llvm-svn: 248713 | 
| | 
| 
| 
| 
| 
| | Before: assert a&& b;
Now:    assert a && b;
llvm-svn: 247750 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | more consistent.
Before:
  SomeType MemberFunction(const Deleted &)&&;
  SomeType MemberFunction(const Deleted &) && { ... }
After:
  SomeType MemberFunction(const Deleted &)&&;
  SomeType MemberFunction(const Deleted &)&& { ... }
llvm-svn: 245843 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  #elif(AAAA && BBBB)
After:
  #elif (AAAA && BBBB)
llvm-svn: 245043 | 
| | 
| 
| 
| 
| 
| | Differential Revision: http://reviews.llvm.org/D11125
llvm-svn: 242039 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | The MacroBlockBegin and MacroBlockEnd options make matching macro identifiers
behave like '{' and '}', respectively, in terms of indentation.
Mozilla code, for example, uses several macros that begin and end a scope.
Previously, Clang-Format removed the indentation resulting in:
    MACRO_BEGIN(...)
    MACRO_ENTRY(...)
    MACRO_ENTRY(...)
    MACRO_END
Now, using the options
    MacroBlockBegin: "^[A-Z_]+_BEGIN$"
    MacroBlockEnd: "^[A-Z_]+_END$"
will yield the expected result:
    MACRO_BEGIN(...)
      MACRO_ENTRY(...)
      MACRO_ENTRY(...)
    MACRO_END
Differential Revision: http://reviews.llvm.org/D10840
llvm-svn: 241363 | 
| | 
| 
| 
| | llvm-svn: 239903 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  var x = {
        [a]: 1,
    b: 2
  };
After:
  var x = {
    [a]: 1,
    b: 2
  };
llvm-svn: 238544 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Assigns a token type (TT_JsFatArrow) to => tokens, and uses that to
more easily recognize and format fat arrow functions.
Improves function parsing to better recognize formal parameter
lists and return type declarations.
Recognizes arrow functions and parse function bodies as child blocks.
Patch by Martin Probst.
llvm-svn: 237895 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  ASSERT("aaaaaaaaaaaaaaa")
      << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
      << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
After:
  ASSERT("aaaaaaaaaaaaaaa") << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                            << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
Also cleanup implementation a bit and only mark closing parenthesis of
these annotations.
llvm-svn: 237567 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  DEPRECATED("Use NewClass::NewFunction instead.") string
      OldFunction(const string ¶meter) {}
After:
  DEPRECATED("Use NewClass::NewFunction instead.")
  string OldFunction(const string ¶meter) {}
llvm-svn: 237562 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  NSString s = @"aaaa"
      @"bbbb";
After:
  NSString s = @"aaaa"
               @"bbbb";
llvm-svn: 237000 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  llvm::errs() << aaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
                     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                      aaaaaaaaaaaaaaaa) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
After:
  llvm::errs() << aaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
                      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                      aaaaaaaaaaaaaaaa)
               << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
Also, cleanup and simplify the operator wrapping logic.
llvm-svn: 236960 | 
| | 
| 
| 
| 
| 
| 
| 
| | Some compilers ignore everything after a semicolon in such inline asm
blocks and thus, the closing brace must not be moved to the previous
line.
llvm-svn: 236946 | 
| | 
| 
| 
| | llvm-svn: 236415 | 
| | 
| 
| 
| | llvm-svn: 236413 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  void SomeFunction(vector< // break
      int> v);
After:
  void SomeFunction(vector< // break
                        int> v);
llvm-svn: 236412 | 
| | 
| 
| 
| 
| 
| | Adapted patch from Sergey Razmetov. Thank you.
llvm-svn: 235492 | 
| | 
| 
| 
| 
| 
| | Patch by Martin Probst. Thank you.
llvm-svn: 234753 | 
| | 
| 
| 
| | llvm-svn: 234320 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  aaaaaaaa(aaaaaaaaaa,
           bbbbbbbbbb).a();
After:
  aaaaaaaa(aaaaaaaaaa,
           bbbbbbbbbb)
      .a();
llvm-svn: 233304 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | Merge template strings (marked by backticks ``).
Do not format any contents of template strings.
Patch by Martin Probst. Thank you.
llvm-svn: 230011 | 
| | 
| 
| 
| 
| 
| | Patch by Martin Probst.
llvm-svn: 229863 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | This patch adds support for type annotations that follow TypeScript's,
Flow's, and AtScript's syntax style.
Patch by Martin Probst, thank you.
Review: http://reviews.llvm.org/D7721
llvm-svn: 229700 | 
| | 
| 
| 
| 
| 
| | requiring the macro. NFC; Clang edition.
llvm-svn: 229339 | 
| | 
| 
| 
| | llvm-svn: 229326 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | This lets clang-format format
    __try {
    } __except(0) {
    }
and
    __try {
    } __finally {
    }
correctly. __try and __finally are keywords if `LangOpts.MicrosoftExt` is set,
so this turns this on.  This also enables a few other keywords, but it
shouldn't overly perturb regular clang-format operation.  __except is a
context-sensitive keyword, so `AdditionalKeywords` needs to be passed around to
a few more places.
Fixes PR22321.
llvm-svn: 228148 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  public native<X> Foo foo();
After:
  public native <X> Foo foo();
llvm-svn: 225839 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | This fixed llvm.org/PR21804 and hopefully a few other strange cases.
Before:
    if (blah_blah(whatever, whatever, [] {
      doo_dah();
      doo_dah();
    })) {
    }
    }
After:
    if (blah_blah(whatever, whatever, [] {
          doo_dah();
          doo_dah();
        })) {
    }
    }
llvm-svn: 224112 | 
| | 
| 
| 
| 
| 
| | This fixes llvm.org/PR21756.
llvm-svn: 223458 | 
| | 
| 
| 
| 
| 
| | This fixes llvm.org/PR21677.
llvm-svn: 222843 | 
| | 
| 
| 
| 
| 
| | Re-apply r222638 and r222641 without variadic templates.
llvm-svn: 222747 | 
| | 
| 
| 
| 
| 
| | does not support variadic templates. Also reverting r222641 because it was relying on 222638.
llvm-svn: 222656 | 
| | 
| 
| 
| 
| 
| | This fixes llvm.org/PR21436.
llvm-svn: 222641 | 
| | 
| 
| 
| 
| 
| 
| | Provide more overloads to simplify testing the type of a token. No
functional changes intended.
llvm-svn: 222638 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  public final<X> Foo foo() {
  }
  public abstract<X> Foo foo();
After:
  public final <X> Foo foo() {
  }
  public abstract <X> Foo foo();
Patch by Harry Terkelsen. Thank you.
llvm-svn: 222527 | 
| | 
| 
| 
| | llvm-svn: 222524 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | '@' followed by any keyword can't be an annotation, but @interface is currently
the only combination of '@' and a keyword that's allowed, so limit it to this
case. `@interface Foo` without a leading `public` was misformatted prior to
this patch.
llvm-svn: 221607 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | Slightly easier to write, more efficient and prevents bugs by
misspelling them.
No functional changes intended.
llvm-svn: 221259 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  @SomeAnnotation("With some really looooooooooooooong text") private static final
      long something = 0L;
  void SomeFunction(@Nullable
                    String something) {}
After:
  @SomeAnnotation("With some really looooooooooooooong text")
  private static final long something = 0L;
  void SomeFunction(@Nullable String something) {}
llvm-svn: 220984 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  @Override public String toString() { .. }
After:
  @Override
  public String toString() { .. }
llvm-svn: 220274 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  auto SomeFunction(
      A aaaaaaaaaaaaaaaaaaaaa) const -> decltype(f(aaaaaaaaaaaaaaaaaaaaa)) {}
After:
  auto SomeFunction(A aaaaaaaaaaaaaaaaaaaaa) const
      -> decltype(f(aaaaaaaaaaaaaaaaaaaaa)) {}
llvm-svn: 220043 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Before:
  std::vector<int> v = {
      1, 0 /* comment */
  };
After:
  std::vector<int> v = {1, 0 /* comment */};
llvm-svn: 216445 | 
| | 
| 
| 
| 
| 
| | Modifications made by clang-tidy with minor tweaks.
llvm-svn: 215557 |