summaryrefslogtreecommitdiffstats
path: root/clang/unittests
Commit message (Collapse)AuthorAgeFilesLines
...
* [autoconf] Add clangToolingCore.a to Makefile(s) for static build w/o ↵NAKAMURA Takumi2014-10-301-0/+1
| | | | | | libclang.dll. llvm-svn: 220904
* [CMake] Add dependencies on clangToolingCore.NAKAMURA Takumi2014-10-301-0/+1
| | | | llvm-svn: 220890
* clang-format: Format line if invoked on the trailing newline.Daniel Jasper2014-10-291-1/+13
| | | | llvm-svn: 220883
* Refactor libTooling to reduce required dependencies.Daniel Jasper2014-10-293-4/+5
| | | | | | | | | | This moves classes for storing and applying replacements to separate files. These classes specifically are used by clang-format which doesn't have any other dependencies on clangAST. Thereby, the size of clang-format's binary can be cut roughly in half and its build time sped up. llvm-svn: 220867
* clang-format: [JS] Support more regex literals.Daniel Jasper2014-10-291-0/+4
| | | | | | | | | | Previously a regex-literal containing "/*" would through clang-format off, e.g.: var regex = /\/*$/; Would lead to none of the following code to be formatted. llvm-svn: 220860
* clang-format: Improve && detection as binary operator.Daniel Jasper2014-10-281-1/+8
| | | | | | | | | | | | | | | | 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
* clang-format: Fix test.Daniel Jasper2014-10-281-1/+1
| | | | llvm-svn: 220807
* clang-format: Improve && detection as binary operators.Daniel Jasper2014-10-281-0/+5
| | | | | | | | | | | | | | | 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
* clang-format: Improve function declaration detection.Daniel Jasper2014-10-281-0/+2
| | | | | | | | | | | | | | | | | 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
* clang-format: [ObjC] Add separate flag to control indentation in blocksDaniel Jasper2014-10-281-37/+45
| | | | | | | | | | Apparently, people are very much divided on what the "correct" indentation is. So, best to give them a choice. The new flag is called ObjCBlockIndentWidth and the default is now set to the same value as IndentWidth for the pre-defined styles. llvm-svn: 220784
* clang-format: Fix test after recent flag change.Daniel Jasper2014-10-281-1/+1
| | | | llvm-svn: 220781
* Add valueDecl() matcher.Samuel Benzaquen2014-10-281-0/+7
| | | | | | | | | | | | Summary: Add valueDecl() matcher. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6005 llvm-svn: 220776
* Fix segfault in hasDeclContext for nodes that have no decl context.Samuel Benzaquen2014-10-271-0/+2
| | | | | | | | | | | | | | Summary: Some declarations do not have a declaration context, like TranslationUnitDecl. Fix hasDeclContext() to not segfault on these nodes. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6003 llvm-svn: 220719
* clang-format: Don't break after very short return types.Daniel Jasper2014-10-271-10/+10
| | | | | | | | | | | | | | Before: void SomeFunction(int parameter); After: void SomeFunction( int parameter); (Unless AlwaysBreakAfterDefinitionReturnType after type is set). llvm-svn: 220686
* clang-format: Fix bad merging of lines in nested blocks.Daniel Jasper2014-10-271-0/+8
| | | | | | | | | | | | | | | Before: SomeFunction([]() { #define A a return 43; }); After: SomeFunction([]() { #define A a return 43; }); llvm-svn: 220684
* clang-format: [Proto] Change formatting text-formatted options.Daniel Jasper2014-10-271-12/+17
| | | | | | | | | | | | | | 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
* Make VFS and FileManager match the current MemoryBuffer API.Benjamin Kramer2014-10-263-14/+6
| | | | | | | This eliminates converting back and forth between the 3 formats and gives us a more homogeneous interface. llvm-svn: 220657
* Fix initializing TypeOfTypeLocOlivier Goffart2014-10-241-0/+11
| | | | | | | | | | | This fixes a crash in the RecursiveASTVisitor on such code __typeof__(struct F*) var[invalid]; The UnderlyingTInfo of a TypeOfTypeLoc was left uninitialized when created from ASTContext::getTrivialTypeSourceInfo This lead to a crash in RecursiveASTVisitor when trying to access it. llvm-svn: 220562
* clang-format: Fix incorrect space after "<".Daniel Jasper2014-10-231-0/+1
| | | | | | | | | | Before: bool a = 2 <::SomeFunction(); After: bool a = 2 < ::SomeFunction(); llvm-svn: 220505
* Add support for profiling the matchers used.Samuel Benzaquen2014-10-221-0/+19
| | | | | | | | | | | | | | | Summary: Add support for profiling the matchers used. This will be connected with clang-tidy to generate a report to determine and debug slow checks. Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D5911 llvm-svn: 220418
* Try to fix link errors in mingw cmake -DBUILD_SHARED_LIBS=ONReid Kleckner2014-10-221-0/+1
| | | | llvm-svn: 220417
* Reland r219810 "Fix late template parsing leak with incremental processing"Reid Kleckner2014-10-221-4/+45
| | | | | | | | | | | | | | Original message: Add a second late template parser callback meant to cleanup any resources allocated by late template parsing. Call it from the Sema::ActOnEndOfTranslationUnit method after all pending template instantiations have been completed. Teach Parser::ParseTopLevelDecl to install the cleanup callback when incremental processing is enabled so that Parser::TemplateIds can be freed. Patch by Brad King! llvm-svn: 220400
* clang-format: Use AllowShortBlocksOnASingleLine for ObjC blocks, too.Daniel Jasper2014-10-221-17/+28
| | | | llvm-svn: 220375
* clang-format: Fix broken test.Daniel Jasper2014-10-221-1/+1
| | | | llvm-svn: 220374
* clang-format: Fix incorrect trailing return arrow detection.Daniel Jasper2014-10-221-0/+1
| | | | | | | | | | Before: auto doSomething(Aaaaaa* aaaaaa) -> decltype(aaaaaa -> f()) {} After: auto doSomething(Aaaaaa* aaaaaa) -> decltype(aaaaaa->f()) {} llvm-svn: 220373
* clang-format: [Java] Understand string literal concatenation.Daniel Jasper2014-10-211-0/+5
| | | | | | | | | | | Before: String someString = "abc" + "cde"; After: String someString = "abc" + "cde"; llvm-svn: 220287
* clang-format: [Java] Fix formatting of multiple annotations.Daniel Jasper2014-10-211-0/+3
| | | | | | | | | | | | | | | Before: @SuppressWarnings(value = "unchecked") @Author(name = "abc") public void doSomething() { } After: @SuppressWarnings(value = "unchecked") @Author(name = "abc") public void doSomething() { } llvm-svn: 220286
* clang-format: [Java] Fix space in generic method calls.Daniel Jasper2014-10-211-0/+2
| | | | | | | | | | Before: A.<B>doSomething(); After: A.<B>doSomething(); llvm-svn: 220285
* clang-format: [Java] Improve annotation handling.Daniel Jasper2014-10-211-0/+2
| | | | | | | | | | | | Before: @SuppressWarnings( value = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") public static int iiiiiiiiiiiiiiiiiiiiiiii; After: @SuppressWarnings(value = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") public static int iiiiiiiiiiiiiiiiiiiiiiii; llvm-svn: 220284
* clang-format: [Java] Make annotation formatting more consistent.Daniel Jasper2014-10-211-0/+6
| | | | | | | | | | | | | | | | | Before: DoSomething(new A() { @Override public String toString() { } }); After: DoSomething(new A() { @Override public String toString() { } }); llvm-svn: 220282
* clang-format: [Java] Improve generic support.Daniel Jasper2014-10-211-0/+6
| | | | | | | | | | | | Before: Iterable< ? > a; Iterable< ? extends SomeObject > a; After: Iterable<?> a; Iterable<? extends SomeObject> a; llvm-svn: 220281
* clang-format: [Java] Support extending inner classes.Daniel Jasper2014-10-211-0/+1
| | | | | | | | | | | Before: class A extends B .C {} After: class A extends B.C {} llvm-svn: 220280
* clang-format: [Java] Support annotations with parameters.Daniel Jasper2014-10-211-0/+4
| | | | | | | | | | | | Before: @SuppressWarnings (value = "unchecked") public void doSomething() { .. } After: @SuppressWarnings(value = "unchecked") public void doSomething() { .. } llvm-svn: 220279
* clang-format: [Java] Wrap after each function annotation.Daniel Jasper2014-10-211-0/+9
| | | | | | | | | | | Before: @Override public String toString() { .. } After: @Override public String toString() { .. } llvm-svn: 220274
* clang-format: [ObjC] Fix spacing in block variable parameters.Daniel Jasper2014-10-211-0/+1
| | | | | | | | | | Before: { void (^block)(Object * x); } After: { void (^block)(Object *x); } llvm-svn: 220270
* clang-format: Fix space in direct destructor calls.Daniel Jasper2014-10-211-0/+5
| | | | | | | | | | | | Before: void F(int& i) { i. ~int(); } After: void F(int& i) { i.~int(); } Also, some cleanups. llvm-svn: 220269
* clang-format: Fix overloaded operator edge case.Daniel Jasper2014-10-201-0/+1
| | | | | | | | | | | | | | | | 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
* clang-format: [ObjC] Fix using selector names as macro arguments.Daniel Jasper2014-10-201-0/+1
| | | | | | | | | | Before: [self aaaaa:MACRO(a, b :, c :)]; After: [self aaaaa:MACRO(a, b:, c:)]; llvm-svn: 220197
* clang-format: Fix indentation of struct definitions with array init.Daniel Jasper2014-10-201-0/+10
| | | | | | | | | | | | | | | | | | | | 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
* clang-format: Prefer breaking before trailing return arrows.Daniel Jasper2014-10-171-0/+2
| | | | | | | | | | | | Before: auto SomeFunction( A aaaaaaaaaaaaaaaaaaaaa) const -> decltype(f(aaaaaaaaaaaaaaaaaaaaa)) {} After: auto SomeFunction(A aaaaaaaaaaaaaaaaaaaaa) const -> decltype(f(aaaaaaaaaaaaaaaaaaaaa)) {} llvm-svn: 220043
* clang-format: [Java] Don't break immediately after "throws".Daniel Jasper2014-10-171-6/+5
| | | | | | | | | | | | Before: public void doSooooooooooooooooooooooooooomething() throws LooooooooooooooooooooooooooooongException {} After: public void doSooooooooooooooooooooooooooomething() throws LooooooooooooooooooooooooooooongException {} llvm-svn: 220041
* clang-format: Fix behavior with comments before conditional expressionsDaniel Jasper2014-10-161-0/+6
| | | | | | | | | | | | | | | Before: SomeFunction(aaaaaaaaaaaaaaaaa, // comment. ccccccccccccccccc ? aaaaaaaaaaaaaaaaaaaa : bbbbbbbbbbbbbbbbbbbb); After: SomeFunction(aaaaaaaaaaaaaaaaa, // comment. ccccccccccccccccc ? aaaaaaaaaaaaaaaaaaaa : bbbbbbbbbbbbbbbbbbbb); llvm-svn: 219921
* clang-format: [ObjC] Fix method expression detection.Daniel Jasper2014-10-161-3/+2
| | | | | | | | | | Before: return (a)[foo bar : baz]; After: return (a)[foo bar:baz]; llvm-svn: 219919
* Avoid having "using namespace" for both "clang" and "llvm" namespaces.Alexey Samsonov2014-10-151-6/+5
| | | | | | | This is fragile, as there are classes with the same name in both namespaces (e.g. llvm::Module and clang::Module). llvm-svn: 219855
* Revert "Fix late template parsing leak with incremental processing"Reid Kleckner2014-10-151-45/+4
| | | | | | | | This reverts commit r219810. The test suite appears broken. llvm-svn: 219813
* Fix late template parsing leak with incremental processingReid Kleckner2014-10-151-4/+45
| | | | | | | | | | | | | Add a second late template parser callback meant to cleanup any resources allocated by late template parsing. Call it from the Sema::ActOnEndOfTranslationUnit method after all pending template instantiations have been completed. Teach Parser::ParseTopLevelDecl to install the cleanup callback when incremental processing is enabled so that Parser::TemplateIds can be freed. Patch by Brad King! llvm-svn: 219810
* Fix bug in DynTypedMatcher::constructVariadic() that would cause false ↵Samuel Benzaquen2014-10-132-0/+12
| | | | | | | | | | | | | | | | | | | negatives. Summary: Change r219118 fixed the bug for anyOf and eachOf, but it is still present for unless. The variadic wrapper doesn't have enough information to know how to restrict the type. Different operators handle restrict failures in different ways. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D5731 llvm-svn: 219622
* clang-format: [ObjC] Wrap ObjC method declarations before annotations.Daniel Jasper2014-10-111-0/+4
| | | | | | | | | | | | | 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
* Fix completion logic to allow for heterogeneous argument types in matcher ↵Samuel Benzaquen2014-10-091-0/+14
| | | | | | | | | | | | | | | | | | | | overloads. Summary: There was an assumption that there were no matchers that were overloaded on matchers and other types of arguments. This assumption was broken recently with the addition of new matcher overloads. Fixes http://llvm.org/PR21226 Reviewers: pcc Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D5711 llvm-svn: 219450
* Special case 0 and 1 matcher in makeAllOfComposite().Samuel Benzaquen2014-10-091-1/+4
| | | | | | | | | | | | | | | | | Summary: Remove unnecessary wrapping for the 0 and 1 matcher cases of makeAllOfComposite(). We don't need a variadic wrapper for those cases. Refactor TrueMatcher to take advandage of the new conversions between DynTypedMatcher and Matcher<T>. Also, make it a singleton. This change improves our clang-tidy related benchmarks by ~12%. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D5675 llvm-svn: 219431
OpenPOWER on IntegriCloud