#include "clang/AST/ASTConcept.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprConcepts.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/AST/OperationKinds.h"
#include "clang/AST/QualTypeNames.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/Type.h"
#include "clang/Basic/AttributeCommonInfo.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/OperatorKinds.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/MacroInfo.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/CodeCompleteConsumer.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/Designator.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Overload.h"
#include "clang/Sema/ParsedAttr.h"
#include "clang/Sema/ParsedTemplate.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/Sema.h"
#include "clang/Sema/SemaCodeCompletion.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/SemaObjC.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <list>
#include <map>
#include <optional>
#include <string>
#include <vector>
usingnamespaceclang;
usingnamespacesema;
namespace {
class ResultBuilder { … };
}
void PreferredTypeBuilder::enterReturn(Sema &S, SourceLocation Tok) { … }
void PreferredTypeBuilder::enterVariableInit(SourceLocation Tok, Decl *D) { … }
static QualType getDesignatedType(QualType BaseType, const Designation &Desig);
void PreferredTypeBuilder::enterDesignatedInitializer(SourceLocation Tok,
QualType BaseType,
const Designation &D) { … }
void PreferredTypeBuilder::enterFunctionArgument(
SourceLocation Tok, llvm::function_ref<QualType()> ComputeType) { … }
void PreferredTypeBuilder::enterParenExpr(SourceLocation Tok,
SourceLocation LParLoc) { … }
static QualType getPreferredTypeOfBinaryRHS(Sema &S, Expr *LHS,
tok::TokenKind Op) { … }
static QualType getPreferredTypeOfUnaryArg(Sema &S, QualType ContextType,
tok::TokenKind Op) { … }
void PreferredTypeBuilder::enterBinary(Sema &S, SourceLocation Tok, Expr *LHS,
tok::TokenKind Op) { … }
void PreferredTypeBuilder::enterMemAccess(Sema &S, SourceLocation Tok,
Expr *Base) { … }
void PreferredTypeBuilder::enterUnary(Sema &S, SourceLocation Tok,
tok::TokenKind OpKind,
SourceLocation OpLoc) { … }
void PreferredTypeBuilder::enterSubscript(Sema &S, SourceLocation Tok,
Expr *LHS) { … }
void PreferredTypeBuilder::enterTypeCast(SourceLocation Tok,
QualType CastType) { … }
void PreferredTypeBuilder::enterCondition(Sema &S, SourceLocation Tok) { … }
class ResultBuilder::ShadowMapEntry::iterator { … };
ResultBuilder::ShadowMapEntry::iterator
ResultBuilder::ShadowMapEntry::begin() const { … }
ResultBuilder::ShadowMapEntry::iterator
ResultBuilder::ShadowMapEntry::end() const { … }
static NestedNameSpecifier *
getRequiredQualification(ASTContext &Context, const DeclContext *CurContext,
const DeclContext *TargetContext) { … }
static bool shouldIgnoreDueToReservedName(const NamedDecl *ND, Sema &SemaRef) { … }
bool ResultBuilder::isInterestingDecl(const NamedDecl *ND,
bool &AsNestedNameSpecifier) const { … }
bool ResultBuilder::CheckHiddenResult(Result &R, DeclContext *CurContext,
const NamedDecl *Hiding) { … }
SimplifiedTypeClass clang::getSimplifiedTypeClass(CanQualType T) { … }
QualType clang::getDeclUsageType(ASTContext &C, const NamedDecl *ND) { … }
unsigned ResultBuilder::getBasePriority(const NamedDecl *ND) { … }
void ResultBuilder::AdjustResultPriorityForDecl(Result &R) { … }
static DeclContext::lookup_result getConstructors(ASTContext &Context,
const CXXRecordDecl *Record) { … }
void ResultBuilder::MaybeAddConstructorResults(Result R) { … }
static bool isConstructor(const Decl *ND) { … }
void ResultBuilder::MaybeAddResult(Result R, DeclContext *CurContext) { … }
static void setInBaseClass(ResultBuilder::Result &R) { … }
enum class OverloadCompare { … };
static OverloadCompare compareOverloads(const CXXMethodDecl &Candidate,
const CXXMethodDecl &Incumbent,
const Qualifiers &ObjectQuals,
ExprValueKind ObjectKind) { … }
bool ResultBuilder::canCxxMethodBeCalled(const CXXMethodDecl *Method,
QualType BaseExprType) const { … }
bool ResultBuilder::canFunctionBeCalled(const NamedDecl *ND,
QualType BaseExprType) const { … }
void ResultBuilder::AddResult(Result R, DeclContext *CurContext,
NamedDecl *Hiding, bool InBaseClass = false,
QualType BaseExprType = QualType()) { … }
void ResultBuilder::AddResult(Result R) { … }
void ResultBuilder::EnterNewScope() { … }
void ResultBuilder::ExitScope() { … }
bool ResultBuilder::IsOrdinaryName(const NamedDecl *ND) const { … }
bool ResultBuilder::IsOrdinaryNonTypeName(const NamedDecl *ND) const { … }
bool ResultBuilder::IsIntegralConstantValue(const NamedDecl *ND) const { … }
bool ResultBuilder::IsOrdinaryNonValueName(const NamedDecl *ND) const { … }
bool ResultBuilder::IsNestedNameSpecifier(const NamedDecl *ND) const { … }
bool ResultBuilder::IsEnum(const NamedDecl *ND) const { … }
bool ResultBuilder::IsClassOrStruct(const NamedDecl *ND) const { … }
bool ResultBuilder::IsUnion(const NamedDecl *ND) const { … }
bool ResultBuilder::IsNamespace(const NamedDecl *ND) const { … }
bool ResultBuilder::IsNamespaceOrAlias(const NamedDecl *ND) const { … }
bool ResultBuilder::IsType(const NamedDecl *ND) const { … }
bool ResultBuilder::IsMember(const NamedDecl *ND) const { … }
static bool isObjCReceiverType(ASTContext &C, QualType T) { … }
bool ResultBuilder::IsObjCMessageReceiver(const NamedDecl *ND) const { … }
bool ResultBuilder::IsObjCMessageReceiverOrLambdaCapture(
const NamedDecl *ND) const { … }
bool ResultBuilder::IsObjCCollection(const NamedDecl *ND) const { … }
bool ResultBuilder::IsImpossibleToSatisfy(const NamedDecl *ND) const { … }
bool ResultBuilder::IsObjCIvar(const NamedDecl *ND) const { … }
namespace {
class CodeCompletionDeclConsumer : public VisibleDeclConsumer { … };
}
static void AddTypeSpecifierResults(const LangOptions &LangOpts,
ResultBuilder &Results) { … }
static void
AddStorageSpecifiers(SemaCodeCompletion::ParserCompletionContext CCC,
const LangOptions &LangOpts, ResultBuilder &Results) { … }
static void
AddFunctionSpecifiers(SemaCodeCompletion::ParserCompletionContext CCC,
const LangOptions &LangOpts, ResultBuilder &Results) { … }
static void AddObjCExpressionResults(ResultBuilder &Results, bool NeedAt);
static void AddObjCStatementResults(ResultBuilder &Results, bool NeedAt);
static void AddObjCVisibilityResults(const LangOptions &LangOpts,
ResultBuilder &Results, bool NeedAt);
static void AddObjCImplementationResults(const LangOptions &LangOpts,
ResultBuilder &Results, bool NeedAt);
static void AddObjCInterfaceResults(const LangOptions &LangOpts,
ResultBuilder &Results, bool NeedAt);
static void AddObjCTopLevelResults(ResultBuilder &Results, bool NeedAt);
static void AddTypedefResult(ResultBuilder &Results) { … }
static void AddUsingAliasResult(CodeCompletionBuilder &Builder,
ResultBuilder &Results) { … }
static bool WantTypesInContext(SemaCodeCompletion::ParserCompletionContext CCC,
const LangOptions &LangOpts) { … }
static PrintingPolicy getCompletionPrintingPolicy(const ASTContext &Context,
const Preprocessor &PP) { … }
static PrintingPolicy getCompletionPrintingPolicy(Sema &S) { … }
static const char *GetCompletionTypeString(QualType T, ASTContext &Context,
const PrintingPolicy &Policy,
CodeCompletionAllocator &Allocator) { … }
static void addThisCompletion(Sema &S, ResultBuilder &Results) { … }
static void AddStaticAssertResult(CodeCompletionBuilder &Builder,
ResultBuilder &Results,
const LangOptions &LangOpts) { … }
static void AddOverrideResults(ResultBuilder &Results,
const CodeCompletionContext &CCContext,
CodeCompletionBuilder &Builder) { … }
static void
AddOrdinaryNameResults(SemaCodeCompletion::ParserCompletionContext CCC,
Scope *S, Sema &SemaRef, ResultBuilder &Results) { … }
static void AddResultTypeChunk(ASTContext &Context,
const PrintingPolicy &Policy,
const NamedDecl *ND, QualType BaseType,
CodeCompletionBuilder &Result) { … }
static void MaybeAddSentinel(Preprocessor &PP,
const NamedDecl *FunctionOrMethod,
CodeCompletionBuilder &Result) { … }
static std::string formatObjCParamQualifiers(unsigned ObjCQuals,
QualType &Type) { … }
static void findTypeLocationForBlockDecl(const TypeSourceInfo *TSInfo,
FunctionTypeLoc &Block,
FunctionProtoTypeLoc &BlockProto,
bool SuppressBlock = false) { … }
static std::string formatBlockPlaceholder(
const PrintingPolicy &Policy, const NamedDecl *BlockDecl,
FunctionTypeLoc &Block, FunctionProtoTypeLoc &BlockProto,
bool SuppressBlockName = false, bool SuppressBlock = false,
std::optional<ArrayRef<QualType>> ObjCSubsts = std::nullopt);
static std::string FormatFunctionParameter(
const PrintingPolicy &Policy, const DeclaratorDecl *Param,
bool SuppressName = false, bool SuppressBlock = false,
std::optional<ArrayRef<QualType>> ObjCSubsts = std::nullopt) { … }
static std::string
formatBlockPlaceholder(const PrintingPolicy &Policy, const NamedDecl *BlockDecl,
FunctionTypeLoc &Block, FunctionProtoTypeLoc &BlockProto,
bool SuppressBlockName, bool SuppressBlock,
std::optional<ArrayRef<QualType>> ObjCSubsts) { … }
static std::string GetDefaultValueString(const ParmVarDecl *Param,
const SourceManager &SM,
const LangOptions &LangOpts) { … }
static void AddFunctionParameterChunks(Preprocessor &PP,
const PrintingPolicy &Policy,
const FunctionDecl *Function,
CodeCompletionBuilder &Result,
unsigned Start = 0,
bool InOptional = false) { … }
static void AddTemplateParameterChunks(
ASTContext &Context, const PrintingPolicy &Policy,
const TemplateDecl *Template, CodeCompletionBuilder &Result,
unsigned MaxParameters = 0, unsigned Start = 0, bool InDefaultArg = false) { … }
static void AddQualifierToCompletionString(CodeCompletionBuilder &Result,
NestedNameSpecifier *Qualifier,
bool QualifierIsInformative,
ASTContext &Context,
const PrintingPolicy &Policy) { … }
static void
AddFunctionTypeQualsToCompletionString(CodeCompletionBuilder &Result,
const FunctionDecl *Function) { … }
static void AddTypedNameChunk(ASTContext &Context, const PrintingPolicy &Policy,
const NamedDecl *ND,
CodeCompletionBuilder &Result) { … }
CodeCompletionString *CodeCompletionResult::CreateCodeCompletionString(
Sema &S, const CodeCompletionContext &CCContext,
CodeCompletionAllocator &Allocator, CodeCompletionTUInfo &CCTUInfo,
bool IncludeBriefComments) { … }
CodeCompletionString *CodeCompletionResult::CreateCodeCompletionStringForMacro(
Preprocessor &PP, CodeCompletionAllocator &Allocator,
CodeCompletionTUInfo &CCTUInfo) { … }
CodeCompletionString *CodeCompletionResult::CreateCodeCompletionString(
ASTContext &Ctx, Preprocessor &PP, const CodeCompletionContext &CCContext,
CodeCompletionAllocator &Allocator, CodeCompletionTUInfo &CCTUInfo,
bool IncludeBriefComments) { … }
static void printOverrideString(const CodeCompletionString &CCS,
std::string &BeforeName,
std::string &NameAndSignature) { … }
CodeCompletionString *
CodeCompletionResult::createCodeCompletionStringForOverride(
Preprocessor &PP, ASTContext &Ctx, CodeCompletionBuilder &Result,
bool IncludeBriefComments, const CodeCompletionContext &CCContext,
PrintingPolicy &Policy) { … }
static const NamedDecl *extractFunctorCallOperator(const NamedDecl *ND) { … }
CodeCompletionString *CodeCompletionResult::createCodeCompletionStringForDecl(
Preprocessor &PP, ASTContext &Ctx, CodeCompletionBuilder &Result,
bool IncludeBriefComments, const CodeCompletionContext &CCContext,
PrintingPolicy &Policy) { … }
const RawComment *clang::getCompletionComment(const ASTContext &Ctx,
const NamedDecl *ND) { … }
const RawComment *clang::getPatternCompletionComment(const ASTContext &Ctx,
const NamedDecl *ND) { … }
const RawComment *clang::getParameterComment(
const ASTContext &Ctx,
const CodeCompleteConsumer::OverloadCandidate &Result, unsigned ArgIndex) { … }
static void AddOverloadAggregateChunks(const RecordDecl *RD,
const PrintingPolicy &Policy,
CodeCompletionBuilder &Result,
unsigned CurrentArg) { … }
static void AddOverloadParameterChunks(
ASTContext &Context, const PrintingPolicy &Policy,
const FunctionDecl *Function, const FunctionProtoType *Prototype,
FunctionProtoTypeLoc PrototypeLoc, CodeCompletionBuilder &Result,
unsigned CurrentArg, unsigned Start = 0, bool InOptional = false) { … }
static std::string
formatTemplateParameterPlaceholder(const NamedDecl *Param, bool &Optional,
const PrintingPolicy &Policy) { … }
static std::string templateResultType(const TemplateDecl *TD,
const PrintingPolicy &Policy) { … }
static CodeCompletionString *createTemplateSignatureString(
const TemplateDecl *TD, CodeCompletionBuilder &Builder, unsigned CurrentArg,
const PrintingPolicy &Policy) { … }
CodeCompletionString *
CodeCompleteConsumer::OverloadCandidate::CreateSignatureString(
unsigned CurrentArg, Sema &S, CodeCompletionAllocator &Allocator,
CodeCompletionTUInfo &CCTUInfo, bool IncludeBriefComments,
bool Braced) const { … }
unsigned clang::getMacroUsagePriority(StringRef MacroName,
const LangOptions &LangOpts,
bool PreferredTypeIsPointer) { … }
CXCursorKind clang::getCursorKindForDecl(const Decl *D) { … }
static void AddMacroResults(Preprocessor &PP, ResultBuilder &Results,
bool LoadExternal, bool IncludeUndefined,
bool TargetTypeIsPointer = false) { … }
static void AddPrettyFunctionResults(const LangOptions &LangOpts,
ResultBuilder &Results) { … }
static void HandleCodeCompleteResults(Sema *S,
CodeCompleteConsumer *CodeCompleter,
const CodeCompletionContext &Context,
CodeCompletionResult *Results,
unsigned NumResults) { … }
static CodeCompletionContext
mapCodeCompletionContext(Sema &S,
SemaCodeCompletion::ParserCompletionContext PCC) { … }
static void MaybeAddOverrideCalls(Sema &S, DeclContext *InContext,
ResultBuilder &Results) { … }
void SemaCodeCompletion::CodeCompleteModuleImport(SourceLocation ImportLoc,
ModuleIdPath Path) { … }
void SemaCodeCompletion::CodeCompleteOrdinaryName(
Scope *S, SemaCodeCompletion::ParserCompletionContext CompletionContext) { … }
static void
AddClassMessageCompletions(Sema &SemaRef, Scope *S, ParsedType Receiver,
ArrayRef<const IdentifierInfo *> SelIdents,
bool AtArgumentExpression, bool IsSuper,
ResultBuilder &Results);
void SemaCodeCompletion::CodeCompleteDeclSpec(Scope *S, DeclSpec &DS,
bool AllowNonIdentifiers,
bool AllowNestedNameSpecifiers) { … }
static const char *underscoreAttrScope(llvm::StringRef Scope) { … }
static const char *noUnderscoreAttrScope(llvm::StringRef Scope) { … }
void SemaCodeCompletion::CodeCompleteAttribute(
AttributeCommonInfo::Syntax Syntax, AttributeCompletion Completion,
const IdentifierInfo *InScope) { … }
struct SemaCodeCompletion::CodeCompleteExpressionData { … };
namespace {
struct CoveredEnumerators { … };
}
static void AddEnumerators(ResultBuilder &Results, ASTContext &Context,
EnumDecl *Enum, DeclContext *CurContext,
const CoveredEnumerators &Enumerators) { … }
static const FunctionProtoType *TryDeconstructFunctionLike(QualType T) { … }
static void AddLambdaCompletion(ResultBuilder &Results,
llvm::ArrayRef<QualType> Parameters,
const LangOptions &LangOpts) { … }
void SemaCodeCompletion::CodeCompleteExpression(
Scope *S, const CodeCompleteExpressionData &Data) { … }
void SemaCodeCompletion::CodeCompleteExpression(Scope *S,
QualType PreferredType,
bool IsParenthesized) { … }
void SemaCodeCompletion::CodeCompletePostfixExpression(Scope *S, ExprResult E,
QualType PreferredType) { … }
AddedPropertiesSet;
static ObjCContainerDecl *getContainerDef(ObjCContainerDecl *Container) { … }
static void AddObjCBlockCall(ASTContext &Context, const PrintingPolicy &Policy,
CodeCompletionBuilder &Builder,
const NamedDecl *BD,
const FunctionTypeLoc &BlockLoc,
const FunctionProtoTypeLoc &BlockProtoLoc) { … }
static void
AddObjCProperties(const CodeCompletionContext &CCContext,
ObjCContainerDecl *Container, bool AllowCategories,
bool AllowNullaryMethods, DeclContext *CurContext,
AddedPropertiesSet &AddedProperties, ResultBuilder &Results,
bool IsBaseExprStatement = false,
bool IsClassProperty = false, bool InOriginalClass = true) { … }
static void
AddRecordMembersCompletionResults(Sema &SemaRef, ResultBuilder &Results,
Scope *S, QualType BaseType,
ExprValueKind BaseKind, RecordDecl *RD,
std::optional<FixItHint> AccessOpFixIt) { … }
static RecordDecl *getAsRecordDecl(QualType BaseType) { … }
namespace {
class ConceptInfo { … };
QualType getApproximateType(const Expr *E) { … }
Expr *unwrapParenList(Expr *Base) { … }
}
void SemaCodeCompletion::CodeCompleteMemberReferenceExpr(
Scope *S, Expr *Base, Expr *OtherOpBase, SourceLocation OpLoc, bool IsArrow,
bool IsBaseExprStatement, QualType PreferredType) { … }
void SemaCodeCompletion::CodeCompleteObjCClassPropertyRefExpr(
Scope *S, const IdentifierInfo &ClassName, SourceLocation ClassNameLoc,
bool IsBaseExprStatement) { … }
void SemaCodeCompletion::CodeCompleteTag(Scope *S, unsigned TagSpec) { … }
static void AddTypeQualifierResults(DeclSpec &DS, ResultBuilder &Results,
const LangOptions &LangOpts) { … }
void SemaCodeCompletion::CodeCompleteTypeQualifiers(DeclSpec &DS) { … }
void SemaCodeCompletion::CodeCompleteFunctionQualifiers(
DeclSpec &DS, Declarator &D, const VirtSpecifiers *VS) { … }
void SemaCodeCompletion::CodeCompleteBracketDeclarator(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteCase(Scope *S) { … }
static bool anyNullArguments(ArrayRef<Expr *> Args) { … }
ResultCandidate;
static void mergeCandidatesWithResults(
Sema &SemaRef, SmallVectorImpl<ResultCandidate> &Results,
OverloadCandidateSet &CandidateSet, SourceLocation Loc, size_t ArgSize) { … }
static QualType getParamType(Sema &SemaRef,
ArrayRef<ResultCandidate> Candidates, unsigned N) { … }
static QualType
ProduceSignatureHelp(Sema &SemaRef, MutableArrayRef<ResultCandidate> Candidates,
unsigned CurrentArg, SourceLocation OpenParLoc,
bool Braced) { … }
static FunctionProtoTypeLoc GetPrototypeLoc(Expr *Fn) { … }
QualType
SemaCodeCompletion::ProduceCallSignatureHelp(Expr *Fn, ArrayRef<Expr *> Args,
SourceLocation OpenParLoc) { … }
static std::optional<unsigned>
getNextAggregateIndexAfterDesignatedInit(const ResultCandidate &Aggregate,
ArrayRef<Expr *> Args) { … }
QualType SemaCodeCompletion::ProduceConstructorSignatureHelp(
QualType Type, SourceLocation Loc, ArrayRef<Expr *> Args,
SourceLocation OpenParLoc, bool Braced) { … }
QualType SemaCodeCompletion::ProduceCtorInitMemberSignatureHelp(
Decl *ConstructorDecl, CXXScopeSpec SS, ParsedType TemplateTypeTy,
ArrayRef<Expr *> ArgExprs, IdentifierInfo *II, SourceLocation OpenParLoc,
bool Braced) { … }
static bool argMatchesTemplateParams(const ParsedTemplateArgument &Arg,
unsigned Index,
const TemplateParameterList &Params) { … }
QualType SemaCodeCompletion::ProduceTemplateArgumentSignatureHelp(
TemplateTy ParsedTemplate, ArrayRef<ParsedTemplateArgument> Args,
SourceLocation LAngleLoc) { … }
static QualType getDesignatedType(QualType BaseType, const Designation &Desig) { … }
void SemaCodeCompletion::CodeCompleteDesignator(
QualType BaseType, llvm::ArrayRef<Expr *> InitExprs, const Designation &D) { … }
void SemaCodeCompletion::CodeCompleteInitializer(Scope *S, Decl *D) { … }
void SemaCodeCompletion::CodeCompleteAfterIf(Scope *S, bool IsBracedThen) { … }
void SemaCodeCompletion::CodeCompleteQualifiedId(Scope *S, CXXScopeSpec &SS,
bool EnteringContext,
bool IsUsingDeclaration,
QualType BaseType,
QualType PreferredType) { … }
void SemaCodeCompletion::CodeCompleteUsing(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteUsingDirective(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteNamespaceDecl(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteNamespaceAliasDecl(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteOperatorName(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteConstructorInitializer(
Decl *ConstructorD, ArrayRef<CXXCtorInitializer *> Initializers) { … }
static bool isNamespaceScope(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteLambdaIntroducer(Scope *S,
LambdaIntroducer &Intro,
bool AfterAmpersand) { … }
void SemaCodeCompletion::CodeCompleteAfterFunctionEquals(Declarator &D) { … }
#define OBJC_AT_KEYWORD_NAME(NeedAt, Keyword) …
static void AddObjCImplementationResults(const LangOptions &LangOpts,
ResultBuilder &Results, bool NeedAt) { … }
static void AddObjCInterfaceResults(const LangOptions &LangOpts,
ResultBuilder &Results, bool NeedAt) { … }
static void AddObjCTopLevelResults(ResultBuilder &Results, bool NeedAt) { … }
void SemaCodeCompletion::CodeCompleteObjCAtDirective(Scope *S) { … }
static void AddObjCExpressionResults(ResultBuilder &Results, bool NeedAt) { … }
static void AddObjCStatementResults(ResultBuilder &Results, bool NeedAt) { … }
static void AddObjCVisibilityResults(const LangOptions &LangOpts,
ResultBuilder &Results, bool NeedAt) { … }
void SemaCodeCompletion::CodeCompleteObjCAtVisibility(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteObjCAtStatement(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteObjCAtExpression(Scope *S) { … }
static bool ObjCPropertyFlagConflicts(unsigned Attributes, unsigned NewFlag) { … }
void SemaCodeCompletion::CodeCompleteObjCPropertyFlags(Scope *S,
ObjCDeclSpec &ODS) { … }
enum ObjCMethodKind { … };
static bool isAcceptableObjCSelector(Selector Sel, ObjCMethodKind WantKind,
ArrayRef<const IdentifierInfo *> SelIdents,
bool AllowSameLength = true) { … }
static bool isAcceptableObjCMethod(ObjCMethodDecl *Method,
ObjCMethodKind WantKind,
ArrayRef<const IdentifierInfo *> SelIdents,
bool AllowSameLength = true) { … }
VisitedSelectorSet;
static void AddObjCMethods(ObjCContainerDecl *Container,
bool WantInstanceMethods, ObjCMethodKind WantKind,
ArrayRef<const IdentifierInfo *> SelIdents,
DeclContext *CurContext,
VisitedSelectorSet &Selectors, bool AllowSameLength,
ResultBuilder &Results, bool InOriginalClass = true,
bool IsRootClass = false) { … }
void SemaCodeCompletion::CodeCompleteObjCPropertyGetter(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteObjCPropertySetter(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteObjCPassingType(Scope *S, ObjCDeclSpec &DS,
bool IsParameter) { … }
static ObjCInterfaceDecl *GetAssumedMessageSendExprType(Expr *E) { … }
static ObjCMethodDecl *
AddSuperSendCompletion(Sema &S, bool NeedSuperKeyword,
ArrayRef<const IdentifierInfo *> SelIdents,
ResultBuilder &Results) { … }
void SemaCodeCompletion::CodeCompleteObjCMessageReceiver(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteObjCSuperMessage(
Scope *S, SourceLocation SuperLoc,
ArrayRef<const IdentifierInfo *> SelIdents, bool AtArgumentExpression) { … }
static QualType getPreferredArgumentTypeForMessageSend(ResultBuilder &Results,
unsigned NumSelIdents) { … }
static void
AddClassMessageCompletions(Sema &SemaRef, Scope *S, ParsedType Receiver,
ArrayRef<const IdentifierInfo *> SelIdents,
bool AtArgumentExpression, bool IsSuper,
ResultBuilder &Results) { … }
void SemaCodeCompletion::CodeCompleteObjCClassMessage(
Scope *S, ParsedType Receiver, ArrayRef<const IdentifierInfo *> SelIdents,
bool AtArgumentExpression, bool IsSuper) { … }
void SemaCodeCompletion::CodeCompleteObjCInstanceMessage(
Scope *S, Expr *Receiver, ArrayRef<const IdentifierInfo *> SelIdents,
bool AtArgumentExpression, ObjCInterfaceDecl *Super) { … }
void SemaCodeCompletion::CodeCompleteObjCForCollection(
Scope *S, DeclGroupPtrTy IterationVar) { … }
void SemaCodeCompletion::CodeCompleteObjCSelector(
Scope *S, ArrayRef<const IdentifierInfo *> SelIdents) { … }
static void AddProtocolResults(DeclContext *Ctx, DeclContext *CurContext,
bool OnlyForwardDeclarations,
ResultBuilder &Results) { … }
void SemaCodeCompletion::CodeCompleteObjCProtocolReferences(
ArrayRef<IdentifierLocPair> Protocols) { … }
void SemaCodeCompletion::CodeCompleteObjCProtocolDecl(Scope *) { … }
static void AddInterfaceResults(DeclContext *Ctx, DeclContext *CurContext,
bool OnlyForwardDeclarations,
bool OnlyUnimplemented,
ResultBuilder &Results) { … }
void SemaCodeCompletion::CodeCompleteObjCInterfaceDecl(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteObjCClassForwardDecl(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteObjCSuperclass(
Scope *S, IdentifierInfo *ClassName, SourceLocation ClassNameLoc) { … }
void SemaCodeCompletion::CodeCompleteObjCImplementationDecl(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteObjCInterfaceCategory(
Scope *S, IdentifierInfo *ClassName, SourceLocation ClassNameLoc) { … }
void SemaCodeCompletion::CodeCompleteObjCImplementationCategory(
Scope *S, IdentifierInfo *ClassName, SourceLocation ClassNameLoc) { … }
void SemaCodeCompletion::CodeCompleteObjCPropertyDefinition(Scope *S) { … }
void SemaCodeCompletion::CodeCompleteObjCPropertySynthesizeIvar(
Scope *S, IdentifierInfo *PropertyName) { … }
KnownMethodsMap;
static void FindImplementableMethods(ASTContext &Context,
ObjCContainerDecl *Container,
std::optional<bool> WantInstanceMethods,
QualType ReturnType,
KnownMethodsMap &KnownMethods,
bool InOriginalClass = true) { … }
static void AddObjCPassingTypeChunk(QualType Type, unsigned ObjCDeclQuals,
ASTContext &Context,
const PrintingPolicy &Policy,
CodeCompletionBuilder &Builder) { … }
static bool InheritsFromClassNamed(ObjCInterfaceDecl *Class, StringRef Name) { … }
static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
bool IsInstanceMethod,
QualType ReturnType, ASTContext &Context,
VisitedSelectorSet &KnownSelectors,
ResultBuilder &Results) { … }
void SemaCodeCompletion::CodeCompleteObjCMethodDecl(
Scope *S, std::optional<bool> IsInstanceMethod, ParsedType ReturnTy) { … }
void SemaCodeCompletion::CodeCompleteObjCMethodDeclSelector(
Scope *S, bool IsInstanceMethod, bool AtParameterName, ParsedType ReturnTy,
ArrayRef<const IdentifierInfo *> SelIdents) { … }
void SemaCodeCompletion::CodeCompletePreprocessorDirective(bool InConditional) { … }
void SemaCodeCompletion::CodeCompleteInPreprocessorConditionalExclusion(
Scope *S) { … }
void SemaCodeCompletion::CodeCompletePreprocessorMacroName(bool IsDefinition) { … }
void SemaCodeCompletion::CodeCompletePreprocessorExpression() { … }
void SemaCodeCompletion::CodeCompletePreprocessorMacroArgument(
Scope *S, IdentifierInfo *Macro, MacroInfo *MacroInfo, unsigned Argument) { … }
void SemaCodeCompletion::CodeCompleteIncludedFile(llvm::StringRef Dir,
bool Angled) { … }
void SemaCodeCompletion::CodeCompleteNaturalLanguage() { … }
void SemaCodeCompletion::CodeCompleteAvailabilityPlatformName() { … }
void SemaCodeCompletion::GatherGlobalCodeCompletions(
CodeCompletionAllocator &Allocator, CodeCompletionTUInfo &CCTUInfo,
SmallVectorImpl<CodeCompletionResult> &Results) { … }
SemaCodeCompletion::SemaCodeCompletion(Sema &S,
CodeCompleteConsumer *CompletionConsumer)
: … { … }