summaryrefslogtreecommitdiff
path: root/lib/Parse/ParseOpenMP.cpp
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2018-09-07 14:04:39 +0000
committerIlya Biryukov <ibiryukov@google.com>2018-09-07 14:04:39 +0000
commit96b8b58101fe5e5532648db63bd90f5d56c5bea8 (patch)
tree3a907c265c8fc628af2cea4985cba269f17298bf /lib/Parse/ParseOpenMP.cpp
parent4e24bae3a87ad427403ec1ecb539a42e2eb8a351 (diff)
downloadclang-96b8b58101fe5e5532648db63bd90f5d56c5bea8.tar.gz
[CodeComplete] Clearly distinguish signature help and code completion.
Summary: Code completion in clang is actually a mix of two features: - Code completion is a familiar feature. Results are exposed via the CodeCompleteConsumer::ProcessCodeCompleteResults callback. - Signature help figures out if the current expression is an argument of some function call and shows corresponding signatures if so. Results are exposed via CodeCompleteConsumer::ProcessOverloadCandidates. This patch refactors the implementation to untangle those two from each other and makes some naming tweaks to avoid confusion when reading the code. The refactoring is required for signature help fixes, see D51038. The only intended behavior change is the order of callbacks. ProcessOverloadCandidates is now called before ProcessCodeCompleteResults. Reviewers: sammccall, kadircet Reviewed By: sammccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51782 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseOpenMP.cpp')
-rw-r--r--lib/Parse/ParseOpenMP.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Parse/ParseOpenMP.cpp b/lib/Parse/ParseOpenMP.cpp
index c53eae3067..b3c7e3a63d 100644
--- a/lib/Parse/ParseOpenMP.cpp
+++ b/lib/Parse/ParseOpenMP.cpp
@@ -418,10 +418,11 @@ void Parser::ParseOpenMPReductionInitializerForDecl(VarDecl *OmpPrivParm) {
SourceLocation LParLoc = T.getOpenLocation();
if (ParseExpressionList(
Exprs, CommaLocs, [this, OmpPrivParm, LParLoc, &Exprs] {
- Actions.CodeCompleteConstructor(
+ QualType PreferredType = Actions.ProduceConstructorSignatureHelp(
getCurScope(),
OmpPrivParm->getType()->getCanonicalTypeInternal(),
OmpPrivParm->getLocation(), Exprs, LParLoc);
+ Actions.CodeCompleteExpression(getCurScope(), PreferredType);
})) {
Actions.ActOnInitializerError(OmpPrivParm);
SkipUntil(tok::r_paren, tok::annot_pragma_openmp_end, StopBeforeMatch);