summaryrefslogtreecommitdiffstats
path: root/test/Index/comment-c-decls.c
Commit message (Collapse)AuthorAgeFilesLines
* clang-format: Fix tests after recent change to ObjC block formatting.Daniel Jasper2014-10-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220376 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes formatting of empty blocks.Manuel Klimek2013-01-211-1/+1
| | | | | | | | | | | | | | | | We now only put empty blocks into a single line, if all of: - all tokens of the structural element fit into a single line - we're not in a control flow statement Note that we usually don't put record definitions into a single line, as there's usually at least one more token (the semicolon) after the closing brace. This doesn't hold when we are in a context where there is no semicolon, like "enum E {}". There were some missing tests around joining lines around the corner cases of the allowed number of columns, so this patch adds some. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173055 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not add newline in empty blocks.Manuel Klimek2013-01-101-2/+2
| | | | | | | void f() {} now gets formatted in one line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172067 91177308-0d34-0410-b5e6-96231b3b80d8
* Improvements to function type and ObjC block formatting.Daniel Jasper2013-01-101-2/+2
| | | | | | | | | | | | | | | | | | | | | Before: int (^myBlock) (int) = ^(int num) {} A<void ()>; int (*b)(int); After: int (^myBlock)(int) = ^(int num) {} A<void()>; int(*b)(int); For function types and function pointer types, this patch only makes the behavior consistent (for types that are keywords and other types). For the latter function pointer type declarations, we'll probably want to add a space after "int". Also added LangOpts.Bool = 1, so we handle "A<bool()>" appropriately Moved the LangOpts-settings to a public place for use by tests and clang-format binary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172065 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ObjC block declarations.Daniel Jasper2013-01-091-2/+2
| | | | | | | Before: int ( ^ Block1) (int, int) = ^ (int i, int j) After: int (^Block1) (int, int) = ^(int i, int j) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171959 91177308-0d34-0410-b5e6-96231b3b80d8
* Various fixes to clang-format's macro handling.Manuel Klimek2013-01-041-1/+1
| | | | | | | | | | | | | | | | | | | Some of this is still pretty rough (note the load of FIXMEs), but it is strictly an improvement and fixes various bugs that were related to macro processing but are also imporant in non-macro use cases. Specific fixes: - correctly puts espaced newlines at the end of the line - fixes counting of white space before a token when escaped newlines are present - fixes parsing of "trailing" tokens when eof() is hit - puts macro parsing orthogonal to parsing other structure - general support for parsing of macro definitions Due to the fix to format trailing tokens, this change also includes a bunch of fixes to the c-index tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171556 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporary fix of tests to make buildbots happy.Daniel Jasper2012-12-211-1/+1
| | | | | | Permanent solution coming up after checking back with Fariborz/Douglas. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170887 91177308-0d34-0410-b5e6-96231b3b80d8
* Add objective-C style formatting to clang format andFariborz Jahanian2012-12-201-1/+1
| | | | | | | | use it to format xml declaration tags. // rdar://12378714 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170727 91177308-0d34-0410-b5e6-96231b3b80d8
* Testing C declarations embedded inFariborz Jahanian2012-12-041-0/+104
<declaration> tag of Comment XML and fixed a missing block literal printout as result of the testing. // rdar://12378714 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169307 91177308-0d34-0410-b5e6-96231b3b80d8