8afb37e1a1 
								
							 
						 
						
							
							
								
								Remove unused parameter, followup to r179639. No behavior change.  
							
							... 
							
							
							
							llvm-svn: 226128 
							
						 
						
							2015-01-15 06:00:15 +00:00  
				
					
						
							
							
								 
						
							
								575bc3ba62 
								
							 
						 
						
							
							
								
								[cleanup] Re-sort the #include lines using llvm/utils/sort_includes.py  
							
							... 
							
							
							
							No functionality changed, this is a purely mechanical cleanup to ensure
the #include order remains consistent across the project.
llvm-svn: 225975 
							
						 
						
							2015-01-14 11:23:58 +00:00  
				
					
						
							
							
								 
						
							
								e189d46512 
								
							 
						 
						
							
							
								
								clang-format: [Java] Support try blocks with resources.  
							
							... 
							
							
							
							Before:
  try
    (SomeResource rs = someFunction()) {
      Something();
    }
After:
  try (SomeResource rs = someFunction()) {
    Something();
  }
llvm-svn: 225973 
							
						 
						
							2015-01-14 10:48:41 +00:00  
				
					
						
							
							
								 
						
							
								190fbda6de 
								
							 
						 
						
							
							
								
								clang-format: [Java] Prefer not to break in parameter annotations.  
							
							... 
							
							
							
							Before:
  boolean someFunction(@Param(aaaaaaaaaaaaaaaa)
                       String aaaaa,
      String bbbbbbbbbbbbbbb) {}
After:
  boolean someFunction(
      @Param(aaaaaaaaaaaaaaaa) String aaaaa,
      String bbbbbbbbbbbbbbb) {}
llvm-svn: 225971 
							
						 
						
							2015-01-14 10:36:31 +00:00  
				
					
						
							
							
								 
						
							
								16dbe0bc44 
								
							 
						 
						
							
							
								
								clang-format: [Java] Understand "import static".  
							
							... 
							
							
							
							llvm-svn: 225965 
							
						 
						
							2015-01-14 10:02:49 +00:00  
				
					
						
							
							
								 
						
							
								404658aede 
								
							 
						 
						
							
							
								
								clang-format: [Java] Don't let annotations confuse return type analysis.  
							
							... 
							
							
							
							Before:
  @Test 
  ReturnType
  doSomething(String aaaaaaaaaaaaa, String bbbbbbbbbbbbbbb) {}
After:
  @Test 
  ReturnType doSomething(
      String aaaaaaaaaaaaa, String bbbbbbbbbbbbbbb) {}
llvm-svn: 225964 
							
						 
						
							2015-01-14 10:00:20 +00:00  
				
					
						
							
							
								 
						
							
								3e1bd1407b 
								
							 
						 
						
							
							
								
								clang-format: [Java] Don't line-wrap before annotations' l_parens.  
							
							... 
							
							
							
							Before:
  @SomeAnnotation
  (aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa)
  int i;
After:
  @SomeAnnotation(
      aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa)
  int i;
llvm-svn: 225963 
							
						 
						
							2015-01-14 09:51:32 +00:00  
				
					
						
							
							
								 
						
							
								a831c58e53 
								
							 
						 
						
							
							
								
								clang-format: [Java] Don't get confused by leading annotations.  
							
							... 
							
							
							
							Before:
  @Test(a)
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaa);
After:
  @Test(a)
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
      aaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa);
llvm-svn: 225962 
							
						 
						
							2015-01-14 09:47:57 +00:00  
				
					
						
							
							
								 
						
							
								ed50166b6b 
								
							 
						 
						
							
							
								
								clang-format: [Java] Detect `native` keyword.  
							
							... 
							
							
							
							Before:
  public native<X> Foo foo();
After:
  public native <X> Foo foo();
llvm-svn: 225839 
							
						 
						
							2015-01-13 22:32:50 +00:00  
				
					
						
							
							
								 
						
							
								00691cf3bb 
								
							 
						 
						
							
							
								
								Fix assertion in BreakableBlockComment ( http://llvm.org/PR21916 ).  
							
							... 
							
							
							
							Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D6894 
llvm-svn: 225628 
							
						 
						
							2015-01-12 13:11:12 +00:00  
				
					
						
							
							
								 
						
							
								d6a1cab1bc 
								
							 
						 
						
							
							
								
								clang-format: Improve format of lambdas in ctor initializers.  
							
							... 
							
							
							
							Before:
  Constructor()
      : Constructor([] { // comment
        int i;
      }) {}
After:
  Constructor()
      : Constructor([] { // comment
          int i;
        }) {}
llvm-svn: 225625 
							
						 
						
							2015-01-12 10:23:24 +00:00  
				
					
						
							
							
								 
						
							
								2337f28063 
								
							 
						 
						
							
							
								
								clang-format: Fix formatting of inline asm.  
							
							... 
							
							
							
							Specifically, adjust the leading "__asm {" and trailing "}" while still
leaving the assembly inside it alone.
This fixes llvm.org/PR22190.
llvm-svn: 225623 
							
						 
						
							2015-01-12 10:14:56 +00:00  
				
					
						
							
							
								 
						
							
								beb03938e9 
								
							 
						 
						
							
							
								
								clang-format: [Java] Support formatting qualified annotations.  
							
							... 
							
							
							
							llvm-svn: 225559 
							
						 
						
							2015-01-09 23:25:06 +00:00  
				
					
						
							
							
								 
						
							
								d05d3a8919 
								
							 
						 
						
							
							
								
								clang-format: Force line break between "endl" and "<<".  
							
							... 
							
							
							
							This makes piped output easier to read in many instances.
Before:
  llvm::errs() << aaaa << std::endl << bbbb << std::endl;
After:
  llvm::errs() << aaaa << std::endl
               << bbbb << std::endl;
Also fix a few instance of "don't use else after return" as per the
coding standards.
llvm-svn: 225444 
							
						 
						
							2015-01-08 13:56:57 +00:00  
				
					
						
							
							
								 
						
							
								b13135bc08 
								
							 
						 
						
							
							
								
								clang-format: Improve template parameter detection.  
							
							... 
							
							
							
							Before:
  struct A < std::enable_if<sizeof(T2) <sizeof(int32)>::type>;
After:
  struct A<std::enable_if<sizeof(T2) < sizeof(int32)>::type>;
llvm-svn: 225435 
							
						 
						
							2015-01-08 08:48:21 +00:00  
				
					
						
							
							
								 
						
							
								4953210478 
								
							 
						 
						
							
							
								
								clang-format: Understand single-line comments at the end of blocks.  
							
							... 
							
							
							
							This prevents clang-format from moving/aligning the comment in the
snippet:
  void f() {
    int i; // some comment
    // some unrelated comment
  }
llvm-svn: 225352 
							
						 
						
							2015-01-07 14:00:11 +00:00  
				
					
						
							
							
								 
						
							
								6a9682038f 
								
							 
						 
						
							
							
								
								clang-format: Fix unary operator detection.  
							
							... 
							
							
							
							Before:
  ** outparam = 1;
After:
  **outparam = 1;
llvm-svn: 225349 
							
						 
						
							2015-01-07 12:19:53 +00:00  
				
					
						
							
							
								 
						
							
								77ef2be2e4 
								
							 
						 
						
							
							
								
								clang-format: [Java] Fix incorrect detection of cast.  
							
							... 
							
							
							
							After:
  return (a instanceof List<?>) ? aaaaaaaaaaaaaaaaaaaaaaa(
                                      aaaaaaaaaaaaaaaaaaaaa)
                                : aaaaaaaaaaaaaaaaaaaaaaa;
After:
  return (a instanceof List<?>)
      ? aaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa)
      : aaaaaaaaaaaaaaaaaaaaaaa;
llvm-svn: 225161 
							
						 
						
							2015-01-05 10:33:39 +00:00  
				
					
						
							
							
								 
						
							
								5f1fa85e5b 
								
							 
						 
						
							
							
								
								clang-format: [Java] Fix incorrect recognition of annonymous classes.  
							
							... 
							
							
							
							Before:
  someFunction(new Runnable() { public void run() { System.out.println(42);
  }
  });
After:
  someFunction(new Runnable() {
    public void run() {
      System.out.println(42);
    }
  });
llvm-svn: 225142 
							
						 
						
							2015-01-04 20:40:51 +00:00  
				
					
						
							
							
								 
						
							
								428f0b1430 
								
							 
						 
						
							
							
								
								clang-format: Re-enable comment re-indentation for Java/JS.  
							
							... 
							
							
							
							This was broken by r224120.
llvm-svn: 225130 
							
						 
						
							2015-01-04 09:11:17 +00:00  
				
					
						
							
							
								 
						
							
								3a623dbd2a 
								
							 
						 
						
							
							
								
								clang-format: Fix incorrect detection of ObjC "in" keyword.  
							
							... 
							
							
							
							Before:
  for (auto v : in [1]) { ..
After:
  for (auto v : in[1]) { ..
llvm-svn: 224513 
							
						 
						
							2014-12-18 12:11:01 +00:00  
				
					
						
							
							
								 
						
							
								0580ff0ec6 
								
							 
						 
						
							
							
								
								clang-format: Fix incorrect calculation of token lenghts.  
							
							... 
							
							
							
							This led, e.g. to break JavaScript regex literals too early.
llvm-svn: 224419 
							
						 
						
							2014-12-17 09:11:08 +00:00  
				
					
						
							
							
								 
						
							
								b405c08bdb 
								
							 
						 
						
							
							
								
								Add voidType() matcher.  
							
							... 
							
							
							
							Summary: Add voidType() matcher.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D6656 
llvm-svn: 224250 
							
						 
						
							2014-12-15 15:09:22 +00:00  
				
					
						
							
							
								 
						
							
								732b6bd4d1 
								
							 
						 
						
							
							
								
								Don't break single-line raw string literals.  
							
							... 
							
							
							
							Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D6636 
llvm-svn: 224223 
							
						 
						
							2014-12-14 20:47:11 +00:00  
				
					
						
							
							
								 
						
							
								ff2437fe84 
								
							 
						 
						
							
							
								
								Don't break string literals in Java and JavaScript.  
							
							... 
							
							
							
							The proper way to break string literals in these languages is by inserting a "+"
between parts which we don't support yet. So we disable string literal breaking
until then.
llvm-svn: 224120 
							
						 
						
							2014-12-12 13:03:22 +00:00  
				
					
						
							
							
								 
						
							
								11a0ac66e1 
								
							 
						 
						
							
							
								
								clang-format: Revamp nested block formatting.  
							
							... 
							
							
							
							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 
							
						 
						
							2014-12-12 09:40:58 +00:00  
				
					
						
							
							
								 
						
							
								238462627e 
								
							 
						 
						
							
							
								
								clang-format: Add a test for PR19603 which seems fixed (maybe by r221338?).  
							
							... 
							
							
							
							llvm-svn: 223850 
							
						 
						
							2014-12-09 23:22:35 +00:00  
				
					
						
							
							
								 
						
							
								a536df4b28 
								
							 
						 
						
							
							
								
								clang-format: Indent correctly in conditional expressions after return.  
							
							... 
							
							
							
							This only applies when not aligning after the return itself (which is
commonly done for C++.
Before:
  return aaaaaaaaaa
      ? bbbbbbbbbb(
             bbbbbb)  // This is indented relative to aaaaaaaaaa.
      : b;
After:
  return aaaaaaaaaa
      ? bbbbbbbbbb(
            bbbbbb)
      : b;
llvm-svn: 223694 
							
						 
						
							2014-12-08 21:28:31 +00:00  
				
					
						
							
							
								 
						
							
								211e1329cc 
								
							 
						 
						
							
							
								
								clang-format: [Java] Always break after annotations of multiline decls.  
							
							... 
							
							
							
							Before:
  @Mock DataLoader loooooooooooooooooooooooader =
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
After:
  @Mock
  DataLoader loooooooooooooooooooooooader =
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
llvm-svn: 223688 
							
						 
						
							2014-12-08 20:08:04 +00:00  
				
					
						
							
							
								 
						
							
								3431b75069 
								
							 
						 
						
							
							
								
								clang-format: Support commas in lambda return types.  
							
							... 
							
							
							
							Before:
  auto next_pair = [](A * a) -> pair<A*, A*>{};
After:
  auto next_pair = [](A* a) -> pair<A*, A*>{};
llvm-svn: 223652 
							
						 
						
							2014-12-08 13:22:37 +00:00  
				
					
						
							
							
								 
						
							
								55aed6777f 
								
							 
						 
						
							
							
								
								clang-format: Don't merge lines with comments.  
							
							... 
							
							
							
							Before:
  int f() { // comment return 42; }
After:
  int f() { // comment
    return 42;
  }
This fixes llvm.org/PR21769.
llvm-svn: 223609 
							
						 
						
							2014-12-07 16:44:49 +00:00  
				
					
						
							
							
								 
						
							
								a2686713ef 
								
							 
						 
						
							
							
								
								Make DiagnosticErrorTrap work even if SuppressAllDiagnostics is enabled.  
							
							... 
							
							
							
							Patch by Brad King!
llvm-svn: 223525 
							
						 
						
							2014-12-05 21:52:58 +00:00  
				
					
						
							
							
								 
						
							
								31f6c54733 
								
							 
						 
						
							
							
								
								clang-format: Support NS_OPTIONS, CF_ENUM and CF_OPTIONS.  
							
							... 
							
							
							
							This fixes llvm.org/PR21756.
llvm-svn: 223458 
							
						 
						
							2014-12-05 10:42:21 +00:00  
				
					
						
							
							
								 
						
							
								a4e55f4d1e 
								
							 
						 
						
							
							
								
								clang-format: [JS] Don't put top-level dict literals on a single line.  
							
							... 
							
							
							
							These are often used for enums which apparently are easier to read if
formatted with one element per line.
llvm-svn: 223367 
							
						 
						
							2014-12-04 16:07:17 +00:00  
				
					
						
							
							
								 
						
							
								86ee0b6daa 
								
							 
						 
						
							
							
								
								clang-format: More restrictively classify import declarations.  
							
							... 
							
							
							
							Before:
  import::SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
After:
  import::SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaa,
                       aaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
llvm-svn: 223345 
							
						 
						
							2014-12-04 08:57:27 +00:00  
				
					
						
							
							
								 
						
							
								74e1c46a50 
								
							 
						 
						
							
							
								
								Make ArgumentsAdjuster an std::function.  
							
							... 
							
							
							
							Reviewers: klimek
Reviewed By: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D6505 
llvm-svn: 223248 
							
						 
						
							2014-12-03 17:53:02 +00:00  
				
					
						
							
							
								 
						
							
								c095663ec1 
								
							 
						 
						
							
							
								
								clang-format: Fix fake parentheses placement with comments.  
							
							... 
							
							
							
							Before:
  return (a > b
          // comment1
      // comment2
      || c);
After:
  return (a > b
      // comment1
      // comment2
      || c);
llvm-svn: 223234 
							
						 
						
							2014-12-03 14:02:59 +00:00  
				
					
						
							
							
								 
						
							
								8379107afe 
								
							 
						 
						
							
							
								
								clang-format: Fix expression parser not closing stuff at end of stmt.  
							
							... 
							
							
							
							Uncovered by a Java test case:
Before:
  public some.package.Type someFunction( // comment
      int parameter) {}
After:
  public some.package.Type someFunction( // comment
                          int parameter) {}
llvm-svn: 223228 
							
						 
						
							2014-12-03 13:20:49 +00:00  
				
					
						
							
							
								 
						
							
								3219e43c94 
								
							 
						 
						
							
							
								
								clang-format: Add option to suppress operator alignment.  
							
							... 
							
							
							
							With alignment:
  int aaaaaa = aa
               + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
                     * cccccccccccccccccccccccccccccccc;
Without alignment:
  int aaaaaa = aa
      + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
          * cccccccccccccccccccccccccccccccc;
This fixes llvm.org/PR21666.
llvm-svn: 223117 
							
						 
						
							2014-12-02 13:24:51 +00:00  
				
					
						
							
							
								 
						
							
								8c6e9ef676 
								
							 
						 
						
							
							
								
								clang-format: precedence-based indentation when breaking before operators.  
							
							... 
							
							
							
							Before:
  bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
               + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
               + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
               == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
                  + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
               && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  > ccccccccccccccccccccccccccccccccccccccccc;
After:
  bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                       + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                       + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                   == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                              * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
                          + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
               && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                          * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                      > ccccccccccccccccccccccccccccccccccccccccc;
Not particularly pretty, but can probably help to uncover bugs. And if this
bugs somebody, parentheses can help.
llvm-svn: 223111 
							
						 
						
							2014-12-02 09:46:56 +00:00  
				
					
						
							
							
								 
						
							
								41368e9e07 
								
							 
						 
						
							
							
								
								clang-format: [JS] Contract fewer functions to a single line.  
							
							... 
							
							
							
							Before:
  var someVariable =
      function(x) { return x.zIsTooLongForOneLineWithTheDeclarationLine(); };
After:
  var someVariable = function(x) {
    return x.zIsTooLongForOneLineWithTheDeclarationLine();
  };
llvm-svn: 222893 
							
						 
						
							2014-11-27 15:37:42 +00:00  
				
					
						
							
							
								 
						
							
								4087432f8b 
								
							 
						 
						
							
							
								
								clang-format: [JS] Try not to break in container literals.  
							
							... 
							
							
							
							Before:
  var obj = {
    fooooooooo:
        function(x) { return x.zIsTooLongForOneLineWithTheDeclarationLine(); }
  };
After:
  var obj = {
    fooooooooo: function(x) {
      return x.zIsTooLongForOneLineWithTheDeclarationLine();
    }
  };
llvm-svn: 222892 
							
						 
						
							2014-11-27 15:24:48 +00:00  
				
					
						
							
							
								 
						
							
								7912123893 
								
							 
						 
						
							
							
								
								clang-format: [JS] new and delete are valid function names.  
							
							... 
							
							
							
							Before:
  someObject.new ();
  someObject.delete ();
After:
  someObject.new();
  someObject.delete();
llvm-svn: 222890 
							
						 
						
							2014-11-27 14:55:17 +00:00  
				
					
						
							
							
								 
						
							
								53c38f4e79 
								
							 
						 
						
							
							
								
								clang-format: [JS] Make Closure module detection more narrow.  
							
							... 
							
							
							
							Before:
  var MyLongClassName = goog.module.get('my.long.module.name.followedBy.MyLongClassName');
After:
  var MyLongClassName =
      goog.module.get('my.long.module.name.followedBy.MyLongClassName');
llvm-svn: 222888 
							
						 
						
							2014-11-27 14:46:03 +00:00  
				
					
						
							
							
								 
						
							
								13404dad0d 
								
							 
						 
						
							
							
								
								clang-format: Don't use column layout with AlignAfterOpenBrackets.  
							
							... 
							
							
							
							This fixes llvm.org/PR21676.
llvm-svn: 222886 
							
						 
						
							2014-11-27 14:40:48 +00:00  
				
					
						
							
							
								 
						
							
								9b9e07608d 
								
							 
						 
						
							
							
								
								clang-format: [Java] Don't line-wrap package declarations.  
							
							... 
							
							
							
							This fixes llvm.org/PR21677.
llvm-svn: 222843 
							
						 
						
							2014-11-26 18:03:42 +00:00  
				
					
						
							
							
								 
						
							
								450425c980 
								
							 
						 
						
							
							
								
								clang-format: Tweak -style=Chromium for Java files.  
							
							... 
							
							
							
							For Java, don't do any of the deviations from Google Style that Chromium style
does for C++.
Chromium's Java follows Android Java style [1], which is roughly Google Java
style with an indent of 4 and a continuation indent of 8.
1: https://source.android.com/source/code-style.html 
llvm-svn: 222839 
							
						 
						
							2014-11-26 16:43:18 +00:00  
				
					
						
							
							
								 
						
							
								375815d24b 
								
							 
						 
						
							
							
								
								clang-format: [Java] Improve formatting of throws declarations.  
							
							... 
							
							
							
							Before:
  public void doSoooooooooo() throws LoooooooooongException,
      LooooooooooongException {}
After:
  public void doSoooooooooo()
      throws LoooooooooongException, LooooooooooongException {}
llvm-svn: 222829 
							
						 
						
							2014-11-26 12:31:19 +00:00  
				
					
						
							
							
								 
						
							
								4f56b0bb88 
								
							 
						 
						
							
							
								
								clang-format: [Java] Improve cast detection.  
							
							... 
							
							
							
							Before:
  a[b >> 1] = (byte)(c() << 4);
After:
  a[b >> 1] = (byte) (c() << 4);
llvm-svn: 222827 
							
						 
						
							2014-11-26 12:23:10 +00:00  
				
					
						
							
							
								 
						
							
								07013a42d2 
								
							 
						 
						
							
							
								
								clang-format: [Java] Fix breaking after annotations.  
							
							... 
							
							
							
							Before:
  @Annotation1 // comment
  @Annotation2 class C {}
After:
  @Annotation1 // comment
  @Annotation2
  class C {}
llvm-svn: 222825 
							
						 
						
							2014-11-26 11:20:43 +00:00