summaryrefslogtreecommitdiffstats
path: root/clang/unittests
Commit message (Collapse)AuthorAgeFilesLines
* Add Multilib selection machineryJonathan Roelofs2014-02-125-1/+385
| | | | | | | | | | | | This patch improves the support for picking Multilibs from gcc installations. It also provides a better approximation for the flags '-print-multi-directory' and '-print-multi-lib'. This reverts r201203 (i.e. re-applying r201202 with small fixes in unittests/CMakeLists.txtto make the build bots happy). review: http://llvm-reviews.chandlerc.com/D2538 llvm-svn: 201205
* Revert 201202Jonathan Roelofs2014-02-125-385/+1
| | | | | | Breaks cmake configure of new unit tests directory llvm-svn: 201203
* Add Multilib selection machineryJonathan Roelofs2014-02-125-1/+385
| | | | | | | | | This patch improves the support for picking Multilibs from gcc installations. It also provides a better approximation for the flags '-print-multi-directory' and '-print-multi-lib'. review: http://llvm-reviews.chandlerc.com/D2538 llvm-svn: 201202
* clang-format: Support lambdas with namespace-qualified return types.Daniel Jasper2014-02-111-0/+1
| | | | | | | E.g.: Foo([]()->std::vector<int> { return { 2 }; }()); llvm-svn: 201139
* clang-format: Fix alignment of comments inside statements.Daniel Jasper2014-02-111-0/+3
| | | | | | | | | | | | | | Before: auto result = SomeObject // Calling someFunction on SomeObject .someFunction(); After: auto result = SomeObject // Calling someFunction on SomeObject .someFunction(); llvm-svn: 201138
* clang-format: Fix column limit violation for merged lines in macros.Daniel Jasper2014-02-071-0/+30
| | | | | | | | | | | | | | | | Before (81 columns): #define A \ void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() { return aaaaaaaa; } \ int i; After: #define A \ void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() { \ return aaaaaaaa; \ } \ int i; llvm-svn: 200974
* clang-format: Fix range-based for-loop formatting.Daniel Jasper2014-02-071-0/+2
| | | | | | | | | | | | | | | Before: for (aaaaaaaaa aaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaa.aaaaaaaaaaaa() .aaaaaaaaa() .a()) { } After: for (aaaaaaaaa aaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaa.aaaaaaaaaaaa().aaaaaaaaa().a()) { } llvm-svn: 200968
* Add isListInitialization matcher.Peter Collingbourne2014-02-061-0/+11
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2708 llvm-svn: 200949
* PR18128: a lambda capture-default is not permitted for a non-local lambdaRichard Smith2014-02-061-1/+1
| | | | | | expression. llvm-svn: 200948
* Added the hasLoopVariable sub-matcher for forRangeStmt.Alexander Kornienko2014-02-051-0/+5
| | | | | | | | | | | | | | | | | | | Summary: This sub-matcher makes it possible to access directly the range-based for loop variable: forRangeStmt(hasLoopVariable(anything()).bind(...)). I've tried to re-generate the docs, but the diffs seem to include much more than this change could cause, so I'd better leave docs update to someone who knows the intended changes in the contents better. Reviewers: klimek Reviewed By: klimek CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2702 llvm-svn: 200850
* clang-format: Don't indent relative to unary operators.Daniel Jasper2014-02-051-5/+3
| | | | | | | | | | | | | | It seems like most people see unary operators more like part of the subsequent identifier and find relative indentation odd. Before: aaaaaaaaaa(!aaaaaaaaaa( // break aaaaa)); After: aaaaaaaaaa(!aaaaaaaaaa( // break aaaaa)); llvm-svn: 200840
* clang-format: Let chromium style inherit google style's javascript tweaks.Nico Weber2014-02-023-10/+17
| | | | llvm-svn: 200652
* clang-format: (JavaScript) Don't crash on empty string literals.Daniel Jasper2014-01-311-0/+4
| | | | | | | Before, this would lead to a crash: f('', true); llvm-svn: 200540
* Introduce Parser::completeExpression.Peter Collingbourne2014-01-301-0/+14
| | | | | | | | | This function returns a list of completions for a given expression and completion position. Differential Revision: http://llvm-reviews.chandlerc.com/D2261 llvm-svn: 200497
* clang-format: Support ObjC's NS_ENUMs.Daniel Jasper2014-01-301-0/+12
| | | | | | | | | | | | | | | | | | | | | | | Before: typedef NS_ENUM(NSInteger, MyType) { /// Information about someDecentlyLongValue. someDecentlyLongValue, /// Information about anotherDecentlyLongValue. anotherDecentlyLongValue, /// Information about aThirdDecentlyLongValue. aThirdDecentlyLongValue}; After: typedef NS_ENUM(NSInteger, MyType) { /// Information about someDecentlyLongValue. someDecentlyLongValue, /// Information about anotherDecentlyLongValue. anotherDecentlyLongValue, /// Information about aThirdDecentlyLongValue. aThirdDecentlyLongValue }; llvm-svn: 200469
* clang-format: More custom option fixes for protocol buffer files.Daniel Jasper2014-01-291-0/+3
| | | | | | | | | | | | | | | 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
* clang-format: Fix formatting of custom proto options.Daniel Jasper2014-01-291-0/+2
| | | | | | | | | | | | | Before: repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = { aaaaaaaaaaaaaaaaa : AAAAAAAA }]; After: repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaaa : AAAAAAAA}]; llvm-svn: 200405
* Fix crash on unmatched #endif's.Manuel Klimek2014-01-291-0/+5
| | | | | | | | The following snippet would crash: #endif #if A llvm-svn: 200381
* clang-format: Understand __attribute__s preceding parameter lists.Daniel Jasper2014-01-281-0/+2
| | | | | | | | | | | | | | Before: ReturnType __attribute__((unused)) function(int i); After: ReturnType __attribute__((unused)) function(int i); This fixes llvm.org/PR18632. llvm-svn: 200337
* clang-format: Fix option formatting in protocol buffer files.Daniel Jasper2014-01-281-0/+4
| | | | | | | | | | Before: optional int32 foo[ default = true, deprecated = true ]; After: optional int32 foo[default = true, deprecated = true]; llvm-svn: 200327
* clang-format: Add support for a space after @propertyDaniel Jasper2014-01-281-0/+7
| | | | | | | | | Mozilla and WebKit seem to use a space after @property (verified by grepping their codebases) so we turn this on there as well. Change by Christian Legnitto. Thank you! llvm-svn: 200320
* Comment parsing: don't crash while parsing \deprecated in a standalone commentDmitri Gribenko2014-01-271-0/+20
| | | | | | | | | | | (comment without a decl). I think this can not happen during normal compilation with -Wdocumentation, only while using Clang APIs to parse comments outside of a source file. Based on a patch by Olivier Goffart. llvm-svn: 200230
* unittests: explicit stringify StringRefs for conversionSaleem Abdulrasool2014-01-253-7/+9
| | | | | | | | | When clang is built outside of the LLVM tree (against a corresponding version), there is no definition providing for operator<<(std::ostream &, StringRef) which is required for the assertion routines in google-test tests. Avoid the compilation failure by explicitly stringifying the StringRef prior to use. llvm-svn: 200096
* clang-format: Fix incorrect space removal.Daniel Jasper2014-01-251-0/+5
| | | | | | | | | | | | Before: Deleted &operator=(const Deleted &)&= default; Deleted &operator=(const Deleted &)&&= delete; After: Deleted &operator=(const Deleted &)& = default; Deleted &operator=(const Deleted &)&& = delete; llvm-svn: 200073
* Get rid of special parsing for return statements.Manuel Klimek2014-01-241-3/+7
| | | | | | | | This was done when we were not able to parse lambdas to handle some edge cases for block formatting different in return statements, but is not necessary any more. llvm-svn: 199982
* Introduce Registry::getCompletions.Peter Collingbourne2014-01-231-0/+85
| | | | | | | | | | This returns a list of valid (and useful) completions for a context (a list of outer matchers), ordered by decreasing relevance then alphabetically. It will be used by the matcher parser to implement completion. Differential Revision: http://llvm-reviews.chandlerc.com/D2210 llvm-svn: 199950
* clang-format: Fix incorrect lambda recognition.Daniel Jasper2014-01-221-0/+1
| | | | | | | | | | | | | Before: std::unique_ptr<int[]> foo() {} After: std::unique_ptr<int []> foo() {} Also, the formatting could go severely wrong after such a function before. llvm-svn: 199817
* clang-format: Treat "." in protos like namespace separators.Daniel Jasper2014-01-221-1/+11
| | | | | | | | | | | | | Before: optional really.really.long.and.qualified.type.aaaaaaa .aaaaaaaa another_fiiiiiiiiiiiiiiiiiiiiield = 2; After: optional really.really.long.and.qualified.type.aaaaaaa.aaaaaaaa another_fiiiiiiiiiiiiiiiiiiiiield = 2; llvm-svn: 199796
* When formatting a C++-only declaration name, enable C++ mode in the formatter'sRichard Smith2014-01-221-1/+1
| | | | | | | | | language options. This is not really ideal -- we should require the right language options to be passed in, or not require language options to format a name -- but it fixes a number of *obviously* wrong formattings. Patch by Olivier Goffart! llvm-svn: 199778
* clang-format: text following #if is likely an expression.Daniel Jasper2014-01-211-0/+1
| | | | | | | | | | Before: #if AAAA &&BBBB After: #if AAAA && BBBB llvm-svn: 199713
* clang-format: Properly format custom options in protocol buffer definitions.Daniel Jasper2014-01-201-0/+5
| | | | | | | | | | Before: option(my_option) = "abc"; After: option (my_option) = "abc"; llvm-svn: 199672
* clang-format: Better support and testing for protocol buffers.Daniel Jasper2014-01-193-9/+73
| | | | | | | | | With this patch, there is dedicated testing for protocol buffers (https://developers.google.com/protocol-buffers/). Also some minor tweaks formatting tweaks. llvm-svn: 199580
* clang-format: Fix ObjC block as first call parameter formatting.Daniel Jasper2014-01-191-5/+6
| | | | | | | | | Before: foo (^{ bar(); }); After: foo(^{ bar(); }); llvm-svn: 199573
* Fix string-literal to char* conversion in overload resolution for C++11Ismail Pazarbasi2014-01-171-2/+2
| | | | | | | | String literal to char* conversion is deprecated in C++03, and is removed in C++11. We still accept this conversion in C++11 mode as an extension, if we find it in the best viable function. llvm-svn: 199513
* clang-format: Don't break lines starting with "import <string-literal>"Daniel Jasper2014-01-171-0/+4
| | | | | | | | | The author might be missing the "#" or these might be protocol buffer definitions. Either way, we should not break the line or the string. There don't seem to be other valid use cases. llvm-svn: 199501
* clang-format: Improve formatting of ObjC Blocks with return type.Daniel Jasper2014-01-161-0/+4
| | | | | | | | | | Before: int a = [operation block:^int(int * i) { return 1; }]; After: int a = [operation block:^int(int *i) { return 1; }]; llvm-svn: 199411
* clang-format: Enable formatting of lambdas with explicit return type.Daniel Jasper2014-01-161-0/+4
| | | | | | | | | So clang-format can now format: int c = []()->int { return 2; }(); int c = []()->vector<int> { return { 2 }; }(); llvm-svn: 199368
* clang-format: Fixed formatting of JavaScript container literalsDaniel Jasper2014-01-152-0/+6
| | | | | | | | | | | | Before: var arr = [ 1, 2, 3 ]; var obj = {a : 1, b : 2, c : 3}; After: var arr = [1, 2, 3]; var obj = {a: 1, b: 2, c: 3}; llvm-svn: 199317
* clang-format: Fix bug introduced in r198871.Daniel Jasper2014-01-141-1/+1
| | | | | | | | | | | | We cannot simply change the start column to accomodate for the @ in an ObjC string literal as that will make clang-format happily violate the column limit. Use a different workaround instead. However, a better long-term solution might be to join the @ and the rest of the literal into a single token. llvm-svn: 199198
* Switch to ssize_t from size_t to unbreak windows builders.David Majnemer2014-01-141-3/+3
| | | | | | | Builders that have -fms-compatibility on by default define size_t implicitly. Tests that provide conflicting definitions would cause unintended failures. llvm-svn: 199195
* clang-format: Fix corner case with comment in ctor initializer.Daniel Jasper2014-01-131-0/+7
| | | | | | | | | | | | | | | | | | | | Formatting: Constructor() : // Comment forcing unwanted break. aaaa(aaaa) {} Before: Constructor() : // Comment forcing unwanted break. aaaa(aaaa) {} After: Constructor() : // Comment forcing unwanted break. aaaa(aaaa) {} llvm-svn: 199107
* clang-format: Don't indent relative to ./->.Daniel Jasper2014-01-131-6/+6
| | | | | | | | | | | | | | | Before: SomeThing // break .SomeFunction( // break param); After: SomeThing // break .SomeFunction( // break param); Seems to be more common in editors and codebases I have looked at. llvm-svn: 199105
* DynamicASTMatchers/VariantValueTest.cpp: It works with msvcrt since ↵NAKAMURA Takumi2014-01-121-1/+1
| | | | | | setmode(stderr, O_BINARY) were removed. llvm-svn: 199059
* clang-format: Slightly adapt line break in edge case.Daniel Jasper2014-01-101-2/+2
| | | | | | | | | | | | | | | Before: SomeMap[std::pair(aaaaaaaaaaaa, bbbbbbbbbbbbbbb)] .insert(ccccccccccccccccccccccc); After: SomeMap[std::pair(aaaaaaaaaaaa, bbbbbbbbbbbbbbb)].insert( ccccccccccccccccccccccc); This seems to be about 3:1 more common in Google and Chromium style and I found only a handful of instances inside the LLVM codebase. llvm-svn: 198924
* clang-format: Understand ObjC boxed expressions.Daniel Jasper2014-01-101-0/+2
| | | | | | | | | Before: [dictionary setObject:@(1)forKey:@"number"]; After: [dictionary setObject:@(1) forKey:@"number"]; llvm-svn: 198920
* clang-format: Add @s when breaking NSString literals.Daniel Jasper2014-01-091-1/+4
| | | | | | | | While it is allowed to not have an @ on subsequent lines, it seems general practice to add them. If undesired, the code author can easily remove them again and clang-format won't re-add them. llvm-svn: 198871
* clang-format: Understand #pragma markDaniel Jasper2014-01-091-0/+5
| | | | | | | | | Before: #pragma mark Any non - hyphenated or hyphenated string(including parentheses). After: #pragma mark Any non-hyphenated or hyphenated string (including parentheses). llvm-svn: 198870
* clang-format: Some tweaks to braces list formatting:Daniel Jasper2014-01-091-7/+20
| | | | | | | | | - Format a braced list with one element per line if it has nested braced lists. - Use a column layout only when the list has 6+ elements (instead of the current 4+ elements). llvm-svn: 198869
* clang-format: Don't hang forever when encountering a stray "}" in an ↵Benjamin Kramer2014-01-081-0/+4
| | | | | | | | @implementation block. PR18406. llvm-svn: 198770
* clang-format: Fix spacing in Cpp11 braced lists:Daniel Jasper2014-01-081-0/+2
| | | | | | | | | | Before: vector<int> foo{ ::SomeFunction()}; After: vector<int> foo{::SomeFunction()}; llvm-svn: 198769
OpenPOWER on IntegriCloud