aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format
AgeCommit message (Collapse)Author
2013-02-19Correctly format macro with unfinished template declaration.Daniel Jasper
We can now format: #define A template <typename T> Before this created a segfault :-/. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175533 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18Improve indentation of builder type calls.Daniel Jasper
In builder-type calls, it can be very confusing to just indent parameters from the start of the line. Instead, indent 4 from the correct function call. Before: aaaaaaaaaaaaaaaaaaa()->aaaaaa(bbbbb)->aaaaaaaaaaaaaaaaaaa( // break aaaaaaaaaaaaaa); aaaaaaaaaaaaaaaaaaaaaaa *aaaaaaaaa = aaaaaa->aaaaaaaaaaaa()->aaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) ->aaaaaaaaaaaaaaaaa(); After: aaaaaaaaaaaaaaaaaaa()->aaaaaa(bbbbb)->aaaaaaaaaaaaaaaaaaa( // break aaaaaaaaaaaaaa); aaaaaaaaaaaaaaaaaaaaaaa *aaaaaaaaa = aaaaaa->aaaaaaaaaaaa() ->aaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) ->aaaaaaaaaaaaaaaaa(); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175444 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18Improve formatting of builder-type calls.Daniel Jasper
Before: aaaaaaa->aaaaaaa->aaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)->aaaaaaaa(aaaaaaaaaaaaaaa); After: aaaaaaa->aaaaaaa ->aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) ->aaaaaaaa(aaaaaaaaaaaaaaa); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175441 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18Reformat lines if they were "moved around".Daniel Jasper
An unwrapped line can get moved around if there is no newline before it and the previous line was formatted. Example: template<typename T> // Cursor is on this line when hitting "format" T *getFETokenInfo() const { return static_cast<T*>(FETokenInfo); } "return .." is the second unwrapped line in this scenario. I does not touch any reformatted region. Thus, the result of formatting is: template <typename T> T *getFETokenInfo() const { return static_cast<T *>(FETokenInfo); } After second format (and arguably desired end-result): template <typename T> T *getFETokenInfo() const { return static_cast<T *>(FETokenInfo); } This fixes: llvm.org/PR15060. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175440 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18Correctly determine */& usage in more cases.Daniel Jasper
This fixes llvm.org/PR15248. Before: Test::Test(int b) : a(b *b) {} for (int i = 0; i < a *a; ++i) {} After: Test::Test(int b) : a(b * b) {} for (int i = 0; i < a * a; ++i) {} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175439 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18Always break after multi-line string literals.Daniel Jasper
Otherwise, other parameters can be quite hidden. Reformatted unittests/Format/FormatTest.cpp after this. Before: someFunction("Always break between multi-line" " string literals", and, other, parameters); After: someFunction("Always break between multi-line" " string literals", and, other, parameters); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175436 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18Prevent line breaks that make stuff hard to read.Daniel Jasper
Before: aaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa).aaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaa).aaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); After: aaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa) .aaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa) .aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175432 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15Recognize < and > as binary expressions in builder-type calls.Daniel Jasper
The current heuristic assumes that there can't be binary operators in builder-type calls (excluding assigments). However, it also excluded < and > in general, which is wrong. Now they are only excluded if they are template parameters. Before: return aaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa()i .aaaaaa() < aaaaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa(); After: return aaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa() < aaaaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa(); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175291 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15Done break between 'operator' and '<<'.Daniel Jasper
Before: ostream &operator <<(ostream &out, some::ns::SomeReallyLongType WithSomeReallyLongValue); After: ostream &operator<<(ostream &out, some::ns::SomeReallyLongType WithSomeReallyLongValue); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175286 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15Re-enable ConstructorInitializerAllOnOneLineOrOnePerLine option.Daniel Jasper
This got lost and was untested as the same effect is achieved by avoiding bin packing, which is active in Google style by default. However, moving forward, we want more control over the bin packing option(s) and thus, this flag should work as expected. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175277 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15Prevent only breaking before "?" in conditional expressions.Daniel Jasper
This is almost always more readable. Before: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaaaaaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaa; After: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaaaaaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaa; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175262 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14Fix counting of parameters so that r175162 works as expected.Daniel Jasper
Before: aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() .aaaaaaaaaaaaaaaaa()); After: aaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa().aaaaaaaaaaaaaaaaa()); Not sure which of the formattings above is better, but we should not pick one by accident. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175165 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14Reduce penalty for breaking before ./-> after complex calls.Daniel Jasper
This gives a clearer separation of the context, e.g. in GMOCK statements. Before: EXPECT_CALL(SomeObject, SomeFunction(Parameter)).WillRepeatedly(Return(SomeValue)); After: EXPECT_CALL(SomeObject, SomeFunction(Parameter)) .WillRepeatedly(Return(SomeValue)); Minor format cleanups. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175162 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14Remove the trailing whitespace of formatted lines.Daniel Jasper
So far, clang-format has always assumed the whitespace belonging to the subsequent token. This has the negative side-effect that when clang-format formats a line, it does not remove its trailing whitespace, as it belongs to the next token. Thus, this patch fixes most of llvm.org/PR15062. We are not zapping a file's trailing whitespace so far, as this does not belong to any token we see during formatting. We need to fix this in a subsequent patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175152 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14Get less confused by trailing comma in Google style.Daniel Jasper
The formatter can now format: void aaaaaaaaaaaaaaaaaa(int level, double *min_x, double *max_x, double *min_y, double *max_y, double *min_z, double *max_z, ) { } Although this is invalid code, it frequently happens during development and clang-format should be nicer :-). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175151 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14Remove accidentally committed empty test.Daniel Jasper
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175148 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14Align superclasses for multiple inheritence.Daniel Jasper
This fixes llvm.org/PR15179. Before: class ColorChooserMac : public content::ColorChooser, public content::WebContentsObserver { }; After: class ColorChooserMac : public content::ColorChooser, public content::WebContentsObserver { }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175147 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13Allow breaking after the return type in function declarations.Daniel Jasper
This has so far been disabled for Google style, but should be done before breaking at nested name specifiers or in template parameters. Before (in Google style): template <typename T> aaaaaaaa::aaaaa::aaaaaa<T, aaaaaaaaaaaaaaaaaaaaaaaaa> aaaaaaaaaaaaaaaaaaaaaaaa< T>::aaaaaaa() {} After: template <typename T> aaaaaaaa::aaaaa::aaaaaa<T, aaaaaaaaaaaaaaaaaaaaaaaaa> aaaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaa() {} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175074 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13Fix comment alignment close to the column limit.Daniel Jasper
Due to an error in one of the expressions, we used to not align comments although it would have been possible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175068 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13Formatter: And more cast tests (these don't pass yet).Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175031 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13Formatter: Add more cast tests.Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175030 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13Formatter: Refactor the cast detection code to be a bit more readable.Nico Weber
No functionality change. Also add another cast test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175029 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13Formatter: Detect ObjC method expressions after casts.Nico Weber
Not all casts are correctly detected yet, but it helps in some cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175028 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12Fix crash for incomplete labels in macros.Daniel Jasper
Still the formatting can be improved, but at least we don't assert any more. This happened when trying to format lib/Sema/SemaType.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175003 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12Fix bug in the adjustment to existing lines.Daniel Jasper
Before (if only the second line was reformatted): void f() {} void g() {} After: void f() {} void g() {} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174978 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12Formatter: Correctly format stars in `sizeof(int**)` and similar places.Nico Weber
This redoes how '*' and '&' are classified as pointer / reference markers when followed by ')', '>', or ','. Previously, determineStarAmpUsage() marked a single '*' and '&' followed by ')', '>', or ',' as pointer or reference marker. Now, all '*'s and '&'s preceding ')', '>', or ',' are marked as pointer / reference markers. Fixes PR14884. Since only the last '*' in 'int ***' was marked as pointer before (the rest were unary operators, which don't reach spaceRequiredBetween()), spaceRequiredBetween() now had to be thought about handing multiple '*'s in sequence. Before: return sizeof(int * *); Type **A = static_cast<Type * *>(P); Now: return sizeof(int**); Type **A = static_cast<Type **>(P); While here, also make all methods of AnnotatingParser except parseLine() private. Review URL: http://llvm-reviews.chandlerc.com/D384 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174975 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-11Formatter: Detect ObjC message expressions after 'in' in loopNico Weber
Before: for (id foo in[self getStuffFor : bla]) { } Now: for (id foo in [self getStuffFor:bla]) { } "in" is treated as loop keyword if the line starts with "for", and as a regular identifier else. To check for "in", its IdentifierInfo is handed through a few layers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174889 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-11Get rid of manual debug output, now that the test runner supports it.Manuel Klimek
You can run tests with -debug instead now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174880 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-11Fix invalid formatting with spaces before trailing comments.Daniel Jasper
In google style, trailing comments are separated by two spaces. This patch fixes the counting of these spaces and prevents clang-format from creating a line with 81 columns. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174879 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-11Fixes handling of empty lines in macros.Manuel Klimek
Now correctly formats: #define A \ \ b; to #define A b; Added the state whether an unwrapped line is a macro to the debug output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174878 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-11Fix formatting of overloaded operator definitions.Daniel Jasper
Before: operatorvoid*(); operator vector< A< A>>(); After: operator void *(); operator vector<A<A> >(); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174863 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-10Formatter: Add a test for multi-line ObjC dict literals.Nico Weber
As it turns out, this already works reasonably well. This example from http://clang.llvm.org/docs/ObjectiveCLiterals.html NSDictionary *dictionary = @{ @"name" : NSUserName(), @"date" : [NSDate date], @"processInfo" : [NSProcessInfo processInfo] }; is formatted like NSDictionary *dictionary = @{ @"name" : NSUserName(), @"date" : [NSDate date], @"processInfo" : [NSProcessInfo processInfo] }; There's already a FIXME in NestedStaticInitializers about supporting one initializer per line, which is really all that's missing here too. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174842 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-10Formatter: Add another ObjC literal test.Nico Weber
(From http://clang.llvm.org/docs/ObjectiveCLiterals.html.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174841 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-10Formatter: Initial support for ObjC dictionary literals.Nico Weber
Before: @{ foo: bar } ; Now: @{ foo : bar }; parseBracedList() already does the right thing from an UnwrappedLineParser perspective, so check for "@{" in all loops that process constructs that can contain expressions and call parseBracedList() if found. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174840 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-10Formatter: Detect ObjC array literals.Nico Weber
Use this to add a space after "@[" and before "]" for now. Later, I want to use this to format multi-line array literals nicer, too. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174822 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-09Formatter: Add test for default arguments.Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174816 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08Fix indentation-detection at indent level 0.Manuel Klimek
This correctly formats: { a; } where { is incorrectly indented by 2, but is at level 0, when reformatting only 'a;'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174737 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08Takes the context into account when re-indenting regions.Manuel Klimek
Fixes llvm.org/PR14916. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174720 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08Fix handling of fake parenthesis during formatting.Daniel Jasper
They are much easier to handle when attached to the previous token. Before: unsigned Indent = formatFirstToken(TheLine.First, IndentForLevel[TheLine.Level] >= 0 ? IndentForLevel[TheLine.Level] : TheLine.Level * 2, TheLine.InPPDirective, PreviousEndOfLineColumn); After: unsigned Indent = formatFirstToken( TheLine.First, IndentForLevel[TheLine.Level] >= 0 ? IndentForLevel[TheLine.Level] : TheLine.Level * 2, TheLine.InPPDirective, PreviousEndOfLineColumn); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174718 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08Implement a tiny expression parser to improve formatting decisions.Daniel Jasper
With this patch, the formatter introduces 'fake' parenthesis according to the operator precedence of binary operators. Before: return aaaa & AAAAAAAAAAAAAAAAAAAAAAAAAAAAA || bbbb & BBBBBBBBBBBBBBBBBBBBBBBBBBBBB || cccc & CCCCCCCCCCCCCCCCCCCCCCCCCC || dddd & DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD; f(aaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaa); After: return aaaa & AAAAAAAAAAAAAAAAAAAAAAAAAAAAA || bbbb & BBBBBBBBBBBBBBBBBBBBBBBBBBBBB || cccc & CCCCCCCCCCCCCCCCCCCCCCCCCC || dddd & DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD; f(aaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaa); Future improvements: - Get rid of some of the hacky ways to nicely format certain constructs. - Merge this parser and the AnnotatingParser as we now have several parsers that analyze (), [], etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174714 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08Avoid unnecessary line breaks in nested ObjC calls.Daniel Jasper
Before: [pboard setData:[NSData dataWithBytes:&button length:sizeof(button)] forType:kBookmarkButtonDragType]; After: [pboard setData:[NSData dataWithBytes:&button length:sizeof(button)] forType:kBookmarkButtonDragType]; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174701 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-07clang-format: Don't put useless space in f( ::g()).Daniel Jasper
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174662 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-07Formatter: Move ObjC literal tests to its own test case.Nico Weber
Slightly expand the boxed expressions test with a few more snippets from http://clang.llvm.org/docs/ObjectiveCLiterals.html git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174559 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-06Fix bug in the alignment of comments.Daniel Jasper
Before: const char *test[] = { // A "aaaa", // B "aaaaa", }; After: const char *test[] = { // A "aaaa", // B "aaaaa", }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174549 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-06Become a little smarter with formatting long chains of pipes.Daniel Jasper
Assign a high penalty to breaking before "<<" if the previous token is a string literal ending in ":" or "=". Before: llvm::outs() << "aaaaaaaaaaaaaaaaa = " << aaaaaaaaaaaaaaaaa << "bbbbbbbbbbbbbbbbb = " << bbbbbbbbbbbbbbbbb << "ccccccccccccccccc = " << ccccccccccccccccc << "ddddddddddddddddd = " << ddddddddddddddddd << "eeeeeeeeeeeeeeeee = " << eeeeeeeeeeeeeeeee; After: llvm::outs() << "aaaaaaaaaaaaaaaaa = " << aaaaaaaaaaaaaaaaa << "bbbbbbbbbbbbbbbbb = " << bbbbbbbbbbbbbbbbb << "ccccccccccccccccc = " << ccccccccccccccccc << "ddddddddddddddddd = " << ddddddddddddddddd << "eeeeeeeeeeeeeeeee = " << eeeeeeeeeeeeeeeee; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174545 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-06Align trailing block comments like trailing line comments.Daniel Jasper
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174537 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-06Formatter: Correctly detect ObjC message expressions preceded by a comment.Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174521 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-06Fix handling of comments in macros.Manuel Klimek
We now correctly format: // Written as a macro, it is reformatted from: #define foo(a) \ do { \ /* Initialize num to zero. */ \ int num = 10; \ /* This line ensures a is never zero. */ \ int i = a == 0 ? 1 : a; \ i = num / i; /* This division is OK. */ \ return i; \ } while (false) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174517 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-06Much semicolon after namespaces.Manuel Klimek
We now leave the semicolon in the line of the closing brace in: namespace { ... }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174514 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-06Fix formatting of ObjC method calls.Daniel Jasper
This fixes llvm.org/PR15165. We now correctly align: [image_rep drawInRect:drawRect fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0 ssssssssdd:NO hints:nil]; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174513 91177308-0d34-0410-b5e6-96231b3b80d8