99b5a4648c 
								
							 
						 
						
							
							
								
								clang-format: Fix */& detection for lambdas in macros.  
							
							... 
							
							
							
							Before:
  #define MACRO() [](A * a) { return 1; }
After:
  #define MACRO() [](A *a) { return 1; }
llvm-svn: 237109 
							
						 
						
							2015-05-12 10:20:32 +00:00  
				
					
						
							
							
								 
						
							
								015c7a91f1 
								
							 
						 
						
							
							
								
								clang-format: Support aligning ObjC string literals.  
							
							... 
							
							
							
							Before:
  NSString s = @"aaaa"
      @"bbbb";
After:
  NSString s = @"aaaa"
               @"bbbb";
llvm-svn: 237000 
							
						 
						
							2015-05-11 15:15:48 +00:00  
				
					
						
							
							
								 
						
							
								c6366077ed 
								
							 
						 
						
							
							
								
								clang-format: Preserve line break before } in __asm { ... }.  
							
							... 
							
							
							
							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 
							
						 
						
							2015-05-10 08:42:04 +00:00  
				
					
						
							
							
								 
						
							
								7325aee167 
								
							 
						 
						
							
							
								
								clang-format: [JS] Avoid bad line-warp around "function".  
							
							... 
							
							
							
							Before:
  someLooooooooongFunction(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, function(
                                              aaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {
        // code
      });
After:
  someLooooooooongFunction(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      function(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {
        // code
      });
llvm-svn: 236813 
							
						 
						
							2015-05-08 08:38:52 +00:00  
				
					
						
							
							
								 
						
							
								9c95013e8f 
								
							 
						 
						
							
							
								
								clang-format: Improve r236597, Properly indent method calls without inputs.  
							
							... 
							
							
							
							Before:
  [aaaaaaaaaaaa(aaaaaa)
          aaaaaaaaaaaaaaaaaaaa];
After:
  [aaaaaaaaaaaa(aaaaaa)
      aaaaaaaaaaaaaaaaaaaa];
llvm-svn: 236730 
							
						 
						
							2015-05-07 14:19:59 +00:00  
				
					
						
							
							
								 
						
							
								1fe0d5ca59 
								
							 
						 
						
							
							
								
								clang-format: Merge labels and subsequent semicolons.  
							
							... 
							
							
							
							E.g.:
  default:;
This can be used to get around restrictions as to what can follow a
label. It fixes llvm.org/PR19648.
llvm-svn: 236604 
							
						 
						
							2015-05-06 15:19:47 +00:00  
				
					
						
							
							
								 
						
							
								112b50e6b6 
								
							 
						 
						
							
							
								
								clang-format: Allow ternary expressions inside template parameters if  
							
							... 
							
							
							
							the template parameters aren't inside an expression context.
This fixes llvm.org/PR23270.
llvm-svn: 236603 
							
						 
						
							2015-05-06 14:53:50 +00:00  
				
					
						
							
							
								 
						
							
								e92bf6f141 
								
							 
						 
						
							
							
								
								clang-format: Consider operator precedence as penalty when breaking  
							
							... 
							
							
							
							before operators.
This fixes llvm.org/23382.
llvm-svn: 236602 
							
						 
						
							2015-05-06 14:23:38 +00:00  
				
					
						
							
							
								 
						
							
								62c78f5474 
								
							 
						 
						
							
							
								
								clang-format: Prevent assertion discovered by fuzzer.  
							
							... 
							
							
							
							llvm-svn: 236578 
							
						 
						
							2015-05-06 08:58:57 +00:00  
				
					
						
							
							
								 
						
							
								4d9ec17f1e 
								
							 
						 
						
							
							
								
								clang-format: Prevent exponential runtime in token annotator.  
							
							... 
							
							
							
							llvm-svn: 236577 
							
						 
						
							2015-05-06 08:38:24 +00:00  
				
					
						
							
							
								 
						
							
								9326f91922 
								
							 
						 
						
							
							
								
								clang-format: [JS] support optional methods.  
							
							... 
							
							
							
							Optional methods use ? tokens like this:
  interface X { y?(): z; }
It seems easiest to detect and disambiguate these from ternary
expressions by checking if the code is in a declaration context. Turns
out that that didn't quite work properly for interfaces in Java and JS,
and for JS file root contexts.
Patch by Martin Probst, thank you.
llvm-svn: 236488 
							
						 
						
							2015-05-05 08:40:32 +00:00  
				
					
						
							
							
								 
						
							
								66cb8c503f 
								
							 
						 
						
							
							
								
								clang-format: NFC: Delete FormatToken::IsForEachMacro. Use a TokenType instead.  
							
							... 
							
							
							
							llvm-svn: 236415 
							
						 
						
							2015-05-04 09:22:29 +00:00  
				
					
						
							
							
								 
						
							
								de7ca75ca0 
								
							 
						 
						
							
							
								
								clang-format: Force aligning different brackets relative to each other.  
							
							... 
							
							
							
							Before:
  void SomeFunction(vector< // break
      int> v);
After:
  void SomeFunction(vector< // break
                        int> v);
llvm-svn: 236412 
							
						 
						
							2015-05-04 07:39:00 +00:00  
				
					
						
							
							
								 
						
							
								d22190632c 
								
							 
						 
						
							
							
								
								clang-format: [JS] Fix templated parameter default values.  
							
							... 
							
							
							
							Parameters can have templated types and default values (= ...), which is
another location in which a template closer should be followed by
whitespace.
Patch by Martin Probst, thank you.
llvm-svn: 236382 
							
						 
						
							2015-05-02 07:54:58 +00:00  
				
					
						
							
							
								 
						
							
								0faa9136fa 
								
							 
						 
						
							
							
								
								clang-format: Properly detect variable declarations with ObjC.  
							
							... 
							
							
							
							Before:
  LoooooooooooooooooooooooooooooooooooooooongType
  LoooooooooooooooooooooooooooooooooooooongVariable([A a]);
After:
  LoooooooooooooooooooooooooooooooooooooooongType
      LoooooooooooooooooooooooooooooooooooooongVariable([A a]);
llvm-svn: 235599 
							
						 
						
							2015-04-23 13:58:40 +00:00  
				
					
						
							
							
								 
						
							
								caf84fe21e 
								
							 
						 
						
							
							
								
								clang-format: Allow splitting "= default" and "= delete".  
							
							... 
							
							
							
							Otherwise, this can violate the column limit.
llvm-svn: 235592 
							
						 
						
							2015-04-23 12:59:09 +00:00  
				
					
						
							
							
								 
						
							
								532a031422 
								
							 
						 
						
							
							
								
								clang-format: Don't add unwanted space when creating new arrays.  
							
							... 
							
							
							
							Before:
  char** newargv = new char* [argc];
After:
  char** newargv = new char*[argc];
llvm-svn: 235583 
							
						 
						
							2015-04-23 10:23:53 +00:00  
				
					
						
							
							
								 
						
							
								1b998815a0 
								
							 
						 
						
							
							
								
								clang-format: [Proto] Don't linewrap top-level options.  
							
							... 
							
							
							
							They are very similar to import statements.
llvm-svn: 235582 
							
						 
						
							2015-04-23 09:54:10 +00:00  
				
					
						
							
							
								 
						
							
								ee4a8a140a 
								
							 
						 
						
							
							
								
								clang-format: Fix for #pragma option formatting.  
							
							... 
							
							
							
							Adapted patch from Sergey Razmetov. Thank you.
llvm-svn: 235492 
							
						 
						
							2015-04-22 09:45:42 +00:00  
				
					
						
							
							
								 
						
							
								e4ab49e8d3 
								
							 
						 
						
							
							
								
								clang-format: Fix incorrect multi-var declstmt detection.  
							
							... 
							
							
							
							This is now obvious as the pointer alignment behavior was changed.
Before (even with pointer alignment "Left"):
  MACRO Constructor(const int &i) : a(a), b(b) {}
After:
  MACRO Constructor(const int& i) : a(a), b(b) {}
llvm-svn: 235301 
							
						 
						
							2015-04-20 12:54:29 +00:00  
				
					
						
							
							
								 
						
							
								20e15563ff 
								
							 
						 
						
							
							
								
								clang-format: Undo r214508. It was essentially always removing the  
							
							... 
							
							
							
							space where we already had the flag ObjCSpaceBeforeProtocolList to
control it. I don't know what I was thinking.
llvm-svn: 235076 
							
						 
						
							2015-04-16 07:02:19 +00:00  
				
					
						
							
							
								 
						
							
								2b1865c251 
								
							 
						 
						
							
							
								
								clang-format: Determine "in" as a keyword in ObjC for loops more precisely  
							
							... 
							
							
							
							Before:
  for (int i = 0; i < in [a]; ++i) ..
After:
  for (int i = 0; i < in[a]; ++i) ..
Also do some related cleanups.
llvm-svn: 234980 
							
						 
						
							2015-04-15 07:26:18 +00:00  
				
					
						
							
							
								 
						
							
								d9309774a6 
								
							 
						 
						
							
							
								
								clang-format: [JS] Support index signature types.  
							
							... 
							
							
							
							Patch by Martin Probst.
llvm-svn: 234754 
							
						 
						
							2015-04-13 15:03:30 +00:00  
				
					
						
							
							
								 
						
							
								a74f5072e1 
								
							 
						 
						
							
							
								
								clang-format: [JS] support optionality markers in JS types.  
							
							... 
							
							
							
							Patch by Martin Probst. Thank you.
llvm-svn: 234753 
							
						 
						
							2015-04-13 15:01:40 +00:00  
				
					
						
							
							
								 
						
							
								739ec534d2 
								
							 
						 
						
							
							
								
								clang-format: [JS] Understand object literals with only methods.  
							
							... 
							
							
							
							Before:
  let theObject = {someMethodName() {
    doTheThing();
    doTheOtherThing();
  },
                   someOtherMethodName() {
                     doSomething();
                     doSomethingElse();
                   }};
After:
  let theObject = {
    someMethodName() {
      doTheThing();
      doTheOtherThing();
    },
    someOtherMethodName() {
      doSomething();
      doSomethingElse();
    }
  };
llvm-svn: 234091 
							
						 
						
							2015-04-04 07:56:55 +00:00  
				
					
						
							
							
								 
						
							
								05cd92922d 
								
							 
						 
						
							
							
								
								clang-format: Force line break in trailing calls after multline exprs.  
							
							... 
							
							
							
							Before:
  aaaaaaaa(aaaaaaaaaa,
           bbbbbbbbbb).a();
After:
  aaaaaaaa(aaaaaaaaaa,
           bbbbbbbbbb)
      .a();
llvm-svn: 233304 
							
						 
						
							2015-03-26 18:46:28 +00:00  
				
					
						
							
							
								 
						
							
								414c9c6fb0 
								
							 
						 
						
							
							
								
								clang-format: Fix another bug in wrapping around "*".  
							
							... 
							
							
							
							Before:
  void aaaaa(
      aaaaaaaaaaaa* aaaaaaaaaaaaaa) {} // even violation the column limit
After:
  void aaaaa(aaaaaaaaaaaa*
                 aaaaaaaaaaaaaa) {}
llvm-svn: 232717 
							
						 
						
							2015-03-19 09:40:16 +00:00  
				
					
						
							
							
								 
						
							
								1130981907 
								
							 
						 
						
							
							
								
								clang-format: Fix bad wrapping after "*" introduced in r232044.  
							
							... 
							
							
							
							Before:
  void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa*
                                              const aaaaaaaaaaaa) {}
After:
  void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaaaa* const aaaaaaaaaaaa) {}
llvm-svn: 232635 
							
						 
						
							2015-03-18 14:20:13 +00:00  
				
					
						
							
							
								 
						
							
								bc46b939e6 
								
							 
						 
						
							
							
								
								clang-format: [JS] support cast syntax and type arguments.  
							
							... 
							
							
							
							Casts in TS syntax (foo = <type>bar;) should not be followed by
whitespace.
Patch by Martin Probst. Thank you.
llvm-svn: 232321 
							
						 
						
							2015-03-15 13:59:51 +00:00  
				
					
						
							
							
								 
						
							
								60948b12bb 
								
							 
						 
						
							
							
								
								clang-format: [JS] more precisely detect enums.  
							
							... 
							
							
							
							The current enum detection is overly aggressive. As NestingLevel only
applies per line (?) it classifies many if not most object literals as
enum declarations and adds superfluous line breaks into them. This
change narrows the heuristic by requiring an assignment just before the
open brace and requiring the line to start with an identifier.
Patch by Martin Probst. Thank you.
llvm-svn: 232320 
							
						 
						
							2015-03-15 13:55:54 +00:00  
				
					
						
							
							
								 
						
							
								b754a747be 
								
							 
						 
						
							
							
								
								clang-format: When putting */& next to types, also wrap before them.  
							
							... 
							
							
							
							Before:
  LoooooooooooongType *
      loooooooooooongVariable;
After:
  LoooooooooooongType
      *loooooooooooongVariable;
llvm-svn: 232044 
							
						 
						
							2015-03-12 15:04:53 +00:00  
				
					
						
							
							
								 
						
							
								dc4f725673 
								
							 
						 
						
							
							
								
								clang-format: Fix incorrect && recognition.  
							
							... 
							
							
							
							Before:
  if (a &&(b = c)) ..
After:
  if (a && (b = c)) ..
llvm-svn: 231920 
							
						 
						
							2015-03-11 12:59:49 +00:00  
				
					
						
							
							
								 
						
							
								28b45ce151 
								
							 
						 
						
							
							
								
								Make constant static variables const so they can go into a read-only section  
							
							... 
							
							
							
							NFC.
llvm-svn: 231597 
							
						 
						
							2015-03-08 16:06:46 +00:00  
				
					
						
							
							
								 
						
							
								e662316994 
								
							 
						 
						
							
							
								
								clang-format: Prefer wrapping a lambda's body over the lambda's return type.  
							
							... 
							
							
							
							Before:
  aaaaaaaaaaaaaaaaaaaaaa(
      [](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa)
          -> aaaaaaaaaaaaaaaaaaaaa { return aaaaaaaaaaaaaaaaa; });
After:
  aaaaaaaaaaaaaaaaaaaaaa(
      [](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa) -> aaaaaaaaaaaaaaaaaaaaa {
        return aaaaaaaaaaaaaaaaa;
      });
llvm-svn: 230942 
							
						 
						
							2015-03-02 10:35:13 +00:00  
				
					
						
							
							
								 
						
							
								bea1ab46d9 
								
							 
						 
						
							
							
								
								clang-format: Always align */& in multi-var DeclStmts.  
							
							... 
							
							
							
							Seems like the most consistent thing to do and in multi-var DeclStmts,
it is especially important to point out that the */& bind to the
identifier.
llvm-svn: 230903 
							
						 
						
							2015-03-01 18:55:26 +00:00  
				
					
						
							
							
								 
						
							
								308062bd0d 
								
							 
						 
						
							
							
								
								clang-format: Make trailing commas in array inits force one per line.  
							
							... 
							
							
							
							Before:
  NSArray *array = @[ @"a", @"a", ];
After:
  NSArray *array = @[
    @"a",
    @"a",
  ];
llvm-svn: 230741 
							
						 
						
							2015-02-27 08:41:05 +00:00  
				
					
						
							
							
								 
						
							
								beaa322c36 
								
							 
						 
						
							
							
								
								clang-format: Fix space of arrays of pointers to templated types.  
							
							... 
							
							
							
							Before:
  vector<int>(*foo_)[6];
After:
  vector<int> (*foo_)[6];
llvm-svn: 230625 
							
						 
						
							2015-02-26 11:30:50 +00:00  
				
					
						
							
							
								 
						
							
								a42de763ac 
								
							 
						 
						
							
							
								
								clang-format: Allow breaking after "else if(" as a last resort.  
							
							... 
							
							
							
							This isn't generally nice, but better than violating the column limit.
llvm-svn: 230620 
							
						 
						
							2015-02-26 09:49:08 +00:00  
				
					
						
							
							
								 
						
							
								1c22048834 
								
							 
						 
						
							
							
								
								clang-format: Fix spacing for function with ref-qualification ..  
							
							... 
							
							
							
							.. when using SpacesInCStyleCastParentheses != SpacesInParentheses.
Before:
  FormatStyle Spaces = getLLVMStyle();
  Deleted &operator=(const Deleted &)& = default;
  Spaces.SpacesInParentheses = true;
  Deleted(const Deleted &)& = default;
  Spaces.SpacesInCStyleCastParentheses = true;
  Spaces.SpacesInParentheses= false;
  Deleted( const Deleted & )& = default;
After:
  FormatStyle Spaces = getLLVMStyle();
  Deleted &operator=(const Deleted &)& = default;;
  Spaces.SpacesInParentheses= true;
  Deleted( const Deleted & )& = default;
  Spaces.SpacesInCStyleCastParentheses = true;
  Spaces.SpacesInParentheses= false;
  Deleted(const Deleted &)& = default;
Patch by Jean-Philippe Dufraigne. Thank you!
llvm-svn: 230473 
							
						 
						
							2015-02-25 10:30:06 +00:00  
				
					
						
							
							
								 
						
							
								fca735cd58 
								
							 
						 
						
							
							
								
								clang-format: [js] Support ES6 module exports.  
							
							... 
							
							
							
							Patch by Martin Probst, thank you!
llvm-svn: 229865 
							
						 
						
							2015-02-19 16:14:18 +00:00  
				
					
						
							
							
								 
						
							
								354aa51587 
								
							 
						 
						
							
							
								
								clang-format: [js] Support ES6 module imports.  
							
							... 
							
							
							
							Patch by Martin Probst.
llvm-svn: 229863 
							
						 
						
							2015-02-19 16:07:32 +00:00  
				
					
						
							
							
								 
						
							
								fc27511223 
								
							 
						 
						
							
							
								
								clang-format: Space and triple angle braces.  
							
							... 
							
							
							
							Committing patch http://reviews.llvm.org/D6800 .
llvm-svn: 229783 
							
						 
						
							2015-02-18 23:48:37 +00:00  
				
					
						
							
							
								 
						
							
								3c42dba2dc 
								
							 
						 
						
							
							
								
								clang-format: [JS] support AtScript style annotations for JS.  
							
							... 
							
							
							
							Based on Java annotation support and style.
Patch by Martin Probst.
llvm-svn: 229703 
							
						 
						
							2015-02-18 17:17:15 +00:00  
				
					
						
							
							
								 
						
							
								b10bdff337 
								
							 
						 
						
							
							
								
								clang-format: [JS] Support type annotations.  
							
							... 
							
							
							
							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 
							
						 
						
							2015-02-18 17:09:53 +00:00  
				
					
						
							
							
								 
						
							
								699631298e 
								
							 
						 
						
							
							
								
								clang-format: Don't force a break after "endl" if everything fits on one line.  
							
							... 
							
							
							
							llvm-svn: 229486 
							
						 
						
							2015-02-17 10:05:15 +00:00  
				
					
						
							
							
								 
						
							
								fac2371be3 
								
							 
						 
						
							
							
								
								clang-format: Add support for SEH __try / __except / __finally blocks.  
							
							... 
							
							
							
							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 
							
						 
						
							2015-02-04 15:26:27 +00:00  
				
					
						
							
							
								 
						
							
								7509216a41 
								
							 
						 
						
							
							
								
								clang-format: Fix incorrect classification of "*".  
							
							... 
							
							
							
							Before:
  *a = b *c;
After:
  *a = b * c;
llvm-svn: 226923 
							
						 
						
							2015-01-23 19:04:49 +00:00  
				
					
						
							
							
								 
						
							
								d1debfc2bb 
								
							 
						 
						
							
							
								
								clang-format: Fix bad memory access.  
							
							... 
							
							
							
							llvm-svn: 226680 
							
						 
						
							2015-01-21 18:04:02 +00:00  
				
					
						
							
							
								 
						
							
								9b79efb51f 
								
							 
						 
						
							
							
								
								clang-format: Fix crasher on weird comments.  
							
							... 
							
							
							
							Crashing input:
  /\
  / comment
llvm-svn: 226454 
							
						 
						
							2015-01-19 11:49:32 +00:00  
				
					
						
							
							
								 
						
							
								193cdd381b 
								
							 
						 
						
							
							
								
								clang-format: Fix crasher on incomplete condition compilation.  
							
							... 
							
							
							
							Previously crashing input:
  void f(
  #if A
      );
  #else
  #endif
llvm-svn: 226451 
							
						 
						
							2015-01-19 10:52:16 +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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								a98b7b01be 
								
							 
						 
						
							
							
								
								clang-format: Refactoring.  
							
							... 
							
							
							
							Re-apply r222638 and r222641 without variadic templates.
llvm-svn: 222747 
							
						 
						
							2014-11-25 10:05:17 +00:00  
				
					
						
							
							
								 
						
							
								484ee9b404 
								
							 
						 
						
							
							
								
								Reverting r222638; it broke the MSVC build bots because Visual Studio 2012 does not support variadic templates. Also reverting r222641 because it was relying on 222638.  
							
							... 
							
							
							
							llvm-svn: 222656 
							
						 
						
							2014-11-24 15:42:34 +00:00  
				
					
						
							
							
								 
						
							
								325e486f9b 
								
							 
						 
						
							
							
								
								clang-format: [Java] Treat 'instanceof' like other binary operators.  
							
							... 
							
							
							
							This fixes llvm.org/PR21436.
llvm-svn: 222641 
							
						 
						
							2014-11-23 21:34:25 +00:00  
				
					
						
							
							
								 
						
							
								a0143fab5e 
								
							 
						 
						
							
							
								
								clang-format: [Java] Space before array initializers.  
							
							... 
							
							
							
							Before:
  new int[]{1, 2, 3, 4};
After:
  new int[] {1, 2, 3, 4};
llvm-svn: 222640 
							
						 
						
							2014-11-23 20:54:37 +00:00  
				
					
						
							
							
								 
						
							
								bb86d847ba 
								
							 
						 
						
							
							
								
								clang-format: Improve ObjC blocks with return type.  
							
							... 
							
							
							
							Before:
  Block b = ^int * (A * a, B * b) {}
After:
  Block b = ^int *(A *a, B *b) {}
This fixed llvm.org/PR21619.
llvm-svn: 222639 
							
						 
						
							2014-11-23 19:15:35 +00:00  
				
					
						
							
							
								 
						
							
								7198b0c778 
								
							 
						 
						
							
							
								
								clang-format: Refactoring.  
							
							... 
							
							
							
							Provide more overloads to simplify testing the type of a token. No
functional changes intended.
llvm-svn: 222638 
							
						 
						
							2014-11-23 19:03:25 +00:00  
				
					
						
							
							
								 
						
							
								616de864da 
								
							 
						 
						
							
							
								
								clang-format: [JS] Support Closure's module statements.  
							
							... 
							
							
							
							These are like import statements and should not be line-wrapped. Minor
restructuring of the handling of other import statements.
llvm-svn: 222637 
							
						 
						
							2014-11-23 16:46:28 +00:00  
				
					
						
							
							
								 
						
							
								bcb55eec3a 
								
							 
						 
						
							
							
								
								clang-format: Understand more lambda return types.  
							
							... 
							
							
							
							Before:
  auto a = [&b, c ](D * d) -> D * {}
After:
 auto a = [&b, c](D* d) -> D* {}
llvm-svn: 222534 
							
						 
						
							2014-11-21 14:08:38 +00:00  
				
					
						
							
							
								 
						
							
								82c9275344 
								
							 
						 
						
							
							
								
								clang-format: [Java] Support more Java keywords.  
							
							... 
							
							
							
							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 
							
						 
						
							2014-11-21 12:19:07 +00:00  
				
					
						
							
							
								 
						
							
								8354ea84dd 
								
							 
						 
						
							
							
								
								clang-format: [Java] Basic lambda support.  
							
							... 
							
							
							
							llvm-svn: 222524 
							
						 
						
							2014-11-21 12:14:12 +00:00  
				
					
						
							
							
								 
						
							
								caf8685958 
								
							 
						 
						
							
							
								
								clang-format: [Java] Don't force break before generic type method.  
							
							... 
							
							
							
							Before:
  Foo.bar()
      .<X>
      baz();
After:
  Foo.bar()
      .<X>baz();
Patch by Harry Terkelsen.
llvm-svn: 222423 
							
						 
						
							2014-11-20 09:48:11 +00:00  
				
					
						
							
							
								 
						
							
								3aa9a6a126 
								
							 
						 
						
							
							
								
								clang-format: Add option to disable alignment after opening brackets  
							
							... 
							
							
							
							Before:
  SomeFunction(parameter,
               parameter);
After:
  SomeFunction(parameter,
      parameter);
Patch by Harry Terkelsen, thank you!
llvm-svn: 222284 
							
						 
						
							2014-11-18 23:55:27 +00:00  
				
					
						
							
							
								 
						
							
								6761b42b90 
								
							 
						 
						
							
							
								
								clang-format: Fix space between generic type parameter and square  
							
							... 
							
							
							
							bracket
Before:
  public Foo<X, Y> [] foos;
After:
  public Foo<X, Y>[] foos;
Patch by Harry Terkelsen. Thank you!
llvm-svn: 222283 
							
						 
						
							2014-11-18 23:48:01 +00:00  
				
					
						
							
							
								 
						
							
								e1e348b857 
								
							 
						 
						
							
							
								
								clang-format: Fix more incorrect pointer detection.  
							
							... 
							
							
							
							Before:
  Constructor() : a(a), b(c, d *e) {}
After:
  Constructor() : a(a), b(c, d * e) {}
llvm-svn: 222158 
							
						 
						
							2014-11-17 18:42:22 +00:00  
				
					
						
							
							
								 
						
							
								6a3fd8361f 
								
							 
						 
						
							
							
								
								clang-format: Fix regression introduced in r221609.  
							
							... 
							
							
							
							Before:
  void f() { f(a, c *d); }
After:
  void f() { f(a, c * d); }
llvm-svn: 222128 
							
						 
						
							2014-11-17 13:55:04 +00:00  
				
					
						
							
							
								 
						
							
								4bfa736f1b 
								
							 
						 
						
							
							
								
								clang-format: [Java] Further improve generics formatting.  
							
							... 
							
							
							
							llvm-svn: 222011 
							
						 
						
							2014-11-14 17:30:15 +00:00  
				
					
						
							
							
								 
						
							
								d127e3b6af 
								
							 
						 
						
							
							
								
								clang-format: Correctly detect multiplication in ctor initializer.  
							
							... 
							
							
							
							Before:
  Constructor() : a(a), area(width *height) {}
After:
  Constructor() : a(a), area(width * height) {}
llvm-svn: 222010 
							
						 
						
							2014-11-14 17:26:49 +00:00  
				
					
						
							
							
								 
						
							
								6c22c44e12 
								
							 
						 
						
							
							
								
								clang-format: Support assignments as conditional operands.  
							
							... 
							
							
							
							Before:
  return a != b
             // comment
             ? a
             : a = a != b
                   // comment
         ? a =
               b : a;
After:
  return a != b
             // comment
             ? a
             : a = a != b
                       // comment
                       ? a = b
                       : a;
llvm-svn: 221987 
							
						 
						
							2014-11-14 13:03:40 +00:00  
				
					
						
							
							
								 
						
							
								119ff533e4 
								
							 
						 
						
							
							
								
								clang-format: Improve indentation of comments in expressions.  
							
							... 
							
							
							
							Before:
  int i = (a)
              // comment
          + b;
  return aaaa == bbbb
                 // comment
             ? aaaa
             : bbbb;
After:
  int i = (a)
          // comment
          + b;
  return aaaa == bbbb
             // comment
             ? aaaa
             : bbbb;
llvm-svn: 221985 
							
						 
						
							2014-11-14 12:31:14 +00:00  
				
					
						
							
							
								 
						
							
								734d52b58b 
								
							 
						 
						
							
							
								
								clang-format: [Java] Fix line break behavior of class declarations.  
							
							... 
							
							
							
							Change breaking preferences:
1. Break before "extends"
2. Break before "implements"
3. Break within the implements list.
llvm-svn: 221981 
							
						 
						
							2014-11-14 10:15:56 +00:00  
				
					
						
							
							
								 
						
							
								09f6abe8d8 
								
							 
						 
						
							
							
								
								clang-format: [Java] Improve generic return type formatting.  
							
							... 
							
							
							
							Before:
  public<R> ArrayList<R> get() {
After:
  public <R> ArrayList<R> get() {
llvm-svn: 221979 
							
						 
						
							2014-11-14 09:05:32 +00:00  
				
					
						
							
							
								 
						
							
								61d81973c1 
								
							 
						 
						
							
							
								
								clang-format: [Java] Improve formatting of generics.  
							
							... 
							
							
							
							Before:
  Function < F, ? extends T > function;
After:
  Function<F, ? extends T> function;
llvm-svn: 221976 
							
						 
						
							2014-11-14 08:22:46 +00:00  
				
					
						
							
							
								 
						
							
								3eb341c478 
								
							 
						 
						
							
							
								
								clang-format: Improve handling of comments in binary expressions.  
							
							... 
							
							
							
							Before:
  b = a &&
      // Comment
      b.c &&
      d;
After:
  b = a &&
      // Comment
      b.c && d;
This fixes llvm.org/PR21535.
llvm-svn: 221727 
							
						 
						
							2014-11-11 23:04:51 +00:00  
				
					
						
							
							
								 
						
							
								64a328e96f 
								
							 
						 
						
							
							
								
								clang-format: Preserve trailing-comma logic even with comments.  
							
							... 
							
							
							
							Before:
  vector<int> SomeVector = {// aaa
                            1, 2,
  };
After:
  vector<int> SomeVector = {
      // aaa
      1, 2,
  };
llvm-svn: 221699 
							
						 
						
							2014-11-11 19:34:57 +00:00  
				
					
						
							
							
								 
						
							
								0bd9a19b28 
								
							 
						 
						
							
							
								
								clang-format: Fix pointer formatting.  
							
							... 
							
							
							
							Before:
  void f(Bar* a = nullptr, Bar * b);
After:
  void f(Bar* a = nullptr, Bar* b);
llvm-svn: 221609 
							
						 
						
							2014-11-10 16:57:30 +00:00  
				
					
						
							
							
								 
						
							
								a644d7f39c 
								
							 
						 
						
							
							
								
								clang-format: [Java] Never treat @interface as annotation.  
							
							... 
							
							
							
							'@' 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 
							
						 
						
							2014-11-10 16:30:02 +00:00  
				
					
						
							
							
								 
						
							
								d0ec0d62d6 
								
							 
						 
						
							
							
								
								clang-format: Use identifier table for keywords in other languages.  
							
							... 
							
							
							
							Slightly easier to write, more efficient and prevents bugs by
misspelling them.
No functional changes intended.
llvm-svn: 221259 
							
						 
						
							2014-11-04 12:41:02 +00:00  
				
					
						
							
							
								 
						
							
								58fcf6df65 
								
							 
						 
						
							
							
								
								clang-format: [Java] Fix class declaration line breaks.  
							
							... 
							
							
							
							Before:
  @SomeAnnotation()
  abstract
      class aaaaaaaaa<a> extends bbbbbbbbbbbb<b> implements cccccccccccc {
  }
After:
  @SomeAnnotation()
  abstract class aaaaaaaaa<a> extends bbbbbbbbbbbb<b>
      implements cccccccccccc {
  }
llvm-svn: 221256 
							
						 
						
							2014-11-04 10:53:14 +00:00  
				
					
						
							
							
								 
						
							
								f056f45b77 
								
							 
						 
						
							
							
								
								clang-format: [Java] Fix more generics formatting.  
							
							... 
							
							
							
							Before:
  < T extends B > T getInstance(Class<T> type);
After:
  <T extends B> T getInstance(Class<T> type);
llvm-svn: 221124 
							
						 
						
							2014-11-03 02:45:58 +00:00  
				
					
						
							
							
								 
						
							
								db9a7a2f5f 
								
							 
						 
						
							
							
								
								clang-format: [Java] Fix static generic methods.  
							
							... 
							
							
							
							Before:
  public static<R> ArrayList<R> get() {}
After:
  public static <R> ArrayList<R> get() {}
llvm-svn: 221122 
							
						 
						
							2014-11-03 02:35:14 +00:00  
				
					
						
							
							
								 
						
							
								39af6cd5a4 
								
							 
						 
						
							
							
								
								clang-format: [Java] Fix class declaration formatting.  
							
							... 
							
							
							
							Before:
  @SomeAnnotation()
  abstract
      class aaaaaaaaaaaa extends bbbbbbbbbbbbbbb implements cccccccccccc {
  }
After:
  @SomeAnnotation()
  abstract class aaaaaaaaaaaa extends bbbbbbbbbbbbbbb
      implements cccccccccccc {
  }
llvm-svn: 221121 
							
						 
						
							2014-11-03 02:27:28 +00:00  
				
					
						
							
							
								 
						
							
								5e7be1d536 
								
							 
						 
						
							
							
								
								clang-format: [Java] Don't break imports.  
							
							... 
							
							
							
							This fixes llvm.org/PR21453.
llvm-svn: 221112 
							
						 
						
							2014-11-02 22:13:03 +00:00  
				
					
						
							
							
								 
						
							
								b9d3db6b1b 
								
							 
						 
						
							
							
								
								clang-format: [Java] Add space between "synchronized" and "(".  
							
							... 
							
							
							
							Before:
  synchronized(mData) {
    // ...
  }
After:
  synchronized (mData) {
    // ...
  }
This fixes llvm.org/PR21455.
llvm-svn: 221110 
							
						 
						
							2014-11-02 22:00:57 +00:00  
				
					
						
							
							
								 
						
							
								7bd618f5aa 
								
							 
						 
						
							
							
								
								clang-format: [Java] Support generics with "?".  
							
							... 
							
							
							
							Before:
  @Override
  public Map < String,
          ? > getAll() {
    // ...
  }
After:
  @Override
  public Map<String, ?> getAll() {
    // ...
  }
This fixes llvm.org/PR21454.
llvm-svn: 221109 
							
						 
						
							2014-11-02 21:52:57 +00:00  
				
					
						
							
							
								 
						
							
								50b4bd7c0e 
								
							 
						 
						
							
							
								
								clang-format: [Java] Don't break after extends/implements.  
							
							... 
							
							
							
							Before:
  abstract class SomeClass extends SomeOtherClass implements
      SomeInterface {}
After:
  abstract class SomeClass extends SomeOtherClass
      implements SomeInterface {}
llvm-svn: 221103 
							
						 
						
							2014-11-02 19:16:41 +00:00  
				
					
						
							
							
								 
						
							
								e9ab42df0c 
								
							 
						 
						
							
							
								
								clang-format: [Java] Improve line breaks around annotations.  
							
							... 
							
							
							
							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 
							
						 
						
							2014-10-31 18:23:49 +00:00  
				
					
						
							
							
								 
						
							
								f0c809a19b 
								
							 
						 
						
							
							
								
								clang-format: Improve && detection as binary operator.  
							
							... 
							
							
							
							Before:
  template <class T,
            class = typename ::std::enable_if<
                ::std::is_array<T>{}&& ::std::is_array<T>{}>::type>
  void F();
After:
  template <class T,
            class = typename ::std::enable_if<
                ::std::is_array<T>{} && ::std::is_array<T>{}>::type>
  void F();
llvm-svn: 220813 
							
						 
						
							2014-10-28 18:28:22 +00:00  
				
					
						
							
							
								 
						
							
								13a7f469be 
								
							 
						 
						
							
							
								
								clang-format: Improve && detection as binary operators.  
							
							... 
							
							
							
							Before:
  template <class T, class = typename std::enable_if<std::is_integral<
                         T>::value &&(sizeof(T) > 1 || sizeof(T) < 8)>::type>
  void F();
After:
  template <class T, class = typename std::enable_if<
                         std::is_integral<T>::value &&
                         (sizeof(T) > 1 || sizeof(T) < 8)>::type>
  void F();
llvm-svn: 220805 
							
						 
						
							2014-10-28 18:11:52 +00:00  
				
					
						
							
							
								 
						
							
								2ad0aba610 
								
							 
						 
						
							
							
								
								clang-format: Improve function declaration detection.  
							
							... 
							
							
							
							Before:
  ReturnType MACRO
      FunctionName() {}
After:
  ReturnType MACRO
  FunctionName() {}
This fixes llvm.org/PR21404.
I wonder what the motivation for that if-condition was. But as no test
breaks, ...
llvm-svn: 220801 
							
						 
						
							2014-10-28 17:06:04 +00:00  
				
					
						
							
							
								 
						
							
								5634619389 
								
							 
						 
						
							
							
								
								clang-format: Fix bad merging of lines in nested blocks.  
							
							... 
							
							
							
							Before:
  SomeFunction([]() {
  #define A a
    return 43; });
After:
  SomeFunction([]() {
  #define A a
    return 43;
  });
llvm-svn: 220684 
							
						 
						
							2014-10-27 16:31:46 +00:00  
				
					
						
							
							
								 
						
							
								ce2fdb0a0a 
								
							 
						 
						
							
							
								
								clang-format: [Proto] Change formatting text-formatted options.  
							
							... 
							
							
							
							Before:
  optional Type type = 1 [(mutate_options) = {vital : true
                                              abc : false}];
After:
  optional Type type = 1 [(mutate_options) = {
    vital : true
    abc : false
  }];
llvm-svn: 220679 
							
						 
						
							2014-10-27 13:25:59 +00:00  
				
					
						
							
							
								 
						
							
								f322eb5c45 
								
							 
						 
						
							
							
								
								clang-format: Fix incorrect space after "<".  
							
							... 
							
							
							
							Before:
  bool a = 2 <::SomeFunction();
After:
  bool a = 2 < ::SomeFunction();
llvm-svn: 220505 
							
						 
						
							2014-10-23 20:22:22 +00:00  
				
					
						
							
							
								 
						
							
								76284683f1 
								
							 
						 
						
							
							
								
								clang-format: Use AllowShortBlocksOnASingleLine for ObjC blocks, too.  
							
							... 
							
							
							
							llvm-svn: 220375 
							
						 
						
							2014-10-22 09:12:44 +00:00  
				
					
						
							
							
								 
						
							
								e8a4939b77 
								
							 
						 
						
							
							
								
								clang-format: Fix incorrect trailing return arrow detection.  
							
							... 
							
							
							
							Before:
  auto doSomething(Aaaaaa* aaaaaa) -> decltype(aaaaaa -> f()) {}
After:
  auto doSomething(Aaaaaa* aaaaaa) -> decltype(aaaaaa->f()) {}
llvm-svn: 220373 
							
						 
						
							2014-10-22 08:42:58 +00:00  
				
					
						
							
							
								 
						
							
								c0126864a0 
								
							 
						 
						
							
							
								
								clang-format: [Java] Understand string literal concatenation.  
							
							... 
							
							
							
							Before:
  String someString = "abc" + "cde";
After:
  String someString = "abc"
                      + "cde";
llvm-svn: 220287 
							
						 
						
							2014-10-21 11:34:53 +00:00  
				
					
						
							
							
								 
						
							
								d78c422378 
								
							 
						 
						
							
							
								
								clang-format: [Java] Fix formatting of multiple annotations.  
							
							... 
							
							
							
							Before:
  @SuppressWarnings(value = "unchecked")
  @Author(name = "abc") public void doSomething() {
  }
After:
  @SuppressWarnings(value = "unchecked")
  @Author(name = "abc")
  public void doSomething() {
  }
llvm-svn: 220286 
							
						 
						
							2014-10-21 11:17:56 +00:00  
				
					
						
							
							
								 
						
							
								5ffcb7fe90 
								
							 
						 
						
							
							
								
								clang-format: [Java] Fix space in generic method calls.  
							
							... 
							
							
							
							Before:
  A.<B>doSomething();
After:
  A.<B>doSomething();
llvm-svn: 220285 
							
						 
						
							2014-10-21 11:13:31 +00:00  
				
					
						
							
							
								 
						
							
								fd68191db4 
								
							 
						 
						
							
							
								
								clang-format: [Java] Improve annotation handling.  
							
							... 
							
							
							
							Before:
@SuppressWarnings(
    value = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") public static int iiiiiiiiiiiiiiiiiiiiiiii;
After:
  @SuppressWarnings(value = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
  public static int iiiiiiiiiiiiiiiiiiiiiiii;
llvm-svn: 220284 
							
						 
						
							2014-10-21 10:58:14 +00:00  
				
					
						
							
							
								 
						
							
								c7d024ac53 
								
							 
						 
						
							
							
								
								clang-format: [Java] Make annotation formatting more consistent.  
							
							... 
							
							
							
							Before:
  DoSomething(new A() {
    @Override public String toString() {
    }
  });
After:
  DoSomething(new A() {
    @Override
    public String toString() {
    }
  });
llvm-svn: 220282 
							
						 
						
							2014-10-21 10:02:03 +00:00  
				
					
						
							
							
								 
						
							
								16b107e9f0 
								
							 
						 
						
							
							
								
								clang-format: [Java] Improve generic support.  
							
							... 
							
							
							
							Before:
  Iterable< ? > a;
  Iterable< ? extends SomeObject > a;
After:
  Iterable<?> a;
  Iterable<? extends SomeObject> a;
llvm-svn: 220281 
							
						 
						
							2014-10-21 09:57:09 +00:00  
				
					
						
							
							
								 
						
							
								f1f0c35632 
								
							 
						 
						
							
							
								
								clang-format: [Java] Support annotations with parameters.  
							
							... 
							
							
							
							Before:
  @SuppressWarnings
  (value = "unchecked") public void doSomething() { .. }
After:
  @SuppressWarnings(value = "unchecked")
  public void doSomething() { .. }
llvm-svn: 220279 
							
						 
						
							2014-10-21 09:25:39 +00:00  
				
					
						
							
							
								 
						
							
								fab69ff095 
								
							 
						 
						
							
							
								
								clang-format: [Java] Wrap after each function annotation.  
							
							... 
							
							
							
							Before:
  @Override public String toString() { .. }
After:
  @Override
  public String toString() { .. }
llvm-svn: 220274 
							
						 
						
							2014-10-21 08:24:18 +00:00  
				
					
						
							
							
								 
						
							
								f1f267b447 
								
							 
						 
						
							
							
								
								clang-format: [ObjC] Fix spacing in block variable parameters.  
							
							... 
							
							
							
							Before:
  { void (^block)(Object * x); }
After:
  { void (^block)(Object *x); }
llvm-svn: 220270 
							
						 
						
							2014-10-21 07:57:50 +00:00  
				
					
						
							
							
								 
						
							
								38efc13191 
								
							 
						 
						
							
							
								
								clang-format: Fix space in direct destructor calls.  
							
							... 
							
							
							
							Before:
  void F(int& i) { i. ~int(); }
After:
  void F(int& i) { i.~int(); }
Also, some cleanups.
llvm-svn: 220269 
							
						 
						
							2014-10-21 07:51:54 +00:00  
				
					
						
							
							
								 
						
							
								8835a32078 
								
							 
						 
						
							
							
								
								clang-format: Fix overloaded operator edge case.  
							
							... 
							
							
							
							Before:
  template <class F>
  void Call(F f) {
    f.template operator() <int>();
  }
After:
  template <class F>
  void Call(F f) {
    f.template operator()<int>();
  }
llvm-svn: 220202 
							
						 
						
							2014-10-20 13:56:30 +00:00  
				
					
						
							
							
								 
						
							
								7858079246 
								
							 
						 
						
							
							
								
								clang-format: [ObjC] Fix using selector names as macro arguments.  
							
							... 
							
							
							
							Before:
  [self aaaaa:MACRO(a, b :, c :)];
After:
  [self aaaaa:MACRO(a, b:, c:)];
llvm-svn: 220197 
							
						 
						
							2014-10-20 12:01:45 +00:00  
				
					
						
							
							
								 
						
							
								86296e36d7 
								
							 
						 
						
							
							
								
								clang-format: Fix indentation of struct definitions with array init.  
							
							... 
							
							
							
							Before:
  struct {
    int x;
    int y;
  } points[] = {
        {1, 2}, {2, 3},
  };
After:
  struct {
    int x;
    int y;
  } points[] = {
      {1, 2}, {2, 3},
  };
llvm-svn: 220195 
							
						 
						
							2014-10-20 11:12:51 +00:00  
				
					
						
							
							
								 
						
							
								da07a72928 
								
							 
						 
						
							
							
								
								clang-format: Prefer breaking before trailing return arrows.  
							
							... 
							
							
							
							Before:
  auto SomeFunction(
      A aaaaaaaaaaaaaaaaaaaaa) const -> decltype(f(aaaaaaaaaaaaaaaaaaaaa)) {}
After:
  auto SomeFunction(A aaaaaaaaaaaaaaaaaaaaa) const
      -> decltype(f(aaaaaaaaaaaaaaaaaaaaa)) {}
llvm-svn: 220043 
							
						 
						
							2014-10-17 14:37:40 +00:00  
				
					
						
							
							
								 
						
							
								f26c755d42 
								
							 
						 
						
							
							
								
								clang-format: [Java] Don't break immediately after "throws".  
							
							... 
							
							
							
							Before:
  public void doSooooooooooooooooooooooooooomething() throws
      LooooooooooooooooooooooooooooongException {}
After:
  public void doSooooooooooooooooooooooooooomething()
      throws LooooooooooooooooooooooooooooongException {}
llvm-svn: 220041 
							
						 
						
							2014-10-17 13:36:14 +00:00  
				
					
						
							
							
								 
						
							
								1a31bab301 
								
							 
						 
						
							
							
								
								clang-format: Fix behavior with comments before conditional expressions  
							
							... 
							
							
							
							Before:
  SomeFunction(aaaaaaaaaaaaaaaaa,
               // comment.
                   ccccccccccccccccc ? aaaaaaaaaaaaaaaaaaaa
                                     : bbbbbbbbbbbbbbbbbbbb);
After:
  SomeFunction(aaaaaaaaaaaaaaaaa,
               // comment.
               ccccccccccccccccc ? aaaaaaaaaaaaaaaaaaaa : bbbbbbbbbbbbbbbbbbbb);
llvm-svn: 219921 
							
						 
						
							2014-10-16 09:10:11 +00:00  
				
					
						
							
							
								 
						
							
								ea772b4df2 
								
							 
						 
						
							
							
								
								clang-format: [ObjC] Fix method expression detection.  
							
							... 
							
							
							
							Before:
  return (a)[foo bar : baz];
After:
  return (a)[foo bar:baz];
llvm-svn: 219919 
							
						 
						
							2014-10-16 08:38:51 +00:00  
				
					
						
							
							
								 
						
							
								ec8e838baa 
								
							 
						 
						
							
							
								
								clang-format: [ObjC] Wrap ObjC method declarations before annotations.  
							
							... 
							
							
							
							Before:
  - (instancetype)initXxxxxxxxxxxxxxxxxxxxxxxxx:(id<x>)x
                                              y:(id<yyyyyyyyyyyyyyyyyyyy>)
                                                    y NS_DESIGNATED_INITIALIZER;
After:
  - (instancetype)initXxxxxxxxxxxxxxxxxxxxxxxxx:(id<x>)x
                                              y:(id<yyyyyyyyyyyyyyyyyyyy>)y
      NS_DESIGNATED_INITIALIZER;
llvm-svn: 219564 
							
						 
						
							2014-10-11 08:24:56 +00:00  
				
					
						
							
							
								 
						
							
								a45eb4c000 
								
							 
						 
						
							
							
								
								clang-format: If in doubt, assume '+' is a binary operator.  
							
							... 
							
							
							
							Before:
  #define LENGTH(x, y) (x) - (y)+1
After:
  #define LENGTH(x, y) (x) - (y) + 1
llvm-svn: 219119 
							
						 
						
							2014-10-06 13:16:43 +00:00  
				
					
						
							
							
								 
						
							
								67f8ad258f 
								
							 
						 
						
							
							
								
								clang-format: [JS] Support AllowShortFunctionsOnASingleLine.  
							
							... 
							
							
							
							Specifically, this also counts for stuff like (with style "inline"):
  var x = function() {
    return 1;
  };
llvm-svn: 218689 
							
						 
						
							2014-09-30 17:57:06 +00:00  
				
					
						
							
							
								 
						
							
								3549ea1a73 
								
							 
						 
						
							
							
								
								clang-format: [JS] add space before operator 'in'.  
							
							... 
							
							
							
							Before:
  return ('aaa')in bbbb;
After:
  return ('aaa') in bbbb;
llvm-svn: 218119 
							
						 
						
							2014-09-19 10:48:15 +00:00  
				
					
						
							
							
								 
						
							
								b23e20b7f5 
								
							 
						 
						
							
							
								
								clang-format: Allow unbroken ::: in inline assembly.  
							
							... 
							
							
							
							Before:
  asm volatile("nop" :: : "memory");
After:
  asm volatile("nop" ::: "memory");
Patch by Eugene Toder. Thank you.
llvm-svn: 217883 
							
						 
						
							2014-09-16 16:36:57 +00:00  
				
					
						
							
							
								 
						
							
								ac043c900c 
								
							 
						 
						
							
							
								
								clang-format: Add option to break before non-assignment operators.  
							
							... 
							
							
							
							This will allow:
  int aaaaaaaaaaaaaa =
      bbbbbbbbbbbbbb
      + ccccccccccccccc;
llvm-svn: 217757 
							
						 
						
							2014-09-15 11:11:00 +00:00  
				
					
						
							
							
								 
						
							
								3a038de3c8 
								
							 
						 
						
							
							
								
								clang-format: [JS] JavaScript does not have the */&/&& madness.  
							
							... 
							
							
							
							Before:
  e&& e.SomeFunction();
After:
  e && e.SomeFunction();
Yeah, this might be useful for C++, too, but it is not such a frequent
pattern there (plus the fix is much harder).
llvm-svn: 217237 
							
						 
						
							2014-09-05 08:53:45 +00:00  
				
					
						
							
							
								 
						
							
								97bfb7b1ba 
								
							 
						 
						
							
							
								
								clang-format: [JS] Fix indentation in dict literals.  
							
							... 
							
							
							
							Before:
  return {
    'finish':
        //
        a
        };
After:
  return {
    'finish':
        //
        a
  };
llvm-svn: 217235 
							
						 
						
							2014-09-05 08:29:31 +00:00  
				
					
						
							
							
								 
						
							
								8f2e94c8ab 
								
							 
						 
						
							
							
								
								clang-format: [JS] Supprot "catch" as function name.  
							
							... 
							
							
							
							Before:
  someObject.catch ();
After:
  someObject.catch();
llvm-svn: 217158 
							
						 
						
							2014-09-04 15:03:34 +00:00  
				
					
						
							
							
								 
						
							
								94e11d02d8 
								
							 
						 
						
							
							
								
								clang-format: [JS] Support comments in dict literals.  
							
							... 
							
							
							
							Before:
  var stuff = {
    // comment for update
    update : false,
             // comment for update
    modules : false,
              // comment for update
    tasks : false
  };
After:
  var stuff = {
    // comment for update
    update : false,
    // comment for update
    modules : false,
    // comment for update
    tasks : false
  };
llvm-svn: 217157 
							
						 
						
							2014-09-04 14:58:30 +00:00  
				
					
						
							
							
								 
						
							
								db986eb6bb 
								
							 
						 
						
							
							
								
								clang-format: Add an option 'SpaceAfterCStyleCast'.  
							
							... 
							
							
							
							This permits to add a space after closing parenthesis of a C-style cast.
Defaults to false to preserve old behavior.
Fixes llvm.org/PR19982.
Before:
  (int)i;
After:
  (int) i;
Patch by Marek Kurdej.
llvm-svn: 217022 
							
						 
						
							2014-09-03 07:37:29 +00:00  
				
					
						
							
							
								 
						
							
								73e171f76d 
								
							 
						 
						
							
							
								
								clang-format: Fix unary operator detection in corner case.  
							
							... 
							
							
							
							Before:
  decltype(* ::std::declval<const T &>()) void F();
After:
  decltype(*::std::declval<const T &>()) void F();
llvm-svn: 216724 
							
						 
						
							2014-08-29 12:54:38 +00:00  
				
					
						
							
							
								 
						
							
								168c8aa679 
								
							 
						 
						
							
							
								
								clang-format: Fix regression in formatting of braced initializers.  
							
							... 
							
							
							
							Before:
  Node n{1, Node{1000}, //
                2};
After:
  Node n{1, Node{1000}, //
         2};
llvm-svn: 216540 
							
						 
						
							2014-08-27 11:53:26 +00:00  
				
					
						
							
							
								 
						
							
								ad981f888a 
								
							 
						 
						
							
							
								
								clang-format: New option SpacesInSquareBrackets.  
							
							... 
							
							
							
							Before:
  int a[5];
  a[3] += 42;
After:
  int a[ 5 ];
  a[ 3 ] += 42;
Fixes LLVM bug #17887  (http://llvm.org/bugs/show_bug.cgi?id=17887 ).
Patch by Marek Kurdej, thank you!
llvm-svn: 216449 
							
						 
						
							2014-08-26 11:41:14 +00:00  
				
					
						
							
							
								 
						
							
								610381ff07 
								
							 
						 
						
							
							
								
								clang-format: Improve handling of block comments in braced lists.  
							
							... 
							
							
							
							Before:
  std::vector<int> v = {
      1, 0 /* comment */
  };
After:
  std::vector<int> v = {1, 0 /* comment */};
llvm-svn: 216445 
							
						 
						
							2014-08-26 09:37:52 +00:00  
				
					
						
							
							
								 
						
							
								4b3ba214d0 
								
							 
						 
						
							
							
								
								clang-format: Understand sequenced casts.  
							
							... 
							
							
							
							This fixed llvm.org/PR20712.
Before:
  int i = (int)(int) -2;
After:
  int i = (int)(int)-2;
llvm-svn: 216378 
							
						 
						
							2014-08-25 09:36:07 +00:00  
				
					
						
							
							
								 
						
							
								ea79ea1627 
								
							 
						 
						
							
							
								
								clang-format: Prefer breaking after return type over template param  
							
							... 
							
							
							
							Before:
  typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa aaaaaaaaaa<
      aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(bool *aaaaaaaaaaaaaaaaaa,
                                                   bool *aa) {}
After:
  typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa
  aaaaaaaaaa<aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      bool *aaaaaaaaaaaaaaaaaa, bool *aa) {}
llvm-svn: 215693 
							
						 
						
							2014-08-15 05:00:39 +00:00  
				
					
						
							
							
								 
						
							
								497d9fdcf8 
								
							 
						 
						
							
							
								
								clang-format: [proto] Understand text-format nesting without :  
							
							... 
							
							
							
							Before:
  option (MyProto.options) = {
    field_c : "OK" msg_field{field_d : 123}
  };
After:
  option (MyProto.options) = {
    field_c : "OK"
    msg_field{field_d : 123}
  };
(Note that the colon after "msg_field" is optional).
llvm-svn: 215692 
							
						 
						
							2014-08-15 05:00:35 +00:00  
				
					
						
							
							
								 
						
							
								db76479d73 
								
							 
						 
						
							
							
								
								clang-format: Fix AlwaysBreakAfterDefinitionReturnType in Stroutrup style  
							
							... 
							
							
							
							Before:
  template <class T>
  T *f(T &c)  // Problem here: no line break before f
  {
    return NULL;
  }
After:
  template <class T>
  T *
  f(T &c)
  {
    return NULL;
  }
Patch by Marek Kurdej, thank you!
llvm-svn: 215633 
							
						 
						
							2014-08-14 11:36:03 +00:00  
				
					
						
							
							
								 
						
							
								1904e9b98d 
								
							 
						 
						
							
							
								
								clang-format: Support chained dereferenced assignments.  
							
							... 
							
							
							
							Before:
  x = * a(x) = *a(y);
After:
  x = *a(x) = *a(y);
llvm-svn: 215632 
							
						 
						
							2014-08-14 10:53:19 +00:00  
				
					
						
							
							
								 
						
							
								78b4533acf 
								
							 
						 
						
							
							
								
								clang-format: Support breaking arguments of function type typedefs.  
							
							... 
							
							
							
							Before:
  typedef size_t (*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(
      const aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
After:
  typedef size_t (*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(
      const aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *
          aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
llvm-svn: 215631 
							
						 
						
							2014-08-14 10:52:56 +00:00  
				
					
						
							
							
								 
						
							
								5f594f80f4 
								
							 
						 
						
							
							
								
								Fix crasher bug in clang-format.  
							
							... 
							
							
							
							llvm-svn: 215549 
							
						 
						
							2014-08-13 14:00:41 +00:00  
				
					
						
							
							
								 
						
							
								343643b979 
								
							 
						 
						
							
							
								
								clang-format: Understand #defines defining system includes.  
							
							... 
							
							
							
							Before:
  #define MY_IMPORT < a / b >
After:
  #define MY_IMPORT <a/b>
llvm-svn: 215527 
							
						 
						
							2014-08-13 08:29:18 +00:00  
				
					
						
							
							
								 
						
							
								598dd330e8 
								
							 
						 
						
							
							
								
								clang-format: Avoid bad line break.  
							
							... 
							
							
							
							Before:
  int
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaa(const
                                typename aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa);
After:
  int aaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      const typename aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa);
llvm-svn: 215442 
							
						 
						
							2014-08-12 13:22:26 +00:00  
				
					
						
							
							
								 
						
							
								a5621202c4 
								
							 
						 
						
							
							
								
								clang-format: Prefer not to put lambdas on a single line.  
							
							... 
							
							
							
							Before:
  string abc =
      SomeFunction(aaaaaaaaaaaaa, aaaaa,
                   []() { SomeOtherFunctioooooooooooooooooooooooooon(); });
After:
  string abc = SomeFunction(aaaaaaaaaaaaa, aaaaa, []() {
    SomeOtherFunctioooooooooooooooooooooooooon();
  });
llvm-svn: 215197 
							
						 
						
							2014-08-08 12:00:13 +00:00  
				
					
						
							
							
								 
						
							
								78b1949950 
								
							 
						 
						
							
							
								
								clang-format: Correct SBPO_Always-behavior after function-like keywords  
							
							... 
							
							
							
							Before:
  auto f (int x) -> decltype(x) { return sizeof(x); }
  int g () noexcept(someCall ());
  static_assert(sizeof(char) == 1, "Your compiler is broken");
After:
  auto f (int x) -> decltype (x) { return sizeof (x); }
  int g () noexcept (someCall ());
  static_assert (sizeof (char) == 1, "Your compiler is broken");
This fixes llvm.org/PR20559.
Patch by Roman Kashitsyn, thank you!
llvm-svn: 214969 
							
						 
						
							2014-08-06 14:15:41 +00:00  
				
					
						
							
							
								 
						
							
								0a84f17882 
								
							 
						 
						
							
							
								
								[PR19983] SBPO_Always not covering all the cases.  
							
							... 
							
							
							
							Patch by "Roman Kashitsyn" <romankashicin@gmail.com>.
Phabricator revision: http://reviews.llvm.org/D4788 
llvm-svn: 214904 
							
						 
						
							2014-08-05 17:58:54 +00:00  
				
					
						
							
							
								 
						
							
								ca4ea1ce59 
								
							 
						 
						
							
							
								
								clang-format: Add option to always break after a function's return type.  
							
							... 
							
							
							
							This is required for GNU coding style, among others.
Also update the configuration documentation.
Modified from an original patch by Jarkko Hietaniemi, thank you!
llvm-svn: 214858 
							
						 
						
							2014-08-05 12:16:31 +00:00  
				
					
						
							
							
								 
						
							
								dcf37fbec5 
								
							 
						 
						
							
							
								
								clang-format: Add a space in ObjC protocols.  
							
							... 
							
							
							
							Before:
  @interface Foo (HackStuff)<MyProtocol>
After:
  @interface Foo (HackStuff) <MyProtocol>
llvm-svn: 214508 
							
						 
						
							2014-08-01 13:03:05 +00:00  
				
					
						
							
							
								 
						
							
								71646ec206 
								
							 
						 
						
							
							
								
								clang-format: Understand 'typename' in placement new.  
							
							... 
							
							
							
							Before:
  new (aaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaa)) typename aaaaaaaaaaaaaaaaaaaaaaaa();
After:
  new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa))
      typename aaaaaaaaaaaaaaaaaaaaaaaa();
llvm-svn: 214300 
							
						 
						
							2014-07-30 12:14:10 +00:00  
				
					
						
							
							
								 
						
							
								a382cbe4eb 
								
							 
						 
						
							
							
								
								clang-format: [proto] Improve formatting of text-proto options.  
							
							... 
							
							
							
							Initial patch and tests by Kaushik Sridharan, thank you!
llvm-svn: 214084 
							
						 
						
							2014-07-28 14:08:09 +00:00  
				
					
						
							
							
								 
						
							
								6ba1638f0b 
								
							 
						 
						
							
							
								
								clang-format: Improve operator and template recognition.  
							
							... 
							
							
							
							Before:
  static_assert(is_convertible < A &&, B > ::value, "AAA");
After:
  static_assert(is_convertible<A &&, B>::value, "AAA");
llvm-svn: 214075 
							
						 
						
							2014-07-28 13:19:58 +00:00  
				
					
						
							
							
								 
						
							
								8184d66f4b 
								
							 
						 
						
							
							
								
								clang-format: Improve pointer/reference detection.  
							
							... 
							
							
							
							Before (with left pointer alignment):
  void f(int i = 0, SomeType* *temps = NULL);
After:
  void f(int i = 0, SomeType** temps = NULL);
llvm-svn: 214071 
							
						 
						
							2014-07-28 12:24:21 +00:00  
				
					
						
							
							
								 
						
							
								2ac3fdfd4a 
								
							 
						 
						
							
							
								
								clang-format: Fix unary operator recognition.  
							
							... 
							
							
							
							Before:
  int x = ~ * p;
After:
  int x = ~*p;
llvm-svn: 214070 
							
						 
						
							2014-07-28 12:08:16 +00:00  
				
					
						
							
							
								 
						
							
								8b76d608b8 
								
							 
						 
						
							
							
								
								clang-format: Fix formatting of lock annotations in lambda definitions.  
							
							... 
							
							
							
							Before:
  SomeFunction([](int i)LOCKS_EXCLUDED(a) {});
After:
  SomeFunction([](int i) LOCKS_EXCLUDED(a) {});
llvm-svn: 214069 
							
						 
						
							2014-07-28 12:08:06 +00:00  
				
					
						
							
							
								 
						
							
								3875a82d42 
								
							 
						 
						
							
							
								
								Remove uses of the redundant ".reset(nullptr)" of unique_ptr, in favor of ".reset()"  
							
							... 
							
							
							
							It's also possible to just write "= nullptr", but there's some question
of whether that's as readable, so I leave it up to authors to pick which
they prefer for now. If we want to discuss standardizing on one or the
other, we can do that at some point in the future.
llvm-svn: 213439 
							
						 
						
							2014-07-19 01:06:45 +00:00  
				
					
						
							
							
								 
						
							
								fc3861ac48 
								
							 
						 
						
							
							
								
								clang-format: Fix parsing of conditional expressions.  
							
							... 
							
							
							
							Before:
  aaaaaa = aaaaaaaaaaaa ? aaaaaaaaaa ? aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
      : aaaaaaaaaaaaaaaaaaaaaa
      : aaaaaaaaaaaaaaaaaaaaaaaaaaaa;
After:
  aaaaaa = aaaaaaaaaaaa
               ? aaaaaaaaaa ? aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                            : aaaaaaaaaaaaaaaaaaaaaa
               : aaaaaaaaaaaaaaaaaaaaaaaaaaaa;
llvm-svn: 213258 
							
						 
						
							2014-07-17 12:22:04 +00:00  
				
					
						
							
							
								 
						
							
								3064620d0d 
								
							 
						 
						
							
							
								
								clang-format: Improve cast detection (fix false positive).  
							
							... 
							
							
							
							Before:
  fn(a)(b)+1;
After:
  fn(a)(b) + 1;
llvm-svn: 212935 
							
						 
						
							2014-07-14 12:38:38 +00:00  
				
					
						
							
							
								 
						
							
								85bcadcdc6 
								
							 
						 
						
							
							
								
								clang-format: Fix behavior around pointer-to-member invocations.  
							
							... 
							
							
							
							Before:
  (aaaaaaaaaa->*
   bbbbbbb)(aaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaa));
After:
  (aaaaaaaaaa->*bbbbbbb)(
      aaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaa));
llvm-svn: 212617 
							
						 
						
							2014-07-09 13:07:57 +00:00  
				
					
						
							
							
								 
						
							
								4355e7f0ef 
								
							 
						 
						
							
							
								
								clang-format: Revamp function declaration/definition indentation.  
							
							... 
							
							
							
							Key changes:
- Correctly (well ...) distinguish function declarations and variable
  declarations with ()-initialization.
- Don't indent when breaking function declarations/definitions after the
  return type.
- Indent variable declarations and typedefs when breaking after the
  type.
This fixes llvm.org/PR17999.
llvm-svn: 212591 
							
						 
						
							2014-07-09 07:50:33 +00:00  
				
					
						
							
							
								 
						
							
								2520fe9662 
								
							 
						 
						
							
							
								
								clang-format: Support member function reference qualifiers.  
							
							... 
							
							
							
							Before:
  string // break
      operator()() &
  {}
After:
  string // break
  operator()() & {}
llvm-svn: 212041 
							
						 
						
							2014-06-30 13:54:27 +00:00  
				
					
						
							
							
								 
						
							
								91beebd04a 
								
							 
						 
						
							
							
								
								clang-format: Improve expression heuristics.  
							
							... 
							
							
							
							Upon encountering a binary operator inside parentheses, assume that the
parentheses contain an expression.
Before:
  MACRO('0' <= c&& c <= '9');
After:
  MACRO('0' <= c && c <= '9');
llvm-svn: 212040 
							
						 
						
							2014-06-30 13:44:47 +00:00  
				
					
						
							
							
								 
						
							
								a2fb50f9b3 
								
							 
						 
						
							
							
								
								clang-format: Understand that breaking before lambdas is fine.  
							
							... 
							
							
							
							Before:
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa([](
      const aaaaaaaaaa &a) { return a; });
After:
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      [](const aaaaaaaaaa &a) { return a; });
llvm-svn: 211575 
							
						 
						
							2014-06-24 09:15:49 +00:00  
				
					
						
							
							
								 
						
							
								9c2820c4e3 
								
							 
						 
						
							
							
								
								clang-format: [proto] Add required space before absolute references.  
							
							... 
							
							
							
							llvm-svn: 211488 
							
						 
						
							2014-06-23 07:36:25 +00:00  
				
					
						
							
							
								 
						
							
								32ccb03871 
								
							 
						 
						
							
							
								
								clang-format: Fix corner case in pointer/reference detection.  
							
							... 
							
							
							
							llvm-svn: 211487 
							
						 
						
							2014-06-23 07:36:18 +00:00  
				
					
						
							
							
								 
						
							
								553d4878da 
								
							 
						 
						
							
							
								
								clang-format: Introduce style with spaces on both sides of */&.  
							
							... 
							
							
							
							Patch by Janusz Sobczak (slightly extended).
This fixes llvm.org/19929.
llvm-svn: 211098 
							
						 
						
							2014-06-17 12:40:34 +00:00  
				
					
						
							
							
								 
						
							
								4ac7de7199 
								
							 
						 
						
							
							
								
								clang-format: Fix pointer/reference detection after decltype.  
							
							... 
							
							
							
							Before:
  [](const decltype(*a) & value) {}
After:
  [](const decltype(*a)& value) {}
llvm-svn: 210643 
							
						 
						
							2014-06-11 07:35:16 +00:00  
				
					
						
							
							
								 
						
							
								17062ff550 
								
							 
						 
						
							
							
								
								clang-format: [JS] Treat dict literals similar to objc method exprs.  
							
							... 
							
							
							
							Before:
  return {
    link:
        function() {
          f();  //
        }
        };
  return {
    a: a,
    link: function() {
      f();  //
    }
  }
After:
  return {
    link: function() {
      f();  //
    }
  };
  return {
    a: a,
    link: function() {
      f();  //
    }
  };
llvm-svn: 210537 
							
						 
						
							2014-06-10 14:44:02 +00:00  
				
					
						
							
							
								 
						
							
								ecaba17996 
								
							 
						 
						
							
							
								
								clang-format: Increase penalty for wrapping array subscript expressions  
							
							... 
							
							
							
							Before:
  aaaaaaaaaaa aaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaa->aaaaaaaaa[0].aaaaaaa
                                    [0].aaaaaaaaaaaaaaaaaaaaaa();
After:
  aaaaaaaaaaa aaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaa->aaaaaaaaa[0]
                                    .aaaaaaa[0]
                                    .aaaaaaaaaaaaaaaaaaaaaa();
llvm-svn: 210529 
							
						 
						
							2014-06-10 13:27:57 +00:00  
				
					
						
							
							
								 
						
							
								4b56692e30 
								
							 
						 
						
							
							
								
								[C++11] Use 'nullptr'.  
							
							... 
							
							
							
							llvm-svn: 210448 
							
						 
						
							2014-06-09 02:04:02 +00:00  
				
					
						
							
							
								 
						
							
								a69ca9be12 
								
							 
						 
						
							
							
								
								clang-format: Leave empty lines within UnwrappedLines.  
							
							... 
							
							
							
							These are commonly used to structure things like enums or long braced
lists. There doesn't seem to be a good reason to have the behavior in
such structures be different from the behavior between statements.
llvm-svn: 210183 
							
						 
						
							2014-06-04 12:40:57 +00:00  
				
					
						
							
							
								 
						
							
								114a2bc9d2 
								
							 
						 
						
							
							
								
								clang-format: Refactor indentation behavior for multiple nested blocks.  
							
							... 
							
							
							
							This fixes a few oddities when formatting multiple nested JavaScript
blocks, e.g.:
Before:
  promise.then(
      function success() {
        doFoo();
        doBar();
      },
      [], function error() {
        doFoo();
        doBaz();
      });
  promise.then([],
               function success() {
                 doFoo();
                 doBar();
               },
               function error() {
    doFoo();
    doBaz();
  });
After:
  promise.then(
      function success() {
        doFoo();
        doBar();
      },
      [],
      function error() {
        doFoo();
        doBaz();
      });
  promise.then([],
               function success() {
                 doFoo();
                 doBar();
               },
               function error() {
                 doFoo();
                 doBaz();
               });
llvm-svn: 210097 
							
						 
						
							2014-06-03 12:02:45 +00:00  
				
					
						
							
							
								 
						
							
								7d028298ce 
								
							 
						 
						
							
							
								
								clang-format: Fix special case of binary operator detection.  
							
							... 
							
							
							
							There is a pattern where evaluation order is used as control flow.
This patch special-cases a commonly occuring version of this pattern.
Before:
  Aaaaa *aaa = nullptr;
  // ...
  aaa &&aaa->f();
After:
  Aaaaa *aaa = nullptr;
  // ...
  aaa && aaa->f();
llvm-svn: 210017 
							
						 
						
							2014-06-02 11:54:20 +00:00  
				
					
						
							
							
								 
						
							
								4afc6b3e16 
								
							 
						 
						
							
							
								
								clang-format: No space between ")" and braced init list.  
							
							... 
							
							
							
							Before:
  auto j = decltype(i) {};
After:
  auto j = decltype(i){};
This fixes llvm.org/PR19892.
llvm-svn: 210013 
							
						 
						
							2014-06-02 10:57:55 +00:00  
				
					
						
							
							
								 
						
							
								e18ff37e08 
								
							 
						 
						
							
							
								
								clang-format: Fix Allman brace breaking of enums.  
							
							... 
							
							
							
							Before:
  enum Side
  { LEFT,
    RIGHT };
After:
  enum Side
  {
    LEFT,
    RIGHT
  };
This fixes llvm.org/PR19911.
llvm-svn: 210011 
							
						 
						
							2014-06-02 10:17:32 +00:00  
				
					
						
							
							
								 
						
							
								e3f907fded 
								
							 
						 
						
							
							
								
								clang-format: Fix trailing const (etc.) with Allman brace style.  
							
							... 
							
							
							
							Before:
  void someLongFunction(int someLongParameter)
      const
  {
  }
After:
  void someLongFunction(
      int someLongParameter) const
  {
  }
This fixes llvm.org/PR19912.
llvm-svn: 210010 
							
						 
						
							2014-06-02 09:52:08 +00:00  
				
					
						
							
							
								 
						
							
								d39312ec84 
								
							 
						 
						
							
							
								
								clang-format: Don't break before a case's colon.  
							
							... 
							
							
							
							Before (with just the right line length:
  switch (a) {
  case some_namespace::some_constant
      :
    return;
  }
After:
  switch (a) {
  case some_namespace::
      some_constant:
    return;
  }
llvm-svn: 209725 
							
						 
						
							2014-05-28 10:09:11 +00:00  
				
					
						
							
							
								 
						
							
								ba1b6bb667 
								
							 
						 
						
							
							
								
								clang-format: Keep '{' of dict literals on the same line in Allman style  
							
							... 
							
							
							
							Before:
  void f()
  {
    [object
        someMethod:@
        { @"a" : @"b" }];
  }
After:
  void f()
  {
    [object someMethod:@{ @"a" : @"b" }];
  }
This fixes llvm.org/PR19854.
llvm-svn: 209615 
							
						 
						
							2014-05-26 07:24:34 +00:00  
				
					
						
							
							
								 
						
							
								565ed5ed08 
								
							 
						 
						
							
							
								
								clang-format: Don't use Allman brace breaking for ObjC blocks.  
							
							... 
							
							
							
							It just seems wrong. This fixes llvm.org/PR19736.
llvm-svn: 209440 
							
						 
						
							2014-05-22 13:53:55 +00:00  
				
					
						
							
							
								 
						
							
								49802ef93b 
								
							 
						 
						
							
							
								
								clang-format: [JS] Understand line breaks in concatenated strings.  
							
							... 
							
							
							
							Before:
  var literal = 'hello ' + 'world';
After:
  var literal = 'hello ' +
                'world';
There is no reason to concatenated two string literals with a '+' unless
the line break is intended.
llvm-svn: 209413 
							
						 
						
							2014-05-22 09:10:04 +00:00  
				
					
						
							
							
								 
						
							
								3948516a03 
								
							 
						 
						
							
							
								
								clang-format: Correctly identify multiplications in braces init lists.  
							
							... 
							
							
							
							Before:
  int i{a *b};
After:
  int i{a * b};
Also fix unrelated issue where braced init lists were counted as blocks
and prevented single-line functions.
llvm-svn: 209412 
							
						 
						
							2014-05-22 09:00:33 +00:00  
				
					
						
							
							
								 
						
							
								5f3ea477cf 
								
							 
						 
						
							
							
								
								clang-format: Correctly calculate line lenghts for nest blocks.  
							
							... 
							
							
							
							If simple (one-statement) blocks can be inlined, the length needs to be
calculated correctly.
Before (in JavaScript but this also affects lambdas, etc.):
  var x = {
    valueOf: function() { return 1; }
  };
After:
  var x = {valueOf: function() { return 1; }};
llvm-svn: 209410 
							
						 
						
							2014-05-22 08:36:53 +00:00  
				
					
						
							
							
								 
						
							
								0dd5291e69 
								
							 
						 
						
							
							
								
								clang-format: [JS] Support ES6 destructuring assignments.  
							
							... 
							
							
							
							Before:
  var[a, b, c] = [1, 2, 3];
After:
  var [a, b, c] = [1, 2, 3];
llvm-svn: 209113 
							
						 
						
							2014-05-19 07:37:07 +00:00  
				
					
						
							
							
								 
						
							
								0a1e5ace26 
								
							 
						 
						
							
							
								
								clang-format: Don't break in the middle of ">>".  
							
							... 
							
							
							
							Before:
  zzzzzzzzzz = bbbbbbbbbbbbbbbbb >
               > aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaa);
After:
  zzzzzzzzzz
      = bbbbbbbbbbbbbbbbb
        >> aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaa);
This fixes llvm.org/PR19731.
llvm-svn: 208672 
							
						 
						
							2014-05-13 08:01:47 +00:00  
				
					
						
							
							
								 
						
							
								b05a81debb 
								
							 
						 
						
							
							
								
								clang-format: Fix bug introduced by r208392.  
							
							... 
							
							
							
							Also run clang-format over clang-format's files.
llvm-svn: 208409 
							
						 
						
							2014-05-09 13:11:16 +00:00  
				
					
						
							
							
								 
						
							
								8951908218 
								
							 
						 
						
							
							
								
								clang-format: [JS] Fix spacing in dict literals.  
							
							... 
							
							
							
							Before:
  someVariable = {'a':[{}]};
After:
  someVariable = {'a': [{}]};
llvm-svn: 208403 
							
						 
						
							2014-05-09 10:26:08 +00:00  
				
					
						
							
							
								 
						
							
								2145bc0229 
								
							 
						 
						
							
							
								
								[C++11] Use 'nullptr'.  
							
							... 
							
							
							
							llvm-svn: 208392 
							
						 
						
							2014-05-09 08:15:10 +00:00  
				
					
						
							
							
								 
						
							
								ea2d042f89 
								
							 
						 
						
							
							
								
								clang-format: Fix binary operator detection before lambdas.  
							
							... 
							
							
							
							Before:
  bool foo = true&& [] { return false; }();
After:
  bool foo = true && [] { return false; }();
llvm-svn: 208288 
							
						 
						
							2014-05-08 08:50:10 +00:00  
				
					
						
							
							
								 
						
							
								f9ae312fc0 
								
							 
						 
						
							
							
								
								clang-format: [JS] Initial support for regex literals.  
							
							... 
							
							
							
							llvm-svn: 208281 
							
						 
						
							2014-05-08 07:01:45 +00:00  
				
					
						
							
							
								 
						
							
								8acf822b6f 
								
							 
						 
						
							
							
								
								clang-format: Fix corner cases for comments in if conditions.  
							
							... 
							
							
							
							Before:
  if ( // a
          x + 3) { ..
After:
  if ( // a
      x + 3) { ..
llvm-svn: 208175 
							
						 
						
							2014-05-07 09:23:05 +00:00  
				
					
						
							
							
								 
						
							
								7a2d60e328 
								
							 
						 
						
							
							
								
								clang-format: Fix bad space before braced initializer.  
							
							... 
							
							
							
							Before:
  new int {1};
After:
  new int{1};
llvm-svn: 208168 
							
						 
						
							2014-05-07 07:59:03 +00:00  
				
					
						
							
							
								 
						
							
								484033b188 
								
							 
						 
						
							
							
								
								clang-format: [JS] Keep space after closure style comments.  
							
							... 
							
							
							
							Before:
  var x = /** @type {foo} */ (bar);
After:
  var x = /** @type {foo} */(bar);
llvm-svn: 208093 
							
						 
						
							2014-05-06 14:41:29 +00:00  
				
					
						
							
							
								 
						
							
								166c19bd37 
								
							 
						 
						
							
							
								
								clang-format: [JS] Keep space between 'return' and '['.  
							
							... 
							
							
							
							llvm-svn: 208090 
							
						 
						
							2014-05-06 14:12:21 +00:00  
				
					
						
							
							
								 
						
							
								2e92e66f66 
								
							 
						 
						
							
							
								
								Fixed one issue with casting  
							
							... 
							
							
							
							Before:
(void) SimplifyICmpOperands(Cond, LHS, RHS);
After:
(void)SimplifyICmpOperands(Cond, LHS, RHS);
Differential Revision: http://reviews.llvm.org/D3615 
llvm-svn: 208080 
							
						 
						
							2014-05-06 11:46:49 +00:00  
				
					
						
							
							
								 
						
							
								13b9b7e0e8 
								
							 
						 
						
							
							
								
								Pulled out cast detection in TokenAnnotator into its own function  
							
							... 
							
							
							
							This is to remove FIXME added in r207964.
Differential Revision: http://reviews.llvm.org/D3619 
llvm-svn: 208071 
							
						 
						
							2014-05-06 09:08:34 +00:00  
				
					
						
							
							
								 
						
							
								f10a28d705 
								
							 
						 
						
							
							
								
								clang-format: Understand functions with decltype return type.  
							
							... 
							
							
							
							Before:
  decltype(long_name_forcing_break)
      f() {}
After:
  decltype(long_name_forcing_break)
  f() {}
llvm-svn: 207965 
							
						 
						
							2014-05-05 13:48:09 +00:00  
				
					
						
							
							
								 
						
							
								76f98f8047 
								
							 
						 
						
							
							
								
								Added some heuristics to identify c style casting  
							
							... 
							
							
							
							Before:
void f() { my_int a = (my_int) * b; }
void f() { return P ? (my_int) * P : (my_int)0; }
After:
void f() { my_int a = (my_int)*b; }
void f() { return P ? (my_int)*P : (my_int)0; }
Differential Revision: http://reviews.llvm.org/D3576 
llvm-svn: 207964 
							
						 
						
							2014-05-05 13:14:35 +00:00  
				
					
						
							
							
								 
						
							
								0e6c51c889 
								
							 
						 
						
							
							
								
								clang-format: Improve understanding of decltype.  
							
							... 
							
							
							
							Before:
  SomeFunction([](decltype(x), A * a) {});
After:
  SomeFunction([](decltype(x), A *a) {});
llvm-svn: 207961 
							
						 
						
							2014-05-05 12:36:29 +00:00  
				
					
						
							
							
								 
						
							
								942d971c84 
								
							 
						 
						
							
							
								
								clang-format: Improve binary operator detection.  
							
							... 
							
							
							
							Before:
  *(int *)(p &~3UL) = 0;
After:
  *(int *)(p & ~3UL) = 0;
This fixes llvm.org/PR19464.
llvm-svn: 207405 
							
						 
						
							2014-04-28 09:19:28 +00:00  
				
					
						
							
							
								 
						
							
								031e2409f9 
								
							 
						 
						
							
							
								
								clang-format: Fixes spaces in case statements.  
							
							... 
							
							
							
							This fixes llvm.org/PR19482.
Before:
  switch (a) {
    case(B) :
      return;
  }
After:
  switch (a) {
    case (B):
      return;
  }
llvm-svn: 207402 
							
						 
						
							2014-04-28 07:48:36 +00:00  
				
					
						
							
							
								 
						
							
								437c3f5188 
								
							 
						 
						
							
							
								
								clang-format: Don't wrap after @interface.  
							
							... 
							
							
							
							This fixes llvm.org/PR19450.
Before:
  @interface
  BookmarkHomeHandsetViewController ()<BookmarkAllCollectionViewDelegate,
                                       BookmarkFolderCollectionViewDelegate,
                                       BookmarkMenuViewControllerDelegate,
                                       BookmarkSearchViewControllerDelegate> {
  }
After:
  @interface aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ()<
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa> {
  }
llvm-svn: 207400 
							
						 
						
							2014-04-28 07:34:48 +00:00  
				
					
						
							
							
								 
						
							
								57f5fbe3b2 
								
							 
						 
						
							
							
								
								[Modules] Update Clang's two files that use DEBUG(...) without defining  
							
							... 
							
							
							
							DEBUG_TYPE to do so. LLVM's Debug.h requires this as of r206822.
llvm-svn: 206823 
							
						 
						
							2014-04-21 22:55:36 +00:00  
				
					
						
							
							
								 
						
							
								0e61784ae5 
								
							 
						 
						
							
							
								
								clang-format: Add special case to reduce indentaiton in streams.  
							
							... 
							
							
							
							This is similar to how we treat assignments and seems to be generally
desirable.
Before:
  llvm::errs() << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
                      aaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                      aaaaaaaaaaaaaaaaaaaaaaaaaaaa);
After:
  llvm::errs() << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaa);
llvm-svn: 206384 
							
						 
						
							2014-04-16 12:26:54 +00:00  
				
					
						
							
							
								 
						
							
								783bac6bba 
								
							 
						 
						
							
							
								
								clang-format: Understand proto text format without commas.  
							
							... 
							
							
							
							Also removed spaces before colons as they don't seem to be used
frequently.
Before:
optional int32 b = 2
    [(foo_options) = {aaaaaaaaaaaaaaaaaaa : 123 bbbbbbbbbbbbbbbbbbbbbbbb :
                          "baz"}];
After:
optional int32 b = 2 [(foo_options) = {aaaaaaaaaaaaaaaaaaa: 123,
                                       bbbbbbbbbbbbbbbbbbbbbbbb:"baz"}];
llvm-svn: 206269 
							
						 
						
							2014-04-15 09:54:30 +00:00  
				
					
						
							
							
								 
						
							
								866468ae4d 
								
							 
						 
						
							
							
								
								clang-format: Fix regression caused by r206165.  
							
							... 
							
							
							
							llvm-svn: 206173 
							
						 
						
							2014-04-14 13:15:29 +00:00  
				
					
						
							
							
								 
						
							
								72ab43b28b 
								
							 
						 
						
							
							
								
								clang-format: Fix incorrect &&-detection in macros.  
							
							... 
							
							
							
							Before:
  #define A(a, b) (a &&b)
After:
  #define A(a, b) (a && b)
This fixes llvm.org/PR19343.
llvm-svn: 206165 
							
						 
						
							2014-04-14 12:50:02 +00:00  
				
					
						
							
							
								 
						
							
								c0d606a584 
								
							 
						 
						
							
							
								
								clang-format: Don't allow hanging indentation for operators on new lines  
							
							... 
							
							
							
							Before:
  if (aaaaaaaa && bbbbbbbbbbbbbbb // need to wrap
                  == cccccccccccccc) ...
After:
  if (aaaaaaaa
      && bbbbbbbbbbbbbbb // need to wrap
         == cccccccccccccc) ...
The same rule has already be implemented for BreakBeforeBinaryOperators
set to false in r205527.
llvm-svn: 206159 
							
						 
						
							2014-04-14 11:08:45 +00:00  
				
					
						
							
							
								 
						
							
								35ec2b244a 
								
							 
						 
						
							
							
								
								clang-format: Improve formatting of annotated variables.  
							
							... 
							
							
							
							Before:
  bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY(
      aaaaaaaaaaaa) = aaaaaaaa::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
After:
  bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY(aaaaaaaaaaaa) =
      aaaaaaaa::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
llvm-svn: 206155 
							
						 
						
							2014-04-14 08:15:20 +00:00  
				
					
						
							
							
								 
						
							
								1fcbe675fa 
								
							 
						 
						
							
							
								
								Correctly handle escaped newlines when the next token starts without a space.  
							
							... 
							
							
							
							We will need this to correctly handle conflict markers inside macro
definitions.
llvm-svn: 206029 
							
						 
						
							2014-04-11 12:27:47 +00:00  
				
					
						
							
							
								 
						
							
								f9fc215f82 
								
							 
						 
						
							
							
								
								clang-format: Treat a trailing comment like a trailing comma in braced lists.  
							
							... 
							
							
							
							Before:
  static StructInitInfo module = {MODULE_BUILTIN, /* type */
                                  "streams" /* name */
  };
After:
  static StructInitInfo module = {
      MODULE_BUILTIN, /* type */
      "streams"       /* name */
  };
This fixes llvm.org/PR19378.
llvm-svn: 205851 
							
						 
						
							2014-04-09 13:18:49 +00:00  
				
					
						
							
							
								 
						
							
								f9a0906b98 
								
							 
						 
						
							
							
								
								clang-format: Allow breaking between trailing annotations in more cases.  
							
							... 
							
							
							
							Before:
  void aaaaaaaaaaaaaa(aaaaaaaa aaa) override AAAAAAAAAAAAAAAAAAAAAAAA(
      aaaaaaaaaaaaaaa);
After:
  void aaaaaaaaaaaaaa(aaaaaaaa aaa) override
      AAAAAAAAAAAAAAAAAAAAAAAA(aaaaaaaaaaaaaaa);
llvm-svn: 205846 
							
						 
						
							2014-04-09 10:29:11 +00:00  
				
					
						
							
							
								 
						
							
								b48d3afcd5 
								
							 
						 
						
							
							
								
								clang-format: Keep more trailing annotations on the same line.  
							
							... 
							
							
							
							More precisely keep all short annotations (<10 characters) on the same
line if possible. Previously, clang-format would only prefer to do so
for "const", "override" and "final". However, it seems to be generally
preferable, especially because some codebases have to wrap those in
macros for backwards compatibility.
Before:
  void someLongFunction(int someLongParameter)
      OVERRIDE {}
After:
  void someLongFunction(
      int someLongParameter) OVERRIDE {}
This fixes llvm.org/PR19363.
llvm-svn: 205845 
							
						 
						
							2014-04-09 10:01:49 +00:00  
				
					
						
							
							
								 
						
							
								b175d57edc 
								
							 
						 
						
							
							
								
								clang-format: Recognize lists ending in trailing commas correctly.  
							
							... 
							
							
							
							Previously, this did not look through trailing comments leading to a few
formatting oddities.
llvm-svn: 205843 
							
						 
						
							2014-04-09 09:53:23 +00:00  
				
					
						
							
							
								 
						
							
								b77105d2ce 
								
							 
						 
						
							
							
								
								clang-format: Fix incorrect multi-block-parameter computation.  
							
							... 
							
							
							
							llvm-svn: 205763 
							
						 
						
							2014-04-08 14:04:31 +00:00  
				
					
						
							
							
								 
						
							
								139d4a3875 
								
							 
						 
						
							
							
								
								clang-format: Correctly understand arrays of pointers.  
							
							... 
							
							
							
							Before:
  A<int * []> a;
After:
  A<int *[]> a;
This fixes llvm.org/PR19360.
llvm-svn: 205761 
							
						 
						
							2014-04-08 13:07:41 +00:00  
				
					
						
							
							
								 
						
							
								cc7bf7fda1 
								
							 
						 
						
							
							
								
								clang-format: Understand that "auto" is a type.  
							
							... 
							
							
							
							Before:
  MACRO(auto * a);
After:
  MACRO(auto *a);
llvm-svn: 205517 
							
						 
						
							2014-04-03 09:00:49 +00:00  
				
					
						
							
							
								 
						
							
								e1e4319ab7 
								
							 
						 
						
							
							
								
								clang-format: Support configurable list of foreach-macros.  
							
							... 
							
							
							
							This fixes llvm.org/PR17242.
Patch by Brian Green, thank you!
llvm-svn: 205307 
							
						 
						
							2014-04-01 12:55:11 +00:00  
				
					
						
							
							
								 
						
							
								9481556eb6 
								
							 
						 
						
							
							
								
								Get rid of the adapted isLiteral method.  
							
							... 
							
							
							
							We don't want to deviate from clang's standard terminology.
llvm-svn: 204997 
							
						 
						
							2014-03-28 09:27:09 +00:00  
				
					
						
							
							
								 
						
							
								1f9d80ac66 
								
							 
						 
						
							
							
								
								Improve handling of bool expressions in template arguments.  
							
							... 
							
							
							
							Now correctly formats:
  foo<true && false>();
llvm-svn: 204950 
							
						 
						
							2014-03-27 19:00:52 +00:00  
				
					
						
							
							
								 
						
							
								f81e5c0e50 
								
							 
						 
						
							
							
								
								Fix bool expression special case.  
							
							... 
							
							
							
							Clang-format now correctly formats:
  some_type<a * b> v;
  template <bool a, bool b> typename enabled_if<a && b>::type f() {}
llvm-svn: 204913 
							
						 
						
							2014-03-27 11:17:36 +00:00  
				
					
						
							
							
								 
						
							
								c13ee34378 
								
							 
						 
						
							
							
								
								clang-format: Correctly identify ObjC Block with return type.  
							
							... 
							
							
							
							llvm-svn: 204905 
							
						 
						
							2014-03-27 09:43:54 +00:00  
				
					
						
							
							
								 
						
							
								a65e887587 
								
							 
						 
						
							
							
								
								clang-format: Fix incorrect &/* detection.  
							
							... 
							
							
							
							Before:
  STATIC_ASSERT((a &b) == 0);
After:
  STATIC_ASSERT((a & b) == 0);
llvm-svn: 204709 
							
						 
						
							2014-03-25 10:52:45 +00:00  
				
					
						
							
							
								 
						
							
								a125d53a7b 
								
							 
						 
						
							
							
								
								clang-format: Let a trailing comma in braced lists enforce linebreaks.  
							
							... 
							
							
							
							Before:
  vector<int> x{1, 2, 3, 4, };
After:
  vector<int> x{
      1, 2, 3, 4,
  };
This fixes llvm.org/PR18519.
llvm-svn: 204458 
							
						 
						
							2014-03-21 12:38:57 +00:00  
				
					
						
							
							
								 
						
							
								28df0a356e 
								
							 
						 
						
							
							
								
								clang-format: Fix for r204456.  
							
							... 
							
							
							
							llvm-svn: 204457 
							
						 
						
							2014-03-21 12:15:40 +00:00  
				
					
						
							
							
								 
						
							
								14e58e5290 
								
							 
						 
						
							
							
								
								clang-format: Preserve meaning of trailing comments on parameters.  
							
							... 
							
							
							
							Formatting:
  SomeFunction(a,
            b, // comment
            c);
Before:
  SomeFunction(a, b, // comment
               c);
After:
  SomeFunction(a,
               b, // comment
               c);
llvm-svn: 204456 
							
						 
						
							2014-03-21 11:58:45 +00:00  
				
					
						
							
							
								 
						
							
								819788da83 
								
							 
						 
						
							
							
								
								Fix crasher bug.  
							
							... 
							
							
							
							Due to not resetting the fake rparen data on the token when iterating
over annotated lines, we would pop the last element of the paren stack.
This patch fixes the underlying root cause, and makes the code more
robust against similar problems in the future:
- reset the first token when iterating on the same annotated lines due
  to preprocessor branches
- never pop the last element from the paren stack, so we do not crash,
  but rather incorrectly format
- add assert()s so we can figure out if our assumptions are violated
llvm-svn: 204140 
							
						 
						
							2014-03-18 11:22:45 +00:00  
				
					
						
							
							
								 
						
							
								c580af96fa 
								
							 
						 
						
							
							
								
								clang-format: Detect weird macro lambda usage.  
							
							... 
							
							
							
							Before:
  void f() {
    MACRO((const AA & a) { return 1; });
  }
After:
  void f() {
    MACRO((const AA &a) { return 1; });
  }
llvm-svn: 203551 
							
						 
						
							2014-03-11 09:29:46 +00:00  
				
					
						
							
							
								 
						
							
								84a12e18d3 
								
							 
						 
						
							
							
								
								clang-format: Add spaces between lambdas and comments.  
							
							... 
							
							
							
							Before:
  void f() {
    bar([]() {}// Does not respect SpacesBeforeTrailingComments
        );
  }
After:
  void f() {
    bar([]() {} // Does not respect SpacesBeforeTrailingComments
        );
  }
This fixes llvm.org/PR19017.
llvm-svn: 203466 
							
						 
						
							2014-03-10 15:06:25 +00:00  
				
					
						
							
							
								 
						
							
								81a20787db 
								
							 
						 
						
							
							
								
								clang-format: Add spaces around trailing/lambda return types.  
							
							... 
							
							
							
							Before:
  int c = []()->int { return 2; }();
After:
  int c = []() -> int { return 2; }();
llvm-svn: 203452 
							
						 
						
							2014-03-10 10:02:02 +00:00  
				
					
						
							
							
								 
						
							
								5550de684f 
								
							 
						 
						
							
							
								
								clang-format: Don't wrap "const" etc. of function declarations.  
							
							... 
							
							
							
							Generally people seem to prefer wrapping the first function parameter
over wrapping the trailing tokens "const", "override" and "final". This
does not extend to function-like annotations and probably not to other
non-standard annotations.
Before:
  void someLongFunction(int SomeLongParameter)
      const { ... }
After:
  void someLongFunction(
      int SomeLongParameter) const { ... }
llvm-svn: 201504 
							
						 
						
							2014-02-17 07:57:46 +00:00  
				
					
						
							
							
								 
						
							
								3a122c029d 
								
							 
						 
						
							
							
								
								clang-format: Fix formatting of class template declaration.  
							
							... 
							
							
							
							Before:
  template <class R, class C>
  struct Aaaaaaaaaaaaaaaaa<R (C::*)(int)
                           const> : Aaaaaaaaaaaaaaaaa<R (C::*)(int)> {};
After:
  template <class R, class C>
  struct Aaaaaaaaaaaaaaaaa<R (C::*)(int) const>
      : Aaaaaaaaaaaaaaaaa<R (C::*)(int)> {};
llvm-svn: 201424 
							
						 
						
							2014-02-14 18:22:40 +00:00  
				
					
						
							
							
								 
						
							
								9cc3e97685 
								
							 
						 
						
							
							
								
								clang-format: Fix range-based for-loop formatting.  
							
							... 
							
							
							
							Before:
  for (aaaaaaaaa aaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaa.aaaaaaaaaaaa()
           .aaaaaaaaa()
           .a()) {
  }
After:
  for (aaaaaaaaa aaaaaaaaaaaaaaaaaaaaa :
       aaaaaaaaaaaa.aaaaaaaaaaaa().aaaaaaaaa().a()) {
  }
llvm-svn: 200968 
							
						 
						
							2014-02-07 10:09:46 +00:00  
				
					
						
							
							
								 
						
							
								f24301d79c 
								
							 
						 
						
							
							
								
								clang-format: More custom option fixes for protocol buffer files.  
							
							... 
							
							
							
							Before:
  repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {
                               aaaaaaaaaaaaaaaa : AAAAAAAAAA,
                               bbbbbbbbbbbbbbbb : BBBBBBBBBB
                             }];
After:
  repeated double value = 1
      [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaa : AAAAAAAAAA,
                              bbbbbbbbbbbbbbbb : BBBBBBBBBB}];
llvm-svn: 200406 
							
						 
						
							2014-01-29 18:52:43 +00:00