Lines Matching defs:Results
42 /// \brief A container of code-completion results.
54 /// \brief The actual results we have found.
55 std::vector<Result> Results;
91 // 1 -> 2 elements: create the vector of results and push in the
119 /// results.
122 /// \brief The semantic analysis object for which results are being
132 /// results that are not desirable.
160 /// \brief The completion context in which we are gathering results.
205 /// results.
211 /// \brief Set the filter used for code-completion results.
216 Result *data() { return Results.empty()? nullptr : &Results.front(); }
217 unsigned size() const { return Results.size(); }
218 bool empty() const { return Results.empty(); }
246 /// \brief Retrieve the code-completion context for which results are
258 /// code completion results.
323 /// results of name lookup. All of the predicates have the same type, so that
504 // added as results.
508 // Class template (partial) specializations are never added as results.
513 // Using declarations themselves are never added as results.
535 // Filter out any unwanted results.
756 // If we have a preferred type, adjust the priority for results with exactly-
808 Results.push_back(R);
813 assert(!ShadowMaps.empty() && "Must enter into a results scope");
816 // For non-declaration results, just add the result.
817 Results.push_back(R);
855 Results[Index].Declaration = R.Declaration;
921 // Insert this result into the set of results and into the current shadow
923 SMap[R.Declaration->getDeclName()].Add(R.Declaration, Results.size());
924 Results.push_back(R);
933 // For non-declaration results, just add the result.
934 Results.push_back(R);
1007 // Insert this result into the set of results.
1008 Results.push_back(R);
1016 "Declaration results need more context");
1017 Results.push_back(R);
1249 ResultBuilder &Results;
1253 CodeCompletionDeclConsumer(ResultBuilder &Results, DeclContext *CurContext)
1254 : Results(Results), CurContext(CurContext) { }
1260 Accessible = Results.getSema().IsSimplyAccessible(ND, Ctx);
1262 ResultBuilder::Result Result(ND, Results.getBasePriority(ND), nullptr,
1264 Results.AddResult(Result, CurContext, Hiding, InBaseClass);
1269 /// \brief Add type specifiers for the current language as keyword results.
1271 ResultBuilder &Results) {
1273 Results.AddResult(Result("short", CCP_Type));
1274 Results.AddResult(Result("long", CCP_Type));
1275 Results.AddResult(Result("signed", CCP_Type));
1276 Results.AddResult(Result("unsigned", CCP_Type));
1277 Results.AddResult(Result("void", CCP_Type));
1278 Results.AddResult(Result("char", CCP_Type));
1279 Results.AddResult(Result("int", CCP_Type));
1280 Results.AddResult(Result("float", CCP_Type));
1281 Results.AddResult(Result("double", CCP_Type));
1282 Results.AddResult(Result("enum", CCP_Type));
1283 Results.AddResult(Result("struct", CCP_Type));
1284 Results.AddResult(Result("union", CCP_Type));
1285 Results.AddResult(Result("const", CCP_Type));
1286 Results.AddResult(Result("volatile", CCP_Type));
1290 Results.AddResult(Result("_Complex", CCP_Type));
1291 Results.AddResult(Result("_Imaginary", CCP_Type));
1292 Results.AddResult(Result("_Bool", CCP_Type));
1293 Results.AddResult(Result("restrict", CCP_Type));
1296 CodeCompletionBuilder Builder(Results.getAllocator(),
1297 Results.getCodeCompletionTUInfo());
1300 Results.AddResult(Result("bool", CCP_Type +
1302 Results.AddResult(Result("class", CCP_Type));
1303 Results.AddResult(Result("wchar_t", CCP_Type));
1311 Results.AddResult(Result(Builder.TakeString()));
1314 Results.AddResult(Result("auto", CCP_Type));
1315 Results.AddResult(Result("char16_t", CCP_Type));
1316 Results.AddResult(Result("char32_t", CCP_Type));
1322 Results.AddResult(Result(Builder.TakeString()));
1329 // Results.AddResult(Result("_Decimal32"));
1330 // Results.AddResult(Result("_Decimal64"));
1331 // Results.AddResult(Result("_Decimal128"));
1336 Results.AddResult(Result(Builder.TakeString()));
1342 Results.AddResult(Result(Builder.TakeString()));
1346 Results.AddResult(Result("_Nonnull", CCP_Type));
1347 Results.AddResult(Result("_Null_unspecified", CCP_Type));
1348 Results.AddResult(Result("_Nullable", CCP_Type));
1353 ResultBuilder &Results) {
1358 Results.AddResult(Result("extern"));
1359 Results.AddResult(Result("static"));
1364 ResultBuilder &Results) {
1370 Results.AddResult(Result("explicit"));
1371 Results.AddResult(Result("friend"));
1372 Results.AddResult(Result("mutable"));
1373 Results.AddResult(Result("virtual"));
1382 Results.AddResult(Result("inline"));
1398 static void AddObjCExpressionResults(ResultBuilder &Results, bool NeedAt);
1399 static void AddObjCStatementResults(ResultBuilder &Results, bool NeedAt);
1401 ResultBuilder &Results,
1404 Results,
1407 ResultBuilder &Results,
1409 static void AddObjCTopLevelResults(ResultBuilder &Results, bool NeedAt);
1411 static void AddTypedefResult(ResultBuilder &Results) {
1412 CodeCompletionBuilder Builder(Results.getAllocator(),
1413 Results.getCodeCompletionTUInfo());
1419 Results.AddResult(CodeCompletionResult(Builder.TakeString()));
1501 static void addThisCompletion(Sema &S, ResultBuilder &Results) {
1506 CodeCompletionAllocator &Allocator = Results.getAllocator();
1507 CodeCompletionBuilder Builder(Allocator, Results.getCodeCompletionTUInfo());
1514 Results.AddResult(CodeCompletionResult(Builder.TakeString()));
1521 ResultBuilder &Results) {
1522 CodeCompletionAllocator &Allocator = Results.getAllocator();
1523 CodeCompletionBuilder Builder(Allocator, Results.getCodeCompletionTUInfo());
1530 if (Results.includeCodePatterns()) {
1539 Results.AddResult(Result(Builder.TakeString()));
1548 Results.AddResult(Result(Builder.TakeString()));
1556 Results.AddResult(Result(Builder.TakeString()));
1563 Results.AddResult(Result(Builder.TakeString()));
1565 if (Results.includeCodePatterns()) {
1570 Results.AddResult(Result(Builder.TakeString()));
1575 AddObjCTopLevelResults(Results, true);
1577 AddTypedefResult(Results);
1588 Results.AddResult(Result(Builder.TakeString()));
1599 Results.AddResult(Result(Builder.TakeString()));
1603 AddTypedefResult(Results);
1607 if (Results.includeCodePatterns())
1609 Results.AddResult(Result(Builder.TakeString()));
1613 if (Results.includeCodePatterns())
1615 Results.AddResult(Result(Builder.TakeString()));
1619 if (Results.includeCodePatterns())
1621 Results.AddResult(Result(Builder.TakeString()));
1628 if (SemaRef.getLangOpts().CPlusPlus && Results.includeCodePatterns()) {
1634 Results.AddResult(Result(Builder.TakeString()));
1637 AddStorageSpecifiers(CCC, SemaRef.getLangOpts(), Results);
1638 AddFunctionSpecifiers(CCC, SemaRef.getLangOpts(), Results);
1642 AddObjCInterfaceResults(SemaRef.getLangOpts(), Results, true);
1643 AddStorageSpecifiers(CCC, SemaRef.getLangOpts(), Results);
1644 AddFunctionSpecifiers(CCC, SemaRef.getLangOpts(), Results);
1648 AddObjCImplementationResults(SemaRef.getLangOpts(), Results, true);
1649 AddStorageSpecifiers(CCC, SemaRef.getLangOpts(), Results);
1650 AddFunctionSpecifiers(CCC, SemaRef.getLangOpts(), Results);
1654 AddObjCVisibilityResults(SemaRef.getLangOpts(), Results, true);
1659 AddTypedefResult(Results);
1661 if (SemaRef.getLangOpts().CPlusPlus && Results.includeCodePatterns() &&
1676 Results.AddResult(Result(Builder.TakeString()));
1679 AddObjCStatementResults(Results, true);
1681 if (Results.includeCodePatterns()) {
1694 Results.AddResult(Result(Builder.TakeString()));
1707 Results.AddResult(Result(Builder.TakeString()));
1717 Results.AddResult(Result(Builder.TakeString()));
1722 Results.AddResult(Result(Builder.TakeString()));
1725 if (Results.includeCodePatterns()) {
1738 Results.AddResult(Result(Builder.TakeString()));
1750 Results.AddResult(Result(Builder.TakeString()));
1769 Results.AddResult(Result(Builder.TakeString()));
1775 Results.AddResult(Result(Builder.TakeString()));
1781 Results.AddResult(Result(Builder.TakeString()));
1800 Results
1806 Results.AddResult(Result(Builder.TakeString()));
1814 Results.AddResult(Result(Builder.TakeString()));
1820 AddStorageSpecifiers(CCC, SemaRef.getLangOpts(), Results);
1832 Results.AddResult(Result(Builder.TakeString()));
1840 Results.AddResult(Result(Builder.TakeString()));
1848 Results.AddResult(Result(Builder.TakeString()));
1855 addThisCompletion(SemaRef, Results);
1860 Results.AddResult(Result(Builder.TakeString()));
1865 Results.AddResult(Result(Builder.TakeString()));
1876 Results.AddResult(Result(Builder.TakeString()));
1887 Results.AddResult(Result(Builder.TakeString()));
1897 Results.AddResult(Result(Builder.TakeString()));
1907 Results.AddResult(Result(Builder.TakeString()));
1916 Results.AddResult(Result(Builder.TakeString()));
1926 Results.AddResult(Result(Builder.TakeString()));
1938 Results.AddResult(Result(Builder.TakeString()));
1945 Results.AddResult(Result(Builder.TakeString()));
1955 Results.AddResult(Result(Builder.TakeString()));
1963 Results.AddResult(Result(Builder.TakeString()));
1972 Results.AddResult(Result(Builder.TakeString()));
1980 Results.AddResult(Result(Builder.TakeString()));
1988 Results.AddResult(Result(Builder.TakeString()));
1996 Results.AddResult(Result(Builder.TakeString()));
2013 Results.AddResult(Result(Builder.TakeString()));
2017 AddObjCExpressionResults(Results, true);
2030 Results.AddResult(Result(Builder.TakeString()));
2039 Results.AddResult(Result(Builder.TakeString()));
2049 AddTypeSpecifierResults(SemaRef.getLangOpts(), Results);
2052 Results.AddResult(Result("operator"));
3088 static void AddMacroResults(Preprocessor &PP, ResultBuilder &Results,
3093 Results.EnterNewScope();
3104 Results.AddResult(Result(M->first,
3111 Results.ExitScope();
3116 ResultBuilder &Results) {
3119 Results.EnterNewScope();
3121 Results.AddResult(Result("__PRETTY_FUNCTION__", CCP_Constant));
3122 Results.AddResult(Result("__FUNCTION__", CCP_Constant));
3124 Results.AddResult(Result("__func__", CCP_Constant));
3125 Results.ExitScope();
3131 CodeCompletionResult *Results,
3134 CodeCompleter->ProcessCodeCompleteResults(*S, Context, Results, NumResults);
3193 /// \brief If we're in a C++ virtual member function, add completion results
3197 /// \param S The semantic analysis object for which we are generating results.
3202 ResultBuilder &Results) {
3223 CodeCompletionBuilder Builder(Results.getAllocator(),
3224 Results.getCodeCompletionTUInfo());
3238 Builder.AddTextChunk(Results.getAllocator().CopyString(OS.str()));
3243 Builder.AddTypedTextChunk(Results.getAllocator().CopyString(
3254 Results.getAllocator().CopyString(P->getIdentifier()->getName()));
3257 Results.AddResult(CodeCompletionResult(Builder.TakeString(),
3262 Results.Ignore(Overridden);
3269 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
3272 Results.EnterNewScope();
3274 CodeCompletionAllocator &Allocator = Results.getAllocator();
3275 CodeCompletionBuilder Builder(Allocator, Results.getCodeCompletionTUInfo());
3284 Results.AddResult(Result(Builder.TakeString(),
3304 Results.AddResult(Result(Builder.TakeString(),
3313 Results.ExitScope();
3314 HandleCodeCompleteResults(this, CodeCompleter, Results.getCompletionContext(),
3315 Results.data(),Results.size());
3320 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
3323 Results.EnterNewScope();
3325 // Determine how to filter results, e.g., so that the names of
3338 Results.setFilter(&ResultBuilder::IsOrdinaryNonValueName);
3347 Results.setFilter(&ResultBuilder::IsOrdinaryName);
3349 Results.setFilter(&ResultBuilder::IsOrdinaryNonTypeName);
3352 MaybeAddOverrideCalls(*this, /*InContext=*/nullptr, Results);
3361 // the member function to filter/prioritize the results list.
3364 Results.setObjectTypeQualifiers(
3367 CodeCompletionDeclConsumer Consumer(Results, CurContext);
3371 AddOrdinaryNameResults(CompletionContext, S, *this, Results);
3372 Results.ExitScope();
3380 AddPrettyFunctionResults(getLangOpts(), Results);
3398 AddMacroResults(PP, Results, false);
3400 HandleCodeCompleteResults(this, CodeCompleter, Results.getCompletionContext(),
3401 Results.data(),Results.size());
3409 ResultBuilder &Results);
3415 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
3420 Results.EnterNewScope();
3423 Results.AddResult(Result("const"));
3424 Results.AddResult(Result("volatile"));
3426 Results.AddResult(Result("restrict"));
3430 Results.AddResult(Result("operator"));
3435 Results.allowNestedNameSpecifiers();
3436 Results.setFilter(&ResultBuilder::IsImpossibleToSatisfy);
3437 CodeCompletionDeclConsumer Consumer(Results, CurContext);
3440 Results.setFilter(nullptr);
3443 Results.ExitScope();
3462 AddClassMessageCompletions(*this, S, T, None, false, false, Results);
3465 // Note that we intentionally suppress macro results here, since we do not
3469 Results.getCompletionContext(),
3470 Results.data(), Results.size());
3488 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
3492 Results.setFilter(&ResultBuilder::IsObjCCollection);
3494 Results.setFilter(&ResultBuilder::IsIntegralConstantValue);
3496 Results.setFilter(&ResultBuilder::IsOrdinaryName);
3498 Results.setFilter(&ResultBuilder::IsOrdinaryNonTypeName);
3501 Results.setPreferredType(Data.PreferredType.getNonReferenceType());
3505 Results.Ignore(Data.IgnoreDecls[I]);
3507 CodeCompletionDeclConsumer Consumer(Results, CurContext);
3511 Results.EnterNewScope();
3512 AddOrdinaryNameResults(PCC_Expression, S, *this, Results);
3513 Results.ExitScope();
3524 AddPrettyFunctionResults(getLangOpts(), Results);
3527 AddMacroResults(PP, Results, false, PreferredTypeIsPointer);
3531 Results.data(),Results.size());
3569 ResultBuilder &Results) {
3578 Results.MaybeAddResult(Result(P, Results.getBasePriority(P), nullptr),
3584 PrintingPolicy Policy = getCompletionPrintingPolicy(Results.getSema());
3589 CodeCompletionBuilder Builder(Results.getAllocator(),
3590 Results.getCodeCompletionTUInfo());
3594 Results.getAllocator().CopyString(Name->getName()));
3596 Results.MaybeAddResult(Result(Builder.TakeString(), M,
3608 CurContext, AddedProperties, Results);
3614 CurContext, AddedProperties, Results);
3620 CurContext, AddedProperties, Results);
3626 AddedProperties, Results);
3632 CurContext, AddedProperties, Results);
3676 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
3680 Results.EnterNewScope();
3684 Results.setObjectTypeQualifiers(BaseType.getQualifiers());
3687 Results.allowNestedNameSpecifiers();
3688 CodeCompletionDeclConsumer Consumer(Results, CurContext);
3693 if (!Results.empty()) {
3707 Results.AddResult(Result("template"));
3714 // Add property results based on our interface.
3720 AddedProperties, Results);
3725 CurContext, AddedProperties, Results);
3738 CodeCompletionDeclConsumer Consumer(Results, CurContext);
3739 Results.setFilter(&ResultBuilder::IsObjCIvar);
3747 Results.ExitScope();
3749 // Hand off the results found for code completion.
3751 Results.getCompletionContext(),
3752 Results.data(),Results.size());
3784 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
3786 CodeCompletionDeclConsumer Consumer(Results, CurContext);
3789 Results.setFilter(Filter);
3795 Results.setFilter(&ResultBuilder::IsNestedNameSpecifier);
3799 HandleCodeCompleteResults(this, CodeCompleter, Results.getCompletionContext(),
3800 Results.data(),Results.size());
3804 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
3807 Results.EnterNewScope();
3809 Results.AddResult("const");
3811 Results.AddResult("volatile");
3814 Results.AddResult("restrict");
3817 Results.AddResult("_Atomic");
3818 Results.ExitScope();
3820 Results.getCompletionContext(),
3821 Results.data(), Results.size());
3890 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
3893 Results.EnterNewScope();
3899 Results.AddResult(R, CurContext, nullptr, false);
3901 Results.ExitScope();
3907 AddMacroResults(PP, Results, false);
3913 Results.data(),Results.size());
3930 SmallVectorImpl<ResultCandidate> &Results,
3941 // Add the remaining viable overload candidates as code-completion results.
3944 Results.push_back(ResultCandidate(Candidate.Function));
4000 // results. We may want to revisit this strategy in the future,
4001 // e.g., by merging the two kinds of results.
4016 SmallVector<ResultCandidate, 8> Results;
4044 Results.push_back(ResultCandidate(FD));
4079 Results.push_back(ResultCandidate(FP));
4082 Results.push_back(ResultCandidate(FT));
4086 mergeCandidatesWithResults(*this, Results, CandidateSet, Loc);
4087 CodeCompleteOverloadResults(*this, S, Results, Args.size(),
4127 SmallVector<ResultCandidate, 8> Results;
4128 mergeCandidatesWithResults(*this, Results, CandidateSet, Loc);
4129 CodeCompleteOverloadResults(*this, S, Results, Args.size());
4159 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
4162 Results.setFilter(&ResultBuilder::IsOrdinaryName);
4163 Results.EnterNewScope();
4165 CodeCompletionDeclConsumer Consumer(Results, CurContext);
4169 AddOrdinaryNameResults(PCC_Statement, S, *this, Results);
4172 CodeCompletionBuilder Builder(Results.getAllocator(),
4173 Results.getCodeCompletionTUInfo());
4175 if (Results.includeCodePatterns()) {
4183 Results.AddResult(Builder.TakeString());
4196 if (Results.includeCodePatterns()) {
4204 Results.AddResult(Builder.TakeString());
4206 Results.ExitScope();
4209 AddPrettyFunctionResults(getLangOpts(), Results);
4212 AddMacroResults(PP, Results, false);
4214 HandleCodeCompleteResults(this, CodeCompleter, Results.getCompletionContext(),
4215 Results.data(),Results.size());
4239 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
4242 Results.EnterNewScope();
4247 if (!Results.empty() && NNS->isDependent())
4248 Results.AddResult("template");
4256 MaybeAddOverrideCalls(*this, Ctx, Results);
4257 Results.ExitScope();
4259 CodeCompletionDeclConsumer Consumer(Results, CurContext);
4263 Results.getCompletionContext(),
4264 Results.data(),Results.size());
4271 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
4275 Results.EnterNewScope();
4279 Results.AddResult(CodeCompletionResult("namespace"));
4283 CodeCompletionDeclConsumer Consumer(Results, CurContext);
4286 Results.ExitScope();
4290 Results.data(),Results.size());
4299 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
4303 Results.EnterNewScope();
4304 CodeCompletionDeclConsumer Consumer(Results, CurContext);
4307 Results.ExitScope();
4310 Results.data(),Results.size());
4324 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
4343 // namespace to the list of results.
4344 Results.EnterNewScope();
4349 Results.AddResult(CodeCompletionResult(
4350 NS->second, Results.getBasePriority(NS->second),
4353 Results.ExitScope();
4357 Results.getCompletionContext(),
4358 Results.data(),Results.size());
4366 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
4370 CodeCompletionDeclConsumer Consumer(Results, CurContext);
4374 Results.getCompletionContext(),
4375 Results.data(),Results.size());
4383 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
4387 Results.EnterNewScope();
4392 Results.AddResult(Result(Spelling));
4396 Results.allowNestedNameSpecifiers();
4397 CodeCompletionDeclConsumer Consumer(Results, CurContext);
4402 AddTypeSpecifierResults(getLangOpts(), Results);
4403 Results.ExitScope();
4407 Results.data(),Results.size());
4422 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
4425 Results.EnterNewScope();
4440 CodeCompletionBuilder Builder(Results.getAllocator(),
4441 Results.getCodeCompletionTUInfo());
4457 Results.getAllocator().CopyString(
4462 Results.AddResult(CodeCompletionResult(Builder.TakeString(),
4486 Results.AddResult(CodeCompletionResult(Builder.TakeString(),
4511 Results.AddResult(CodeCompletionResult(Builder.TakeString(),
4519 Results.ExitScope();
4521 HandleCodeCompleteResults(this, CodeCompleter, Results.getCompletionContext(),
4522 Results.data(), Results.size());
4536 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
4539 Results.EnterNewScope();
4563 Results.AddResult(CodeCompletionResult(Var, CCP_LocalDeclaration),
4570 addThisCompletion(*this, Results);
4572 Results.ExitScope();
4574 HandleCodeCompleteResults(this, CodeCompleter, Results.getCompletionContext(),
4575 Results.data(), Results.size());
4583 ResultBuilder &Results,
4587 Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"end")));
4589 CodeCompletionBuilder Builder(Results.getAllocator(),
4590 Results.getCodeCompletionTUInfo());
4596 Results.AddResult(Result(Builder.TakeString()));
4602 Results.AddResult(Result(Builder.TakeString()));
4607 ResultBuilder &Results,
4612 Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"end")));
4616 Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"property")));
4619 Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"required")));
4622 Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"optional")));
4626 static void AddObjCTopLevelResults(ResultBuilder &Results, bool NeedAt) {
4628 CodeCompletionBuilder Builder(Results.getAllocator(),
4629 Results.getCodeCompletionTUInfo());
4635 Results.AddResult(Result(Builder.TakeString()));
4637 if (Results.includeCodePatterns()) {
4644 Results.AddResult(Result(Builder.TakeString()));
4650 Results.AddResult(Result(Builder.TakeString()));
4656 Results.AddResult(Result(Builder.TakeString()));
4665 Results.AddResult(Result(Builder.TakeString()));
4667 if (Results.getSema().getLangOpts().Modules) {
4672 Results.AddResult(Result(Builder.TakeString()));
4677 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
4680 Results.EnterNewScope();
4682 AddObjCImplementationResults(getLangOpts(), Results, false);
4684 AddObjCInterfaceResults(getLangOpts(), Results, false);
4686 AddObjCTopLevelResults(Results, false);
4687 Results.ExitScope();
4690 Results.data(),Results.size());
4693 static void AddObjCExpressionResults(ResultBuilder &Results, bool NeedAt) {
4695 CodeCompletionBuilder Builder(Results.getAllocator(),
4696 Results.getCodeCompletionTUInfo());
4700 if (Results.getSema().getLangOpts().CPlusPlus ||
4701 Results.getSema().getLangOpts().ConstStrings)
4708 Results.AddResult(Result(Builder.TakeString()));
4716 Results.AddResult(Result(Builder.TakeString()));
4724 Results.AddResult(Result(Builder.TakeString()));
4731 Results.AddResult(Result(Builder.TakeString()));
4738 Results.AddResult(Result(Builder.TakeString()));
4748 Results.AddResult(Result(Builder.TakeString()));
4755 Results.AddResult(Result(Builder.TakeString()));
4758 static void AddObjCStatementResults(ResultBuilder &Results, bool NeedAt) {
4760 CodeCompletionBuilder Builder(Results.getAllocator(),
4761 Results.getCodeCompletionTUInfo());
4763 if (Results.includeCodePatterns()) {
4781 Results.AddResult(Result(Builder.TakeString()));
4788 Results.AddResult(Result(Builder.TakeString()));
4790 if (Results.includeCodePatterns()) {
4800 Results.AddResult(Result(Builder.TakeString()));
4805 ResultBuilder &Results,
4808 Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"private")));
4809 Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"protected")));
4810 Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"public")));
4812 Results.AddResult(Result(OBJC_AT_KEYWORD_NAME(NeedAt,"package")));
4816 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
4819 Results.EnterNewScope();
4820 AddObjCVisibilityResults(getLangOpts(), Results, false);
4821 Results.ExitScope();
4824 Results.data(),Results.size());
4828 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
4831 Results.EnterNewScope();
4832 AddObjCStatementResults(Results, false);
4833 AddObjCExpressionResults(Results, false);
4834 Results.ExitScope();
4837 Results.data(),Results.size());
4841 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
4844 Results.EnterNewScope();
4845 AddObjCExpressionResults(Results, false);
4846 Results.ExitScope();
4849 Results.data(),Results.size());
4891 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
4894 Results.EnterNewScope();
4896 Results.AddResult(CodeCompletionResult("readonly"));
4898 Results.AddResult(CodeCompletionResult("assign"));
4901 Results.AddResult(CodeCompletionResult("unsafe_unretained"));
4903 Results.AddResult(CodeCompletionResult("readwrite"));
4905 Results.AddResult(CodeCompletionResult("retain"));
4907 Results.AddResult(CodeCompletionResult("strong"));
4909 Results.AddResult(CodeCompletionResult("copy"));
4911 Results.AddResult(CodeCompletionResult("nonatomic"));
4913 Results.AddResult(CodeCompletionResult("atomic"));
4918 Results.AddResult(CodeCompletionResult("weak"));
4921 CodeCompletionBuilder Setter(Results.getAllocator(),
4922 Results.getCodeCompletionTUInfo());
4926 Results.AddResult(CodeCompletionResult(Setter.TakeString()));
4929 CodeCompletionBuilder Getter(Results.getAllocator(),
4930 Results.getCodeCompletionTUInfo());
4934 Results.AddResult(CodeCompletionResult(Getter.TakeString()));
4937 Results.AddResult(CodeCompletionResult("nonnull"));
4938 Results.AddResult(CodeCompletionResult("nullable"));
4939 Results.AddResult(CodeCompletionResult("null_unspecified"));
4940 Results.AddResult(CodeCompletionResult("null_resettable"));
4942 Results.ExitScope();
4945 Results.data(),Results.size());
4995 /// container to the set of results.
5013 /// \param Results the structure into which we'll add results.
5021 ResultBuilder &Results,
5040 Result R = Result(M, Results.getBasePriority(M), nullptr);
5045 Results.MaybeAddResult(R, CurContext);
5058 CurContext, Selectors, AllowSameLength, Results, false);
5068 CurContext, Selectors, AllowSameLength, Results, false);
5074 Results, InOriginalClass);
5084 Results, false);
5090 Results, InOriginalClass);
5097 AllowSameLength, Results, false);
5103 Results, InOriginalClass);
5120 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
5123 Results.EnterNewScope();
5127 /*AllowSameLength=*/true, Results);
5128 Results.ExitScope();
5131 Results.data(),Results.size());
5148 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
5151 Results.EnterNewScope();
5155 Selectors, /*AllowSameLength=*/true, Results);
5157 Results.ExitScope();
5160 Results.data(),Results.size());
5165 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
5168 Results.EnterNewScope();
5174 Results.AddResult("in");
5175 Results.AddResult("inout");
5180 Results.AddResult("out");
5182 Results.AddResult("inout");
5187 Results.AddResult("bycopy");
5188 Results.AddResult("byref");
5189 Results.AddResult("oneway");
5192 Results.AddResult("nonnull");
5193 Results.AddResult("nullable");
5194 Results.AddResult("null_unspecified");
5203 CodeCompletionBuilder Builder(Results.getAllocator(),
5204 Results.getCodeCompletionTUInfo(),
5214 Results.AddResult(CodeCompletionResult(Builder.TakeString()));
5219 Results.AddResult(CodeCompletionResult("instancetype"));
5223 AddOrdinaryNameResults(PCC_Type, S, *this, Results);
5224 Results.ExitScope();
5227 Results.setFilter(&ResultBuilder::IsOrdinaryNonValueName);
5228 CodeCompletionDeclConsumer Consumer(Results, CurContext);
5233 AddMacroResults(PP, Results, false);
5237 Results.data(), Results.size());
5323 /// \param Results The set of results to augment.
5330 ResultBuilder &Results) {
5379 CodeCompletionBuilder Builder(Results.getAllocator(),
5380 Results.getCodeCompletionTUInfo());
5384 Results.getCompletionContext().getBaseType(),
5427 Results.AddResult(CodeCompletionResult(Builder.TakeString(), SuperMethod,
5434 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
5441 CodeCompletionDeclConsumer Consumer(Results, CurContext);
5442 Results.EnterNewScope();
5451 Results.AddResult(Result("super"));
5453 AddSuperSendCompletion(*this, /*NeedSuperKeyword=*/true, None, Results);
5457 addThisCompletion(*this, Results);
5459 Results.ExitScope();
5462 AddMacroResults(PP, Results, false);
5463 HandleCodeCompleteResults(this, CodeCompleter, Results.getCompletionContext(),
5464 Results.data(), Results.size());
5531 /// \brief Given a set of code-completion results for the argument of a message
5533 static QualType getPreferredArgumentTypeForMessageSend(ResultBuilder &Results,
5536 ASTContext &Context = Results.getSema().Context;
5540 Result *ResultsData = Results.data();
5541 for (unsigned I = 0, N = Results.size(); I != N; ++I) {
5570 ResultBuilder &Results) {
5585 Results.EnterNewScope();
5591 = AddSuperSendCompletion(SemaRef, false, SelIdents, Results))
5592 Results.Ignore(SuperMethod);
5598 Results.setPreferredSelector(CurMethod->getSelector());
5604 Results);
5632 Results.getBasePriority(MethList->getMethod()), nullptr);
5635 Results.MaybeAddResult(R, SemaRef.CurContext);
5640 Results.ExitScope();
5650 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
5656 AtArgumentExpression, IsSuper, Results);
5662 // our preferred type, improving completion results.
5664 QualType PreferredType = getPreferredArgumentTypeForMessageSend(Results,
5674 Results.getCompletionContext(),
5675 Results.data(), Results.size());
5722 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
5727 Results.EnterNewScope();
5733 = AddSuperSendCompletion(*this, false, SelIdents, Results))
5734 Results.Ignore(SuperMethod);
5740 Results.setPreferredSelector(CurMethod->getSelector());
5753 CurContext, Selectors, AtArgumentExpression, Results);
5762 Selectors, AtArgumentExpression, Results);
5770 Results);
5775 Selectors, AtArgumentExpression, Results);
5780 // about as code-completion results.
5808 Results.getBasePriority(MethList->getMethod()), nullptr);
5811 Results.MaybeAddResult(R, CurContext);
5815 Results.ExitScope();
5822 // our preferred type, improving completion results.
5824 QualType PreferredType = getPreferredArgumentTypeForMessageSend(Results,
5834 Results.getCompletionContext(),
5835 Results.data(),Results.size());
5869 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
5872 Results.EnterNewScope();
5881 CodeCompletionBuilder Builder(Results.getAllocator(),
5882 Results.getCodeCompletionTUInfo());
5886 Results.AddResult(Builder.TakeString());
5904 Results.AddResult(Builder.TakeString());
5906 Results.ExitScope();
5910 Results.data(), Results.size());
5917 ResultBuilder &Results) {
5924 Results.AddResult(Result(Proto, Results.getBasePriority(Proto),nullptr),
5931 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
5936 Results.EnterNewScope();
5940 // FIXME: This doesn't work when caching code-completion results.
5944 Results.Ignore(Protocol);
5948 Results);
5950 Results.ExitScope();
5955 Results.data(),Results.size());
5959 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
5964 Results.EnterNewScope();
5968 Results);
5970 Results.ExitScope();
5975 Results.data(),Results.size());
5983 ResultBuilder &Results) {
5991 Results.AddResult(Result(Class, Results.getBasePriority(Class),nullptr),
5997 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
6000 Results.EnterNewScope();
6005 false, Results);
6008 Results.ExitScope();
6012 Results.data(),Results.size());
6017 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
6020 Results.EnterNewScope();
6026 Results.Ignore(CurClass);
6031 false, Results);
6034 Results.ExitScope();
6038 Results.data(),Results.size());
6042 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
6045 Results.EnterNewScope();
6050 true, Results);
6053 Results.ExitScope();
6057 Results.data(),Results.size());
6065 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
6080 Results.EnterNewScope();
6085 Results.AddResult(Result(Category, Results.getBasePriority(Category),
6088 Results.ExitScope();
6092 Results.data(),Results.size());
6109 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
6117 Results.EnterNewScope();
6123 Results.AddResult(Result(Cat, Results.getBasePriority(Cat), nullptr),
6130 Results.ExitScope();
6134 Results.data(),Results.size());
6139 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
6155 Results.Ignore(PropertyImpl->getPropertyDecl());
6159 Results.EnterNewScope();
6164 AddedProperties, Results);
6169 AddedProperties, Results);
6170 Results.ExitScope();
6174 Results.data(),Results.size());
6180 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
6210 Results.setPreferredType(PropertyType);
6215 Results.EnterNewScope();
6225 Results.AddResult(Result(Ivar, Results.getBasePriority(Ivar), nullptr),
6236 // advantage over other results whose names don't match so closely.
6237 if (Results.size() &&
6238 Results.data()[Results.size() - 1].Kind
6240 Results.data()[Results.size() - 1].Declaration == Ivar)
6241 Results.data()[Results.size() - 1].Priority--;
6251 CodeCompletionAllocator &Allocator = Results.getAllocator();
6252 CodeCompletionBuilder Builder(Allocator, Results.getCodeCompletionTUInfo(),
6259 Results.AddResult(Result(Builder.TakeString(), Priority,
6263 Results.ExitScope();
6267 Results.data(),Results.size());
6399 ResultBuilder &Results) {
6404 PrintingPolicy Policy = getCompletionPrintingPolicy(Results.getSema());
6408 CodeCompletionAllocator &Allocator = Results.getAllocator();
6409 CodeCompletionBuilder Builder(Allocator, Results.getCodeCompletionTUInfo());
6452 Results.AddResult(Result(Builder.TakeString(), CCP_CodePattern,
6476 Results.AddResult(Result(Builder.TakeString(), CCP_CodePattern,
6499 Results.AddResult(Result(Builder.TakeString(), CCP_CodePattern,
6548 Results.AddResult(Result(Builder.TakeString(),
6574 Results.AddResult(Result(Builder.TakeString(), IndexedGetterPriority,
6601 Results.AddResult(Result(Builder.TakeString(), IndexedGetterPriority,
6633 Results.AddResult(Result(Builder.TakeString(), IndexedGetterPriority,
6667 Results.AddResult(Result(Builder.TakeString(), IndexedSetterPriority,
6698 Results.AddResult(Result(Builder.TakeString(), IndexedSetterPriority,
6720 Results.AddResult(Result(Builder.TakeString(), IndexedSetterPriority,
6742 Results.AddResult(Result(Builder.TakeString(), IndexedSetterPriority,
6774 Results.AddResult(Result(Builder.TakeString(), IndexedSetterPriority,
6807 Results.AddResult(Result(Builder.TakeString(), IndexedSetterPriority,
6831 Results.AddResult(Result(Builder.TakeString(), UnorderedGetterPriority,
6861 Results.AddResult(Result(Builder.TakeString(), UnorderedGetterPriority,
6885 Results.AddResult(Result(Builder.TakeString(), UnorderedSetterPriority,
6906 Results.AddResult(Result(Builder.TakeString(), UnorderedSetterPriority,
6929 Results.AddResult(Result(Builder.TakeString(), UnorderedSetterPriority,
6950 Results.AddResult(Result(Builder.TakeString(), UnorderedSetterPriority,
6971 Results.AddResult(Result(Builder.TakeString(), UnorderedSetterPriority,
6996 Results.AddResult(Result(Builder.TakeString(), CCP_CodePattern,
7018 Results.AddResult(Result(Builder.TakeString(), CCP_CodePattern,
7069 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
7072 Results.EnterNewScope();
7078 CodeCompletionBuilder Builder(Results.getAllocator(),
7079 Results.getCodeCompletionTUInfo());
7136 if (IsInImplementation && Results.includeCodePatterns()) {
7158 Results.AddResult(Result(Builder.TakeString(), Method, Priority));
7186 KnownSelectors, Results);
7189 Results.ExitScope();
7193 Results.data(),Results.size());
7216 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
7221 Results.setPreferredType(GetTypeFromParser(ReturnTy).getNonReferenceType());
7223 Results.EnterNewScope();
7242 CodeCompletionBuilder Builder(Results.getAllocator(),
7243 Results.getCodeCompletionTUInfo());
7246 Results.AddResult(Builder.TakeString());
7254 Results.getBasePriority(MethList->getMethod()), nullptr);
7258 Results.MaybeAddResult(R, CurContext);
7262 Results.ExitScope();
7265 Results.data(),Results.size());
7269 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
7272 Results.EnterNewScope();
7275 CodeCompletionBuilder Builder(Results.getAllocator(),
7276 Results.getCodeCompletionTUInfo());
7280 Results.AddResult(Builder.TakeString());
7286 Results.AddResult(Builder.TakeString());
7292 Results.AddResult(Builder.TakeString());
7299 Results.AddResult(Builder.TakeString());
7303 Results.AddResult(Builder.TakeString());
7307 Results.AddResult(Builder.TakeString());
7316 Results.AddResult(Builder.TakeString());
7324 Results.AddResult(Builder.TakeString());
7330 Results.AddResult(Builder.TakeString());
7339 Results.AddResult(Builder.TakeString());
7345 Results.AddResult(Builder.TakeString());
7351 Results.AddResult(Builder.TakeString());
7361 Results.AddResult(Builder.TakeString());
7367 Results.AddResult(Builder.TakeString());
7373 Results.AddResult(Builder.TakeString());
7382 Results.AddResult(Builder.TakeString());
7390 Results.AddResult(Builder.TakeString());
7399 Results.AddResult(Builder.TakeString());
7407 Results.AddResult(Builder.TakeString());
7413 Results.AddResult(Builder.TakeString());
7420 Results.ExitScope();
7424 Results.data(), Results.size());
7434 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
7440 CodeCompletionBuilder Builder(Results.getAllocator(),
7441 Results.getCodeCompletionTUInfo());
7442 Results.EnterNewScope();
7448 Results.AddResult(CodeCompletionResult(Builder.TakeString(),
7452 Results.ExitScope();
7457 HandleCodeCompleteResults(this, CodeCompleter, Results.getCompletionContext(),
7458 Results.data(), Results.size());
7462 ResultBuilder Results(*this, CodeCompleter->getAllocator(),
7467 AddMacroResults(PP, Results, true);
7470 Results.EnterNewScope();
7471 CodeCompletionBuilder Builder(Results.getAllocator(),
7472 Results.getCodeCompletionTUInfo());
7478 Results.AddResult(Builder.TakeString());
7479 Results.ExitScope();
7483 Results.data(), Results.size());
7490 // FIXME: In the future, we could provide "overload" results, much like we
7505 SmallVectorImpl<CodeCompletionResult> &Results) {
7518 Results.clear();
7519 Results.insert(Results.end(),