summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAge
* Make test from r211758 portableAlp Toker2014-06-26
| | | | | | | It turns out the -fblocks option is determined by the default tooling target and not implied by the other two flags. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211761 91177308-0d34-0410-b5e6-96231b3b80d8
* RAV: visit copy expressions of captured variables in blocks (ObjC++11)Alp Toker2014-06-26
| | | | | | Patch by Mathieu Baudet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211758 91177308-0d34-0410-b5e6-96231b3b80d8
* Add vfs::recursive_directory_iteratorBen Langmuir2014-06-25
| | | | | | | | | For now, this is only used by its unit tests. It is similar to the API in llvm::sys::fs::recursive_directory_iterator, but without some of the more complex features like requesting that the iterator not recurse into the next directory, for example. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211732 91177308-0d34-0410-b5e6-96231b3b80d8
* VirtualFileSystemTest.cpp: Get rid of initializer list on std::vector, to ↵NAKAMURA Takumi2014-06-25
| | | | | | appease msc17. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211662 91177308-0d34-0410-b5e6-96231b3b80d8
* Reformat.NAKAMURA Takumi2014-06-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211661 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test issues from r211623 and remove test-only APIBen Langmuir2014-06-24
| | | | | | | | | | | 1) missing iterator bits needed by libstdc++4.7 Using find_if was convenient, but since operator++ wasn't a good interface anyway, I just replaced with a range-based for loop and removed operator++ from the directory_iterator class. 2) stop relying on order of iterating real files git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211633 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable the bits of r211623 that broke the botsBen Langmuir2014-06-24
| | | | | | | Part of my test seems to rely on iterator bits that I didn't implement, at least in the gcc bots. Disabling while I investigate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211625 91177308-0d34-0410-b5e6-96231b3b80d8
* Add directory_iterator for (non-recursive) iteration of VFS directoriesBen Langmuir2014-06-24
| | | | | | | | The API is based on sys::fs::directory_iterator, but it allows iterating over overlays and the yaml-based VFS. For now, it isn't used by anything (except its tests). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211623 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Understand that breaking before lambdas is fine.Daniel Jasper2014-06-24
| | | | | | | | | | | | Before: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa([]( const aaaaaaaaaa &a) { return a; }); After: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( [](const aaaaaaaaaa &a) { return a; }); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211575 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: [proto] Add required space before absolute references.Daniel Jasper2014-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211488 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Fix corner case in pointer/reference detection.Daniel Jasper2014-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211487 91177308-0d34-0410-b5e6-96231b3b80d8
* Lex: Use the correct types for MS integer suffixesDavid Majnemer2014-06-21
| | | | | | | | | | | | | | | | Something went wrong with r211426, it is an older version of this code and should not have been committed. It was reverted with r211434. Original commit message: We didn't properly implement support for the sized integer suffixes. Suffixes like i16 were essentially ignored instead of mapping them to the appropriately sized integer type. This fixes PR20008. Differential Revision: http://reviews.llvm.org/D4132 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211441 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Lex: Use the correct types for MS integer suffixes"Rafael Espindola2014-06-21
| | | | | | | | | This reverts commit r211426. This broke the arm bots. The crash can be reproduced on X86 by running. ./bin/clang -cc1 -fsyntax-only -verify -fms-extensions ~/llvm/clang/test/Lexer/ms-extensions.c -triple arm-linux git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211434 91177308-0d34-0410-b5e6-96231b3b80d8
* Lex: Use the correct types for MS integer suffixesDavid Majnemer2014-06-21
| | | | | | | | | | | | We didn't properly implement support for the sized integer suffixes. Suffixes like i16 were essentially ignored instead of mapping them to the appropriately sized integer type. This fixes PR20008. Differential Revision: http://reviews.llvm.org/D4132 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211426 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Introduce style with spaces on both sides of */&.Daniel Jasper2014-06-17
| | | | | | | Patch by Janusz Sobczak (slightly extended). This fixes llvm.org/19929. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211098 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for llvm api change.Rafael Espindola2014-06-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210921 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not store duplicate parents when memoization data is available.Samuel Benzaquen2014-06-13
| | | | | | | | | | | | | | Summary: Do not store duplicate parents when memoization data is available. This does not solve the duplication problem, but ameliorates it. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D4124 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210902 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: [JS] Understand named function literals.Daniel Jasper2014-06-13
| | | | | | | | | | | | | | | | | | | Before: return {a: function SomeFunction(){// ... return 1; } } ; After: return { a: function SomeFunction() { // ... return 1; } }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210887 91177308-0d34-0410-b5e6-96231b3b80d8
* Refer to error_code with the std prefix.Rafael Espindola2014-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210817 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210780 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix msvc unittest build.Rafael Espindola2014-06-12
| | | | | | Looks like msvc has an asymmetrical operator ==. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210768 91177308-0d34-0410-b5e6-96231b3b80d8
* Give clang-format its own error category.Rafael Espindola2014-06-12
| | | | | | | | | The posix errno values are probably to the best thing to use for describing parse errors. This should also fix the mingw build. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210739 91177308-0d34-0410-b5e6-96231b3b80d8
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-11
| | | | | | This is an update for a llvm api change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210688 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Fix pointer/reference detection after decltype.Daniel Jasper2014-06-11
| | | | | | | | | | Before: [](const decltype(*a) & value) {} After: [](const decltype(*a)& value) {} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210643 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: [JS] Treat dict literals similar to objc method exprs.Daniel Jasper2014-06-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: return { link: function() { f(); // } }; return { a: a, link: function() { f(); // } } After: return { link: function() { f(); // } }; return { a: a, link: function() { f(); // } }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210537 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Increase penalty for wrapping array subscript expressionsDaniel Jasper2014-06-10
| | | | | | | | | | | | | Before: aaaaaaaaaaa aaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaa->aaaaaaaaa[0].aaaaaaa [0].aaaaaaaaaaaaaaaaaaaaaa(); After: aaaaaaaaaaa aaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaa->aaaaaaaaa[0] .aaaaaaa[0] .aaaaaaaaaaaaaaaaaaaaaa(); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210529 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Fix enum formatting with specific comment.Daniel Jasper2014-06-10
| | | | | | | | | | | | | | | Before: enum Fruit { // APPLE, PEAR }; After: enum Fruit { // APPLE, PEAR }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210522 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Support variadic lambda captures.Daniel Jasper2014-06-10
| | | | | | | | | | Before: return [ i, args... ]{}; After: return [i, args...] {}; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210514 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Handle multiline strings inside ternary expressions.Daniel Jasper2014-06-10
| | | | | | | With AlwaysSplitBeforeMultilineStrings, clang-format would not find any valid solution. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210513 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing an "if (this == nullptr)" check from two print methods. The conditionRichard Trieu2014-06-09
| | | | | | | | will never be true in a well-defined context. The checking for null pointers has been moved into the caller logic so it does not rely on undefined behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210498 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'. Unittests edition.Craig Topper2014-06-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210423 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix RecursiveASTVisitor to visit types in ObjCPropertyDeclAlp Toker2014-06-06
| | | | | | Patch by Mathieu Baudet! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210339 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Fix incorrect indentation.Daniel Jasper2014-06-06
| | | | | | | | | | | | | | | | | | | | | | | | Before (JavaScript example, but can extend to other languages): return { a: 'E', b: function() { return function() { f(); // This is wrong. }; } }; After: return { a: 'E', b: function() { return function() { f(); // This is better. }; } }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210334 91177308-0d34-0410-b5e6-96231b3b80d8
* Add first set of tests for FriendDecl source range and location.Nikola Smiljanic2014-06-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210306 91177308-0d34-0410-b5e6-96231b3b80d8
* Add hasLocalStorage/hasGlobalStorage matchers.Samuel Benzaquen2014-06-05
| | | | | | | | | | | | | | Summary: Add hasLocalStorage/hasGlobalStorage matchers for VarDecl nodes. Update the doc. Also add them to the dynamic registry. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D4034 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210278 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Leave empty lines within UnwrappedLines.Daniel Jasper2014-06-04
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210183 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the last remaining llvm/Config/config.h includesAlp Toker2014-06-04
| | | | | | | | | | | | This corrects long-standing misuses of LLVM's internal config.h. In most cases the public llvm-config.h header was intended and we can now remove the old hacks thanks to LLVM r210144. The config.h header is private, won't be installed and should no longer be included by clang or other modules. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210145 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Refactor indentation behavior for multiple nested blocks.Daniel Jasper2014-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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(); }); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210097 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Fix special case of binary operator detection.Daniel Jasper2014-06-02
| | | | | | | | | | | | | | | | | 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(); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210017 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: No space between ")" and braced init list.Daniel Jasper2014-06-02
| | | | | | | | | | | | Before: auto j = decltype(i) {}; After: auto j = decltype(i){}; This fixes llvm.org/PR19892. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210013 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Fix Allman brace breaking of enums.Daniel Jasper2014-06-02
| | | | | | | | | | | | | | | | | | Before: enum Side { LEFT, RIGHT }; After: enum Side { LEFT, RIGHT }; This fixes llvm.org/PR19911. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210011 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Fix trailing const (etc.) with Allman brace style.Daniel Jasper2014-06-02
| | | | | | | | | | | | | | | | | | Before: void someLongFunction(int someLongParameter) const { } After: void someLongFunction( int someLongParameter) const { } This fixes llvm.org/PR19912. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210010 91177308-0d34-0410-b5e6-96231b3b80d8
* There is no std::errc:success, remove the llvm one.Rafael Espindola2014-05-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209959 91177308-0d34-0410-b5e6-96231b3b80d8
* Use make_error_code in preparation for making errc an enum class.Rafael Espindola2014-05-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209956 91177308-0d34-0410-b5e6-96231b3b80d8
* Take PrintingPolicy::SuppressUnwrittenScope into account when printing theRichard Smith2014-05-30
| | | | | | | qualified name of a NamedDecl. Patch by Volodymyr Sapsai! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209924 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Don't break before a case's colon.Daniel Jasper2014-05-28
| | | | | | | | | | | | | | | | | | Before (with just the right line length: switch (a) { case some_namespace::some_constant : return; } After: switch (a) { case some_namespace:: some_constant: return; } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209725 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Format array and dict literals similar to blocks.Daniel Jasper2014-05-28
| | | | | | | | | | | | | | | | | | | | | | | Especially, reduce the amount of indentation if it doesn't increase readability. Before: NSMutableDictionary* dictionary = [NSMutableDictionary dictionaryWithDictionary:@{ aaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbb : bbbbb, cccccccccccccccc : ccccccccccccccc }]; After: NSMutableDictionary* dictionary = [NSMutableDictionary dictionaryWithDictionary:@{ aaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbb : bbbbb, cccccccccccccccc : ccccccccccccccc }]; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209720 91177308-0d34-0410-b5e6-96231b3b80d8
* Make equalsNode work with pointers to subtypes.Manuel Klimek2014-05-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209652 91177308-0d34-0410-b5e6-96231b3b80d8
* Adds child traversal matchers for IfStmt's then and else branches.Manuel Klimek2014-05-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209649 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow hasBody on CXXForRangeStmt nodes and update the docs.Manuel Klimek2014-05-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209647 91177308-0d34-0410-b5e6-96231b3b80d8