#
1a445845 |
| 03-Jun-2019 |
Ilya Biryukov <ibiryukov@google.com> |
[CodeComplete] Add a bit more whitespace to completed patterns
Summary: E.g. we now turn `while(<#cond#>){` into `while (<#cond#>) {`
This slightly improves the final output. Should not affect clie
[CodeComplete] Add a bit more whitespace to completed patterns
Summary: E.g. we now turn `while(<#cond#>){` into `while (<#cond#>) {`
This slightly improves the final output. Should not affect clients that format the result on their own.
Reviewers: gribozavr
Reviewed By: gribozavr
Subscribers: jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62616
llvm-svn: 362363
show more ...
|
#
2fa31880 |
| 29-May-2019 |
Ilya Biryukov <ibiryukov@google.com> |
[CodeComplete] Add semicolon when completing patterns for 'static_assert' and 'typedef
This is a trivial follow-up to r360042, which added semicolons to other pattern completions, so sending without
[CodeComplete] Add semicolon when completing patterns for 'static_assert' and 'typedef
This is a trivial follow-up to r360042, which added semicolons to other pattern completions, so sending without review.
llvm-svn: 361974
show more ...
|
#
b1296fae |
| 28-May-2019 |
Ilya Biryukov <ibiryukov@google.com> |
[CodeComplete] Set preferred type for qualified-id
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62514
llvm-sv
[CodeComplete] Set preferred type for qualified-id
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62514
llvm-svn: 361838
show more ...
|
#
49e432d0 |
| 28-May-2019 |
Ilya Biryukov <ibiryukov@google.com> |
[CodeComplete] Consistently break after '{' in multi-line patterns
Summary: Completion can return multi-line patterns in some cases, e.g.
for (<#init#>; <#cond#>; <#inc#>) { <#body#> }
[CodeComplete] Consistently break after '{' in multi-line patterns
Summary: Completion can return multi-line patterns in some cases, e.g.
for (<#init#>; <#cond#>; <#inc#>) { <#body#> }
However, most patterns break the line only before closing brace, resulting in code like:
namespace <#name#> { <#decls#> }
While some (e.g. the 'for' example above) are breaking lines after the opening brace too.
This change ensures all patterns consistently break after the opening brace, this leads to nicer UX when using those in an actual editor.
Reviewers: gribozavr
Reviewed By: gribozavr
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62405
llvm-svn: 361829
show more ...
|
#
32497f57 |
| 27-May-2019 |
Ilya Biryukov <ibiryukov@google.com> |
[CodeComplete] Complete 'return true/false' in boolean functions
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D
[CodeComplete] Complete 'return true/false' in boolean functions
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62391
llvm-svn: 361753
show more ...
|
#
47fd4f06 |
| 24-May-2019 |
Ilya Biryukov <ibiryukov@google.com> |
[CodeComplete] Add whitespace around braces in lambda completions
This produces nicer output. Trivial follow-up to r361461, so sending without review.
llvm-svn: 361645
|
#
cabab29a |
| 24-May-2019 |
Ilya Biryukov <ibiryukov@google.com> |
[CodeComplete] Filter override completions by function name
Summary: We put only part of the signature starting with a function name into "typed text" chunks now, previously the whole signature was
[CodeComplete] Filter override completions by function name
Summary: We put only part of the signature starting with a function name into "typed text" chunks now, previously the whole signature was "typed text".
This leads to meaningful fuzzy match scores, giving better signals to compare with other completion items.
Ideally, we would not display the result type to the user, but that requires adding a new kind of completion chunk.
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62298
llvm-svn: 361623
show more ...
|
#
fd11a5f4 |
| 23-May-2019 |
Ilya Biryukov <ibiryukov@google.com> |
[CodeComplete] Only show lambda completions if patterns are requested
This is a trivial follow-up to r361461, so sending without review.
llvm-svn: 361510
|
#
3a2f0e46 |
| 23-May-2019 |
Ilya Biryukov <ibiryukov@google.com> |
[CodeComplete] Complete a lambda when preferred type is a function
Summary: Uses a heuristic to detect std::function and friends.
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: cfe-commit
[CodeComplete] Complete a lambda when preferred type is a function
Summary: Uses a heuristic to detect std::function and friends.
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62238
llvm-svn: 361461
show more ...
|
Revision tags: llvmorg-8.0.1-rc1 |
|
#
600ec01b |
| 16-May-2019 |
Ilya Biryukov <ibiryukov@google.com> |
[CodeComplete] Complete enumerators when preferred type is an enum
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org
[CodeComplete] Complete enumerators when preferred type is an enum
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62010
llvm-svn: 360912
show more ...
|
#
76b9027f |
| 09-May-2019 |
Richard Smith <richard-llvm@metafoo.co.uk> |
[c++20] Add support for explicit(bool), as described in P0892R2.
Patch by Tyker!
Differential Revision: https://reviews.llvm.org/D60934
llvm-svn: 360311
|
#
15a37ebb |
| 06-May-2019 |
Ilya Biryukov <ibiryukov@google.com> |
[CodeComplete] Add a trailing semicolons to some pattern completions
Summary: Where semicolon is required in any case. Here's a list of completions that now have a semicolon: - namespace <name> =
[CodeComplete] Add a trailing semicolons to some pattern completions
Summary: Where semicolon is required in any case. Here's a list of completions that now have a semicolon: - namespace <name> = <target>; - using namespace <name>; - using <qualifier>::<name>; - continue; - break; - goto <label>; - return; - return <expression>;
Reviewers: gribozavr
Reviewed By: gribozavr
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61589
llvm-svn: 360042
show more ...
|
#
d2b9fc88 |
| 06-May-2019 |
Hans Wennborg <hans@hanshq.net> |
Revert r359949 "[clang] adding explicit(bool) from c++2a"
This caused Clang to start erroring on the following:
struct S { template <typename = int> explicit S(); };
struct T : S {};
Revert r359949 "[clang] adding explicit(bool) from c++2a"
This caused Clang to start erroring on the following:
struct S { template <typename = int> explicit S(); };
struct T : S {};
struct U : T { U(); }; U::U() {}
$ clang -c /tmp/x.cc /tmp/x.cc:10:4: error: call to implicitly-deleted default constructor of 'T' U::U() {} ^ /tmp/x.cc:5:12: note: default constructor of 'T' is implicitly deleted because base class 'S' has no default constructor struct T : S {}; ^ 1 error generated.
See discussion on the cfe-commits email thread.
This also reverts the follow-ups r359966 and r359968.
> this patch adds support for the explicit bool specifier. > > Changes: > - The parsing for the explicit(bool) specifier was added in ParseDecl.cpp. > - The storage of the explicit specifier was changed. the explicit specifier was stored as a boolean value in the FunctionDeclBitfields and in the DeclSpec class. now it is stored as a PointerIntPair<Expr*, 2> with a flag and a potential expression in CXXConstructorDecl, CXXDeductionGuideDecl, CXXConversionDecl and in the DeclSpec class. > - Following the AST change, Serialization, ASTMatchers, ASTComparator and ASTPrinter were adapted. > - Template instantiation was adapted to instantiate the potential expressions of the explicit(bool) specifier When instantiating their associated declaration. > - The Add*Candidate functions were adapted, they now take a Boolean indicating if the context allowing explicit constructor or conversion function and this boolean is used to remove invalid overloads that required template instantiation to be detected. > - Test for Semantic and Serialization were added. > > This patch is not yet complete. I still need to check that interaction with CTAD and deduction guides is correct. and add more tests for AST operations. But I wanted first feedback. > Perhaps this patch should be spited in smaller patches, but making each patch testable as a standalone may be tricky. > > Patch by Tyker > > Differential Revision: https://reviews.llvm.org/D60934
llvm-svn: 360024
show more ...
|
#
5fe2ddbd |
| 04-May-2019 |
Nicolas Lesser <blitzrakete@gmail.com> |
[clang] adding explicit(bool) from c++2a
this patch adds support for the explicit bool specifier.
Changes: - The parsing for the explicit(bool) specifier was added in ParseDecl.cpp. - The storage o
[clang] adding explicit(bool) from c++2a
this patch adds support for the explicit bool specifier.
Changes: - The parsing for the explicit(bool) specifier was added in ParseDecl.cpp. - The storage of the explicit specifier was changed. the explicit specifier was stored as a boolean value in the FunctionDeclBitfields and in the DeclSpec class. now it is stored as a PointerIntPair<Expr*, 2> with a flag and a potential expression in CXXConstructorDecl, CXXDeductionGuideDecl, CXXConversionDecl and in the DeclSpec class. - Following the AST change, Serialization, ASTMatchers, ASTComparator and ASTPrinter were adapted. - Template instantiation was adapted to instantiate the potential expressions of the explicit(bool) specifier When instantiating their associated declaration. - The Add*Candidate functions were adapted, they now take a Boolean indicating if the context allowing explicit constructor or conversion function and this boolean is used to remove invalid overloads that required template instantiation to be detected. - Test for Semantic and Serialization were added.
This patch is not yet complete. I still need to check that interaction with CTAD and deduction guides is correct. and add more tests for AST operations. But I wanted first feedback. Perhaps this patch should be spited in smaller patches, but making each patch testable as a standalone may be tricky.
Patch by Tyker
Differential Revision: https://reviews.llvm.org/D60934
llvm-svn: 359949
show more ...
|
#
899d1392 |
| 24-Apr-2019 |
Fangrui Song <maskray@google.com> |
Use llvm::stable_sort
llvm-svn: 359098
|
#
bc7ff899 |
| 04-Apr-2019 |
Sam McCall <sam.mccall@gmail.com> |
[CodeComplete] Fix crash when completing ObjC block parameter with a broken type
Summary: The fix isn't great, but it's hard to fix properly because the completion code sensibly uses ParmVarDecl to
[CodeComplete] Fix crash when completing ObjC block parameter with a broken type
Summary: The fix isn't great, but it's hard to fix properly because the completion code sensibly uses ParmVarDecl to represent parameters, but the AST-building code sensibly doesn't synthesize them if the type is broken. Also this case is apparently really rare, so it's probably not worth bending over backwards for.
Reviewers: ilya-biryukov
Subscribers: javed.absar, kristof.beyls, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60258
llvm-svn: 357686
show more ...
|
#
db8a7422 |
| 26-Mar-2019 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
Basic: Return a reference from FileManager::getVirtualFileSystem, NFC
FileManager constructs a VFS in its constructor if it isn't passed one, and there's no way to reset it. Make that contract clea
Basic: Return a reference from FileManager::getVirtualFileSystem, NFC
FileManager constructs a VFS in its constructor if it isn't passed one, and there's no way to reset it. Make that contract clear by returning a reference from its accessor.
https://reviews.llvm.org/D59388
llvm-svn: 357038
show more ...
|
#
70ad396b |
| 25-Mar-2019 |
Bruno Ricci <riccibrun@gmail.com> |
[Sema][NFCI] Don't allocate storage for the various CorrectionCandidateCallback unless we are going to do some typo correction
The various CorrectionCandidateCallbacks are currently heap-allocated u
[Sema][NFCI] Don't allocate storage for the various CorrectionCandidateCallback unless we are going to do some typo correction
The various CorrectionCandidateCallbacks are currently heap-allocated unconditionally. This was needed because of delayed typo correction. However these allocations represent currently 15.4% of all allocations (number of allocations) when parsing all of Boost (!), mostly because of ParseCastExpression, ParseStatementOrDeclarationAfterAttrtibutes and isCXXDeclarationSpecifier. Note that all of these callback objects are small. Let's not do this.
Instead initially allocate the callback on the stack, and only do a heap allocation if we are going to do some typo correction. Do this by:
1. Adding a clone function to each callback, which will do a polymorphic clone of the callback. This clone function is required to be implemented by every callback (of which there is a fair amount). Make sure this is the case by making it pure virtual.
2. Use this clone function when we are going to try to correct a typo.
This additionally cut the time of -fsyntax-only on all of Boost by 0.5% (not that much, but still something). No functional changes intended.
Differential Revision: https://reviews.llvm.org/D58827
Reviewed By: rnk
llvm-svn: 356925
show more ...
|
Revision tags: llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4 |
|
#
3e804d25 |
| 27-Feb-2019 |
David Goldman <dallasftball@gmail.com> |
Support framework import/include auto-completion
Frameworks filesystem representations: UIKit.framework/Headers/%header%
Framework import format: #import <UIKit/%header%>
Thus the completion c
Support framework import/include auto-completion
Frameworks filesystem representations: UIKit.framework/Headers/%header%
Framework import format: #import <UIKit/%header%>
Thus the completion code must map the input format of <UIKit/> to the path of UIKit.framework/Headers as well as strip the ".framework" suffix when auto-completing the framework name.
llvm-svn: 355008
show more ...
|
Revision tags: llvmorg-8.0.0-rc3 |
|
#
ff2a9975 |
| 26-Feb-2019 |
Ilya Biryukov <ibiryukov@google.com> |
[CodeComplete] Propagate preferred type for function arguments in more cases
Summary: See the added test for some new cases. This change also removes special code completion calls inside the ParseEx
[CodeComplete] Propagate preferred type for function arguments in more cases
Summary: See the added test for some new cases. This change also removes special code completion calls inside the ParseExpressionList function now that we properly propagate expected type to the function responsible for parsing elements of the expression list (ParseAssignmentExpression).
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: xbolva00, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58541
llvm-svn: 354864
show more ...
|
#
206740e7 |
| 21-Feb-2019 |
Eric Liu <ioeric@google.com> |
[CodeComplete] Collect visited contexts when scope specifier is invalid.
Summary: This will allow completion consumers to guess the specified scope by putting together scopes in the context with the
[CodeComplete] Collect visited contexts when scope specifier is invalid.
Summary: This will allow completion consumers to guess the specified scope by putting together scopes in the context with the specified scope (e.g. when the specified namespace is not imported yet).
Reviewers: ilya-biryukov
Subscribers: jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58446
llvm-svn: 354570
show more ...
|
#
756ecb8e |
| 11-Feb-2019 |
Benjamin Kramer <benny.kra@googlemail.com> |
Make some helper functions static. NFC.
llvm-svn: 353705
|
Revision tags: llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2 |
|
#
4f9543b4 |
| 31-Jan-2019 |
Ilya Biryukov <ibiryukov@google.com> |
[CodeComplete] Propagate preferred types through parser in more cases
Preferred types are used by code completion for ranking. This commit considerably increases the number of points in code where t
[CodeComplete] Propagate preferred types through parser in more cases
Preferred types are used by code completion for ranking. This commit considerably increases the number of points in code where those types are propagated.
In order to avoid complicating signatures of Parser's methods, a preferred type is kept as a member variable in the parser and updated during parsing.
Differential revision: https://reviews.llvm.org/D56723
llvm-svn: 352788
show more ...
|
#
c61eaa59 |
| 28-Jan-2019 |
Anastasia Stulova <anastasia.stulova@arm.com> |
Rename getTypeQualifiers to getMethodQualifiers.
Use more descriptive name for the method qualifiers getter.
Differential Revision: https://reviews.llvm.org/D56792
llvm-svn: 352349
|
#
c514adef |
| 24-Jan-2019 |
Ilya Biryukov <ibiryukov@google.com> |
[CodeComplete] [clangd] Fix crash on ValueDecl with a null type
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https
[CodeComplete] [clangd] Fix crash on ValueDecl with a null type
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D57093
llvm-svn: 352040
show more ...
|