clang 19.0.0git
Classes | Macros | Typedefs | Enumerations | Functions
SemaCodeComplete.cpp File Reference
#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/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/SemaInternal.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>
#include "clang/Basic/OperatorKinds.def"

Go to the source code of this file.

Classes

class  ResultBuilder::ShadowMapEntry::iterator
 
class  ResultBuilder::ShadowMapEntry::iterator::pointer
 
struct  clang::Sema::CodeCompleteExpressionData
 

Macros

#define OVERLOADED_OPERATOR(Name, Spelling, Token, Unary, Binary, MemberOnly)
 
#define OVERLOADED_OPERATOR_MULTI(Name, Spelling, Unary, Binary, MemberOnly)
 
#define OVERLOADED_OPERATOR(Name, Spelling, Token, Unary, Binary, MemberOnly)
 
#define OBJC_AT_KEYWORD_NAME(NeedAt, Keyword)   ((NeedAt) ? "@" Keyword : Keyword)
 Macro that optionally prepends an "@" to the string literal passed in via Keyword, depending on whether NeedAt is true or false.
 

Typedefs

typedef llvm::SmallPtrSet< IdentifierInfo *, 16 > AddedPropertiesSet
 The set of properties that have already been added, referenced by property name.
 
typedef CodeCompleteConsumer::OverloadCandidate ResultCandidate
 
typedef llvm::SmallPtrSet< Selector, 16 > VisitedSelectorSet
 A set of selectors, which is used to avoid introducing multiple completions with the same selector into the result set.
 
typedef llvm::DenseMap< Selector, llvm::PointerIntPair< ObjCMethodDecl *, 1, bool > > KnownMethodsMap
 

Enumerations

enum class  OverloadCompare { BothViable , Dominates , Dominated }
 
enum  ObjCMethodKind { MK_Any , MK_ZeroArgSelector , MK_OneArgSelector }
 Describes the kind of Objective-C method that we want to find via code completion. More...
 

Functions

static QualType getDesignatedType (QualType BaseType, const Designation &Desig)
 
static QualType getPreferredTypeOfBinaryRHS (Sema &S, Expr *LHS, tok::TokenKind Op)
 
static QualType getPreferredTypeOfUnaryArg (Sema &S, QualType ContextType, tok::TokenKind Op)
 Get preferred type for an argument of an unary expression.
 
static NestedNameSpecifiergetRequiredQualification (ASTContext &Context, const DeclContext *CurContext, const DeclContext *TargetContext)
 Compute the qualification required to get from the current context (CurContext) to the target context (TargetContext).
 
static bool shouldIgnoreDueToReservedName (const NamedDecl *ND, Sema &SemaRef)
 
static DeclContext::lookup_result getConstructors (ASTContext &Context, const CXXRecordDecl *Record)
 
static bool isConstructor (const Decl *ND)
 
static void setInBaseClass (ResultBuilder::Result &R)
 
static OverloadCompare compareOverloads (const CXXMethodDecl &Candidate, const CXXMethodDecl &Incumbent, const Qualifiers &ObjectQuals, ExprValueKind ObjectKind)
 
static bool isObjCReceiverType (ASTContext &C, QualType T)
 
static void AddTypeSpecifierResults (const LangOptions &LangOpts, ResultBuilder &Results)
 Add type specifiers for the current language as keyword results.
 
static void AddStorageSpecifiers (Sema::ParserCompletionContext CCC, const LangOptions &LangOpts, ResultBuilder &Results)
 
static void AddFunctionSpecifiers (Sema::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 (Sema::ParserCompletionContext CCC, const LangOptions &LangOpts)
 
static PrintingPolicy getCompletionPrintingPolicy (const ASTContext &Context, const Preprocessor &PP)
 
static PrintingPolicy getCompletionPrintingPolicy (Sema &S)
 Retrieve a printing policy suitable for code completion.
 
static const char * GetCompletionTypeString (QualType T, ASTContext &Context, const PrintingPolicy &Policy, CodeCompletionAllocator &Allocator)
 Retrieve the string representation of the given type as a string that has the appropriate lifetime for code completion.
 
static void addThisCompletion (Sema &S, ResultBuilder &Results)
 Add a completion for "this", if we're in a member function.
 
static void AddStaticAssertResult (CodeCompletionBuilder &Builder, ResultBuilder &Results, const LangOptions &LangOpts)
 
static void AddOverrideResults (ResultBuilder &Results, const CodeCompletionContext &CCContext, CodeCompletionBuilder &Builder)
 
static void AddOrdinaryNameResults (Sema::ParserCompletionContext CCC, Scope *S, Sema &SemaRef, ResultBuilder &Results)
 Add language constructs that show up for "ordinary" names.
 
static void AddResultTypeChunk (ASTContext &Context, const PrintingPolicy &Policy, const NamedDecl *ND, QualType BaseType, CodeCompletionBuilder &Result)
 If the given declaration has an associated type, add it as a result type chunk.
 
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)
 Tries to find the most appropriate type location for an Objective-C block placeholder.
 
static std::string formatBlockPlaceholder (const PrintingPolicy &Policy, const NamedDecl *BlockDecl, FunctionTypeLoc &Block, FunctionProtoTypeLoc &BlockProto, bool SuppressBlockName, bool SuppressBlock, std::optional< ArrayRef< QualType > > ObjCSubsts)
 Returns a placeholder string that corresponds to an Objective-C block declaration.
 
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 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)
 Add function parameter chunks to the given code completion string.
 
static void AddTemplateParameterChunks (ASTContext &Context, const PrintingPolicy &Policy, const TemplateDecl *Template, CodeCompletionBuilder &Result, unsigned MaxParameters=0, unsigned Start=0, bool InDefaultArg=false)
 Add template parameter chunks to the given code completion string.
 
static void AddQualifierToCompletionString (CodeCompletionBuilder &Result, NestedNameSpecifier *Qualifier, bool QualifierIsInformative, ASTContext &Context, const PrintingPolicy &Policy)
 Add a qualifier to the given code-completion string, if the provided nested-name-specifier is non-NULL.
 
static void AddFunctionTypeQualsToCompletionString (CodeCompletionBuilder &Result, const FunctionDecl *Function)
 
static void AddTypedNameChunk (ASTContext &Context, const PrintingPolicy &Policy, const NamedDecl *ND, CodeCompletionBuilder &Result)
 Add the name of the given declaration.
 
static void printOverrideString (const CodeCompletionString &CCS, std::string &BeforeName, std::string &NameAndSignature)
 
static const NamedDeclextractFunctorCallOperator (const NamedDecl *ND)
 
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)
 Add function overload parameter chunks to the given code completion string.
 
static std::string formatTemplateParameterPlaceholder (const NamedDecl *Param, bool &Optional, const PrintingPolicy &Policy)
 
static std::string templateResultType (const TemplateDecl *TD, const PrintingPolicy &Policy)
 
static CodeCompletionStringcreateTemplateSignatureString (const TemplateDecl *TD, CodeCompletionBuilder &Builder, unsigned CurrentArg, const PrintingPolicy &Policy)
 
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, Sema::ParserCompletionContext PCC)
 
static void MaybeAddOverrideCalls (Sema &S, DeclContext *InContext, ResultBuilder &Results)
 If we're in a C++ virtual member function, add completion results that invoke the functions we override, since it's common to invoke the overridden function as well as adding new functionality.
 
static void AddClassMessageCompletions (Sema &SemaRef, Scope *S, ParsedType Receiver, ArrayRef< IdentifierInfo * > SelIdents, bool AtArgumentExpression, bool IsSuper, ResultBuilder &Results)
 
static const char * underscoreAttrScope (llvm::StringRef Scope)
 
static const char * noUnderscoreAttrScope (llvm::StringRef Scope)
 
static void AddEnumerators (ResultBuilder &Results, ASTContext &Context, EnumDecl *Enum, DeclContext *CurContext, const CoveredEnumerators &Enumerators)
 
static const FunctionProtoTypeTryDeconstructFunctionLike (QualType T)
 Try to find a corresponding FunctionProtoType for function-like types (e.g.
 
static void AddLambdaCompletion (ResultBuilder &Results, llvm::ArrayRef< QualType > Parameters, const LangOptions &LangOpts)
 Adds a pattern completion for a lambda expression with the specified parameter types and placeholders for parameter names.
 
static ObjCContainerDeclgetContainerDef (ObjCContainerDecl *Container)
 Retrieve the container definition, if any?
 
static void AddObjCBlockCall (ASTContext &Context, const PrintingPolicy &Policy, CodeCompletionBuilder &Builder, const NamedDecl *BD, const FunctionTypeLoc &BlockLoc, const FunctionProtoTypeLoc &BlockProtoLoc)
 Adds a block invocation code completion result for the given block declaration BD.
 
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 RecordDeclgetAsRecordDecl (QualType BaseType)
 
static void AddTypeQualifierResults (DeclSpec &DS, ResultBuilder &Results, const LangOptions &LangOpts)
 
static bool anyNullArguments (ArrayRef< Expr * > Args)
 
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)
 Get the type of the Nth parameter from a given set of overload candidates.
 
static QualType ProduceSignatureHelp (Sema &SemaRef, MutableArrayRef< ResultCandidate > Candidates, unsigned CurrentArg, SourceLocation OpenParLoc, bool Braced)
 
static FunctionProtoTypeLoc GetPrototypeLoc (Expr *Fn)
 
static std::optional< unsignedgetNextAggregateIndexAfterDesignatedInit (const ResultCandidate &Aggregate, ArrayRef< Expr * > Args)
 
static bool argMatchesTemplateParams (const ParsedTemplateArgument &Arg, unsigned Index, const TemplateParameterList &Params)
 
static bool isNamespaceScope (Scope *S)
 Determine whether this scope denotes a namespace.
 
static bool ObjCPropertyFlagConflicts (unsigned Attributes, unsigned NewFlag)
 Determine whether the addition of the given flag to an Objective-C property's attributes will cause a conflict.
 
static bool isAcceptableObjCSelector (Selector Sel, ObjCMethodKind WantKind, ArrayRef< IdentifierInfo * > SelIdents, bool AllowSameLength=true)
 
static bool isAcceptableObjCMethod (ObjCMethodDecl *Method, ObjCMethodKind WantKind, ArrayRef< IdentifierInfo * > SelIdents, bool AllowSameLength=true)
 
static void AddObjCMethods (ObjCContainerDecl *Container, bool WantInstanceMethods, ObjCMethodKind WantKind, ArrayRef< IdentifierInfo * > SelIdents, DeclContext *CurContext, VisitedSelectorSet &Selectors, bool AllowSameLength, ResultBuilder &Results, bool InOriginalClass=true, bool IsRootClass=false)
 Add all of the Objective-C methods in the given Objective-C container to the set of results.
 
static ObjCInterfaceDeclGetAssumedMessageSendExprType (Expr *E)
 When we have an expression with type "id", we may assume that it has some more-specific class type based on knowledge of common uses of Objective-C.
 
static ObjCMethodDeclAddSuperSendCompletion (Sema &S, bool NeedSuperKeyword, ArrayRef< IdentifierInfo * > SelIdents, ResultBuilder &Results)
 
static QualType getPreferredArgumentTypeForMessageSend (ResultBuilder &Results, unsigned NumSelIdents)
 Given a set of code-completion results for the argument of a message send, determine the preferred type (if any) for that argument expression.
 
static void AddProtocolResults (DeclContext *Ctx, DeclContext *CurContext, bool OnlyForwardDeclarations, ResultBuilder &Results)
 Add all of the protocol declarations that we find in the given (translation unit) context.
 
static void AddInterfaceResults (DeclContext *Ctx, DeclContext *CurContext, bool OnlyForwardDeclarations, bool OnlyUnimplemented, ResultBuilder &Results)
 Add all of the Objective-C interface declarations that we find in the given (translation unit) context.
 
static void FindImplementableMethods (ASTContext &Context, ObjCContainerDecl *Container, std::optional< bool > WantInstanceMethods, QualType ReturnType, KnownMethodsMap &KnownMethods, bool InOriginalClass=true)
 Find all of the methods that reside in the given container (and its superclasses, protocols, etc.) that meet the given criteria.
 
static void AddObjCPassingTypeChunk (QualType Type, unsigned ObjCDeclQuals, ASTContext &Context, const PrintingPolicy &Policy, CodeCompletionBuilder &Builder)
 Add the parenthesized return or parameter type chunk to a code completion string.
 
static bool InheritsFromClassNamed (ObjCInterfaceDecl *Class, StringRef Name)
 Determine whether the given class is or inherits from a class by the given name.
 
static void AddObjCKeyValueCompletions (ObjCPropertyDecl *Property, bool IsInstanceMethod, QualType ReturnType, ASTContext &Context, VisitedSelectorSet &KnownSelectors, ResultBuilder &Results)
 Add code completions for Objective-C Key-Value Coding (KVC) and Key-Value Observing (KVO).
 

Macro Definition Documentation

◆ OBJC_AT_KEYWORD_NAME

#define OBJC_AT_KEYWORD_NAME (   NeedAt,
  Keyword 
)    ((NeedAt) ? "@" Keyword : Keyword)

Macro that optionally prepends an "@" to the string literal passed in via Keyword, depending on whether NeedAt is true or false.

Definition at line 7144 of file SemaCodeComplete.cpp.

◆ OVERLOADED_OPERATOR [1/2]

#define OVERLOADED_OPERATOR (   Name,
  Spelling,
  Token,
  Unary,
  Binary,
  MemberOnly 
)
Value:
case OO_##Name: \
OperatorName = "operator" Spelling; \
break;

◆ OVERLOADED_OPERATOR [2/2]

#define OVERLOADED_OPERATOR (   Name,
  Spelling,
  Token,
  Unary,
  Binary,
  MemberOnly 
)
Value:
if (OO_##Name != OO_Conditional) \
Results.AddResult(Result(Spelling));

◆ OVERLOADED_OPERATOR_MULTI

#define OVERLOADED_OPERATOR_MULTI (   Name,
  Spelling,
  Unary,
  Binary,
  MemberOnly 
)

Typedef Documentation

◆ AddedPropertiesSet

The set of properties that have already been added, referenced by property name.

Definition at line 4930 of file SemaCodeComplete.cpp.

◆ KnownMethodsMap

typedef llvm::DenseMap<Selector, llvm::PointerIntPair<ObjCMethodDecl *, 1, bool> > KnownMethodsMap

Definition at line 8836 of file SemaCodeComplete.cpp.

◆ ResultCandidate

Definition at line 6066 of file SemaCodeComplete.cpp.

◆ VisitedSelectorSet

A set of selectors, which is used to avoid introducing multiple completions with the same selector into the result set.

Definition at line 7560 of file SemaCodeComplete.cpp.

Enumeration Type Documentation

◆ ObjCMethodKind

Describes the kind of Objective-C method that we want to find via code completion.

Enumerator
MK_Any 

Any kind of method, provided it means other specified criteria.

MK_ZeroArgSelector 

Zero-argument (unary) selector.

MK_OneArgSelector 

One-argument selector.

Definition at line 7518 of file SemaCodeComplete.cpp.

◆ OverloadCompare

enum class OverloadCompare
strong
Enumerator
BothViable 
Dominates 
Dominated 

Definition at line 1239 of file SemaCodeComplete.cpp.

Function Documentation

◆ AddClassMessageCompletions()

static void AddClassMessageCompletions ( Sema SemaRef,
Scope S,
ParsedType  Receiver,
ArrayRef< IdentifierInfo * >  SelIdents,
bool  AtArgumentExpression,
bool  IsSuper,
ResultBuilder &  Results 
)
static

◆ AddEnumerators()

static void AddEnumerators ( ResultBuilder &  Results,
ASTContext Context,
EnumDecl Enum,
DeclContext CurContext,
const CoveredEnumerators &  Enumerators 
)
static

◆ AddFunctionParameterChunks()

static void AddFunctionParameterChunks ( Preprocessor PP,
const PrintingPolicy Policy,
const FunctionDecl Function,
CodeCompletionBuilder Result,
unsigned  Start = 0,
bool  InOptional = false 
)
static

◆ AddFunctionSpecifiers()

static void AddFunctionSpecifiers ( Sema::ParserCompletionContext  CCC,
const LangOptions LangOpts,
ResultBuilder &  Results 
)
static

◆ AddFunctionTypeQualsToCompletionString()

static void AddFunctionTypeQualsToCompletionString ( CodeCompletionBuilder Result,
const FunctionDecl Function 
)
static

◆ AddInterfaceResults()

static void AddInterfaceResults ( DeclContext Ctx,
DeclContext CurContext,
bool  OnlyForwardDeclarations,
bool  OnlyUnimplemented,
ResultBuilder &  Results 
)
static

Add all of the Objective-C interface declarations that we find in the given (translation unit) context.

Definition at line 8531 of file SemaCodeComplete.cpp.

References clang::Class, clang::DeclContext::decls(), and clang::Result.

Referenced by clang::Sema::CodeCompleteObjCClassForwardDecl(), clang::Sema::CodeCompleteObjCImplementationDecl(), clang::Sema::CodeCompleteObjCInterfaceDecl(), and clang::Sema::CodeCompleteObjCSuperclass().

◆ AddLambdaCompletion()

static void AddLambdaCompletion ( ResultBuilder &  Results,
llvm::ArrayRef< QualType Parameters,
const LangOptions LangOpts 
)
static

◆ AddMacroResults()

static void AddMacroResults ( Preprocessor PP,
ResultBuilder &  Results,
bool  LoadExternal,
bool  IncludeUndefined,
bool  TargetTypeIsPointer = false 
)
static

◆ AddObjCBlockCall()

static void AddObjCBlockCall ( ASTContext Context,
const PrintingPolicy Policy,
CodeCompletionBuilder Builder,
const NamedDecl BD,
const FunctionTypeLoc BlockLoc,
const FunctionProtoTypeLoc BlockProtoLoc 
)
static

◆ AddObjCExpressionResults()

static void AddObjCExpressionResults ( ResultBuilder &  Results,
bool  NeedAt 
)
static

◆ AddObjCImplementationResults()

static void AddObjCImplementationResults ( const LangOptions LangOpts,
ResultBuilder &  Results,
bool  NeedAt 
)
static

◆ AddObjCInterfaceResults()

static void AddObjCInterfaceResults ( const LangOptions LangOpts,
ResultBuilder &  Results,
bool  NeedAt 
)
static

◆ AddObjCKeyValueCompletions()

static void AddObjCKeyValueCompletions ( ObjCPropertyDecl Property,
bool  IsInstanceMethod,
QualType  ReturnType,
ASTContext Context,
VisitedSelectorSet KnownSelectors,
ResultBuilder &  Results 
)
static

◆ AddObjCMethods()

static void AddObjCMethods ( ObjCContainerDecl Container,
bool  WantInstanceMethods,
ObjCMethodKind  WantKind,
ArrayRef< IdentifierInfo * >  SelIdents,
DeclContext CurContext,
VisitedSelectorSet Selectors,
bool  AllowSameLength,
ResultBuilder &  Results,
bool  InOriginalClass = true,
bool  IsRootClass = false 
)
static

Add all of the Objective-C methods in the given Objective-C container to the set of results.

The container will be a class, protocol, category, or implementation of any of the above. This mether will recurse to include methods from the superclasses of classes along with their categories, protocols, and implementations.

Parameters
Containerthe container in which we'll look to find methods.
WantInstanceMethodsWhether to add instance methods (only); if false, this routine will add factory methods (only).
CurContextthe context in which we're performing the lookup that finds methods.
AllowSameLengthWhether we allow a method to be added to the list when it has the same number of parameters as we have selector identifiers.
Resultsthe structure into which we'll add results.

Definition at line 7582 of file SemaCodeComplete.cpp.

References AddObjCMethods(), clang::ObjCList< T >::begin(), clang::ObjCList< T >::end(), getContainerDef(), clang::ObjCInterfaceDecl::getImplementation(), clang::ObjCInterfaceDecl::getSuperClass(), clang::ObjCInterfaceDecl::hasDefinition(), isAcceptableObjCMethod(), clang::ObjCInterfaceDecl::known_categories(), MK_Any, clang::ObjCInterfaceDecl::protocols(), clang::Result, and setInBaseClass().

Referenced by AddClassMessageCompletions(), AddObjCMethods(), clang::Sema::CodeCompleteObjCInstanceMessage(), clang::Sema::CodeCompleteObjCPropertyGetter(), and clang::Sema::CodeCompleteObjCPropertySetter().

◆ AddObjCPassingTypeChunk()

static void AddObjCPassingTypeChunk ( QualType  Type,
unsigned  ObjCDeclQuals,
ASTContext Context,
const PrintingPolicy Policy,
CodeCompletionBuilder Builder 
)
static

Add the parenthesized return or parameter type chunk to a code completion string.

Definition at line 8928 of file SemaCodeComplete.cpp.

References clang::CodeCompletionString::CK_LeftParen, clang::CodeCompletionString::CK_RightParen, formatObjCParamQualifiers(), and GetCompletionTypeString().

Referenced by AddObjCKeyValueCompletions(), and clang::Sema::CodeCompleteObjCMethodDecl().

◆ AddObjCProperties()

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

◆ AddObjCStatementResults()

static void AddObjCStatementResults ( ResultBuilder &  Results,
bool  NeedAt 
)
static

◆ AddObjCTopLevelResults()

static void AddObjCTopLevelResults ( ResultBuilder &  Results,
bool  NeedAt 
)
static

◆ AddObjCVisibilityResults()

static void AddObjCVisibilityResults ( const LangOptions LangOpts,
ResultBuilder &  Results,
bool  NeedAt 
)
static

◆ AddOrdinaryNameResults()

static void AddOrdinaryNameResults ( Sema::ParserCompletionContext  CCC,
Scope S,
Sema SemaRef,
ResultBuilder &  Results 
)
static

Add language constructs that show up for "ordinary" names.

while (condition) { statements }

Definition at line 2132 of file SemaCodeComplete.cpp.

References AddFunctionSpecifiers(), AddObjCExpressionResults(), AddObjCImplementationResults(), AddObjCInterfaceResults(), AddObjCStatementResults(), AddObjCTopLevelResults(), AddObjCVisibilityResults(), AddOverrideResults(), AddStaticAssertResult(), AddStorageSpecifiers(), addThisCompletion(), AddTypedefResult(), AddTypeSpecifierResults(), AddUsingAliasResult(), clang::CodeCompletionContext::CCC_ClassStructUnion, clang::CodeCompletionString::CK_Colon, clang::CodeCompletionString::CK_Equal, clang::CodeCompletionString::CK_HorizontalSpace, clang::CodeCompletionString::CK_LeftAngle, clang::CodeCompletionString::CK_LeftBrace, clang::CodeCompletionString::CK_LeftBracket, clang::CodeCompletionString::CK_LeftParen, clang::CodeCompletionString::CK_RightAngle, clang::CodeCompletionString::CK_RightBrace, clang::CodeCompletionString::CK_RightBracket, clang::CodeCompletionString::CK_RightParen, clang::CodeCompletionString::CK_SemiColon, clang::CodeCompletionString::CK_VerticalSpace, clang::Sema::CurContext, clang::Function, clang::Sema::getCurBlock(), clang::Sema::getCurFunction(), clang::Sema::getCurMethodDecl(), clang::Sema::getLangOpts(), clang::FunctionDecl::getReturnType(), clang::Type::isBooleanType(), clang::DeclContext::isDependentContext(), clang::Preprocessor::isMacroDefined(), clang::Type::isMemberPointerType(), clang::QualType::isNull(), clang::Type::isPointerType(), clang::Type::isVoidType(), clang::Sema::PCC_Class, clang::Sema::PCC_Condition, clang::Sema::PCC_Expression, clang::Sema::PCC_ForInit, clang::Sema::PCC_LocalDeclarationSpecifiers, clang::Sema::PCC_MemberTemplate, clang::Sema::PCC_Namespace, clang::Sema::PCC_ObjCImplementation, clang::Sema::PCC_ObjCInstanceVariableList, clang::Sema::PCC_ObjCInterface, clang::Sema::PCC_ParenthesizedExpression, clang::Sema::PCC_RecoveryInFunction, clang::Sema::PCC_Statement, clang::Sema::PCC_Template, clang::Sema::PCC_TopLevelOrExpression, clang::Sema::PCC_Type, clang::Sema::PP, clang::Result, clang::sema::CapturingScopeInfo::ReturnType, clang::CodeCompletionResult::RK_Keyword, clang::sema::FunctionScopeInfo::SwitchStack, and WantTypesInContext().

Referenced by clang::Sema::CodeCompleteAfterIf(), clang::Sema::CodeCompleteExpression(), clang::Sema::CodeCompleteObjCPassingType(), and clang::Sema::CodeCompleteOrdinaryName().

◆ AddOverloadAggregateChunks()

static void AddOverloadAggregateChunks ( const RecordDecl RD,
const PrintingPolicy Policy,
CodeCompletionBuilder Result,
unsigned  CurrentArg 
)
static

◆ AddOverloadParameterChunks()

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

◆ AddOverrideResults()

static void AddOverrideResults ( ResultBuilder &  Results,
const CodeCompletionContext CCContext,
CodeCompletionBuilder Builder 
)
static

◆ AddPrettyFunctionResults()

static void AddPrettyFunctionResults ( const LangOptions LangOpts,
ResultBuilder &  Results 
)
static

◆ AddProtocolResults()

static void AddProtocolResults ( DeclContext Ctx,
DeclContext CurContext,
bool  OnlyForwardDeclarations,
ResultBuilder &  Results 
)
static

Add all of the protocol declarations that we find in the given (translation unit) context.

Definition at line 8468 of file SemaCodeComplete.cpp.

References clang::DeclContext::decls(), and clang::Result.

Referenced by clang::Sema::CodeCompleteObjCProtocolDecl(), and clang::Sema::CodeCompleteObjCProtocolReferences().

◆ AddQualifierToCompletionString()

static void AddQualifierToCompletionString ( CodeCompletionBuilder Result,
NestedNameSpecifier Qualifier,
bool  QualifierIsInformative,
ASTContext Context,
const PrintingPolicy Policy 
)
static

Add a qualifier to the given code-completion string, if the provided nested-name-specifier is non-NULL.

Definition at line 3244 of file SemaCodeComplete.cpp.

References clang::Result.

Referenced by clang::CodeCompletionResult::createCodeCompletionStringForDecl().

◆ AddRecordMembersCompletionResults()

static void AddRecordMembersCompletionResults ( Sema SemaRef,
ResultBuilder &  Results,
Scope S,
QualType  BaseType,
ExprValueKind  BaseKind,
RecordDecl RD,
std::optional< FixItHint AccessOpFixIt 
)
static

◆ AddResultTypeChunk()

static void AddResultTypeChunk ( ASTContext Context,
const PrintingPolicy Policy,
const NamedDecl ND,
QualType  BaseType,
CodeCompletionBuilder Result 
)
static

◆ AddStaticAssertResult()

static void AddStaticAssertResult ( CodeCompletionBuilder Builder,
ResultBuilder &  Results,
const LangOptions LangOpts 
)
static

◆ AddStorageSpecifiers()

static void AddStorageSpecifiers ( Sema::ParserCompletionContext  CCC,
const LangOptions LangOpts,
ResultBuilder &  Results 
)
static

◆ AddSuperSendCompletion()

static ObjCMethodDecl * AddSuperSendCompletion ( Sema S,
bool  NeedSuperKeyword,
ArrayRef< IdentifierInfo * >  SelIdents,
ResultBuilder &  Results 
)
static
Parameters
SThe semantic analysis object.
NeedSuperKeywordWhether we need to prefix this completion with the "super" keyword. Otherwise, we just need to provide the arguments.
SelIdentsThe identifiers in the selector that have already been provided as arguments for a send to "super".
ResultsThe set of results to augment.
Returns
the Objective-C method declaration that would be invoked by this "super" completion. If NULL, no completion was added.

Definition at line 7892 of file SemaCodeComplete.cpp.

References AddResultTypeChunk(), clang::CCP_SuperCompletion, clang::CodeCompletionString::CK_HorizontalSpace, clang::Class, clang::Sema::Context, clang::ObjCMethodDecl::getClassInterface(), getCompletionPrintingPolicy(), clang::Sema::getCurMethodDecl(), clang::Selector::getNameForSlot(), clang::Selector::getNumArgs(), clang::ObjCMethodDecl::getSelector(), clang::ASTContext::hasSameUnqualifiedType(), clang::ObjCMethodDecl::isInstanceMethod(), clang::Selector::isUnarySelector(), clang::ObjCMethodDecl::isVariadic(), clang::ObjCMethodDecl::param_begin(), clang::ObjCMethodDecl::param_end(), and clang::ObjCMethodDecl::param_size().

Referenced by AddClassMessageCompletions(), clang::Sema::CodeCompleteObjCInstanceMessage(), and clang::Sema::CodeCompleteObjCMessageReceiver().

◆ AddTemplateParameterChunks()

static void AddTemplateParameterChunks ( ASTContext Context,
const PrintingPolicy Policy,
const TemplateDecl Template,
CodeCompletionBuilder Result,
unsigned  MaxParameters = 0,
unsigned  Start = 0,
bool  InDefaultArg = false 
)
static

◆ addThisCompletion()

static void addThisCompletion ( Sema S,
ResultBuilder &  Results 
)
static

◆ AddTypedefResult()

static void AddTypedefResult ( ResultBuilder &  Results)
static

◆ AddTypedNameChunk()

static void AddTypedNameChunk ( ASTContext Context,
const PrintingPolicy Policy,
const NamedDecl ND,
CodeCompletionBuilder Result 
)
static

◆ AddTypeQualifierResults()

static void AddTypeQualifierResults ( DeclSpec DS,
ResultBuilder &  Results,
const LangOptions LangOpts 
)
static

◆ AddTypeSpecifierResults()

static void AddTypeSpecifierResults ( const LangOptions LangOpts,
ResultBuilder &  Results 
)
static

◆ AddUsingAliasResult()

static void AddUsingAliasResult ( CodeCompletionBuilder Builder,
ResultBuilder &  Results 
)
static

◆ anyNullArguments()

static bool anyNullArguments ( ArrayRef< Expr * >  Args)
static

Definition at line 6055 of file SemaCodeComplete.cpp.

Referenced by clang::Sema::ProduceCallSignatureHelp().

◆ argMatchesTemplateParams()

static bool argMatchesTemplateParams ( const ParsedTemplateArgument Arg,
unsigned  Index,
const TemplateParameterList Params 
)
static

◆ compareOverloads()

static OverloadCompare compareOverloads ( const CXXMethodDecl Candidate,
const CXXMethodDecl Incumbent,
const Qualifiers ObjectQuals,
ExprValueKind  ObjectKind 
)
static

◆ createTemplateSignatureString()

static CodeCompletionString * createTemplateSignatureString ( const TemplateDecl TD,
CodeCompletionBuilder Builder,
unsigned  CurrentArg,
const PrintingPolicy Policy 
)
static

◆ extractFunctorCallOperator()

static const NamedDecl * extractFunctorCallOperator ( const NamedDecl ND)
static

◆ FindImplementableMethods()

static void FindImplementableMethods ( ASTContext Context,
ObjCContainerDecl Container,
std::optional< bool WantInstanceMethods,
QualType  ReturnType,
KnownMethodsMap KnownMethods,
bool  InOriginalClass = true 
)
static

Find all of the methods that reside in the given container (and its superclasses, protocols, etc.) that meet the given criteria.

Insert those methods into the map of known methods, indexed by selector so they can be easily found.

Definition at line 8842 of file SemaCodeComplete.cpp.

References clang::ObjCList< T >::begin(), Category, clang::ObjCList< T >::end(), FindImplementableMethods(), clang::ASTContext::hasSameUnqualifiedType(), and clang::QualType::isNull().

Referenced by clang::Sema::CodeCompleteObjCMethodDecl(), and FindImplementableMethods().

◆ findTypeLocationForBlockDecl()

static void findTypeLocationForBlockDecl ( const TypeSourceInfo TSInfo,
FunctionTypeLoc Block,
FunctionProtoTypeLoc BlockProto,
bool  SuppressBlock = false 
)
static

Tries to find the most appropriate type location for an Objective-C block placeholder.

This function ignores things like typedefs and qualifiers in order to present the most relevant and accurate block placeholders in code completion results.

Definition at line 2879 of file SemaCodeComplete.cpp.

References clang::Block, clang::TypeLoc::getAs(), clang::TypeLoc::getAsAdjusted(), clang::TypeSourceInfo::getTypeLoc(), clang::TypeLoc::getUnqualifiedLoc(), and clang::TypeLoc::IgnoreParens().

Referenced by AddObjCProperties(), and FormatFunctionParameter().

◆ formatBlockPlaceholder()

static std::string formatBlockPlaceholder ( const PrintingPolicy Policy,
const NamedDecl BlockDecl,
FunctionTypeLoc Block,
FunctionProtoTypeLoc BlockProto,
bool  SuppressBlockName,
bool  SuppressBlock,
std::optional< ArrayRef< QualType > >  ObjCSubsts 
)
static

Returns a placeholder string that corresponds to an Objective-C block declaration.

Parameters
BlockDeclA declaration with an Objective-C block type.
BlockThe most relevant type location for that block type.
SuppressBlockNameDetermines whether or not the name of the block declaration is included in the resulting string.

Definition at line 3021 of file SemaCodeComplete.cpp.

References clang::Block, FormatFunctionParameter(), clang::QualType::getAsStringInternal(), clang::Decl::getASTContext(), clang::InheritingConcreteTypeLoc< Base, Derived, TypeClass >::getTypePtr(), clang::FunctionProtoType::isVariadic(), clang::Type::isVoidType(), clang::Result, and clang::QualType::substObjCTypeArgs().

Referenced by AddObjCProperties(), and FormatFunctionParameter().

◆ FormatFunctionParameter()

static std::string FormatFunctionParameter ( const PrintingPolicy Policy,
const DeclaratorDecl Param,
bool  SuppressName = false,
bool  SuppressBlock = false,
std::optional< ArrayRef< QualType > >  ObjCSubsts = std::nullopt 
)
static

◆ formatObjCParamQualifiers()

static std::string formatObjCParamQualifiers ( unsigned  ObjCQuals,
QualType Type 
)
static

◆ formatTemplateParameterPlaceholder()

static std::string formatTemplateParameterPlaceholder ( const NamedDecl Param,
bool Optional,
const PrintingPolicy Policy 
)
static

◆ getAsRecordDecl()

static RecordDecl * getAsRecordDecl ( QualType  BaseType)
static

◆ GetAssumedMessageSendExprType()

static ObjCInterfaceDecl * GetAssumedMessageSendExprType ( Expr E)
static

When we have an expression with type "id", we may assume that it has some more-specific class type based on knowledge of common uses of Objective-C.

This routine returns that class type, or NULL if no better result could be determined.

Definition at line 7808 of file SemaCodeComplete.cpp.

References clang::ObjCMessageExpr::Class, clang::Type::getAs(), clang::Selector::getIdentifierInfoForSlot(), clang::ObjCInterfaceDecl::getSuperClass(), Id, clang::ObjCMessageExpr::Instance, clang::ObjCMethodDecl::isInstanceMethod(), clang::Selector::isNull(), clang::ObjCMessageExpr::SuperClass, and clang::ObjCMessageExpr::SuperInstance.

Referenced by clang::Sema::CodeCompleteObjCInstanceMessage().

◆ getCompletionPrintingPolicy() [1/2]

static PrintingPolicy getCompletionPrintingPolicy ( const ASTContext Context,
const Preprocessor PP 
)
static

◆ getCompletionPrintingPolicy() [2/2]

static PrintingPolicy getCompletionPrintingPolicy ( Sema S)
static

Retrieve a printing policy suitable for code completion.

Definition at line 2004 of file SemaCodeComplete.cpp.

References clang::Sema::Context, getCompletionPrintingPolicy(), and clang::Sema::PP.

◆ GetCompletionTypeString()

static const char * GetCompletionTypeString ( QualType  T,
ASTContext Context,
const PrintingPolicy Policy,
CodeCompletionAllocator Allocator 
)
static

Retrieve the string representation of the given type as a string that has the appropriate lifetime for code completion.

This routine provides a fast path where we provide constant strings for common type names.

Definition at line 2013 of file SemaCodeComplete.cpp.

References clang::Class, clang::Enum, clang::QualType::getAsStringInternal(), clang::QualType::getLocalQualifiers(), clang::Interface, clang::Result, clang::Struct, and clang::Union.

Referenced by AddObjCBlockCall(), AddObjCKeyValueCompletions(), AddObjCPassingTypeChunk(), AddResultTypeChunk(), addThisCompletion(), and clang::Sema::CodeCompleteObjCPropertySynthesizeIvar().

◆ getConstructors()

static DeclContext::lookup_result getConstructors ( ASTContext Context,
const CXXRecordDecl Record 
)
static

◆ getContainerDef()

static ObjCContainerDecl * getContainerDef ( ObjCContainerDecl Container)
static

Retrieve the container definition, if any?

Definition at line 4933 of file SemaCodeComplete.cpp.

References clang::Interface.

Referenced by AddObjCMethods(), AddObjCProperties(), and clang::Sema::CodeCompleteObjCPropertyDefinition().

◆ GetDefaultValueString()

static std::string GetDefaultValueString ( const ParmVarDecl Param,
const SourceManager SM,
const LangOptions LangOpts 
)
static

◆ getDesignatedType()

static QualType getDesignatedType ( QualType  BaseType,
const Designation Desig 
)
static

◆ getNextAggregateIndexAfterDesignatedInit()

static std::optional< unsigned > getNextAggregateIndexAfterDesignatedInit ( const ResultCandidate Aggregate,
ArrayRef< Expr * >  Args 
)
static

◆ getParamType()

static QualType getParamType ( Sema SemaRef,
ArrayRef< ResultCandidate Candidates,
unsigned  N 
)
static

◆ getPreferredArgumentTypeForMessageSend()

static QualType getPreferredArgumentTypeForMessageSend ( ResultBuilder &  Results,
unsigned  NumSelIdents 
)
static

Given a set of code-completion results for the argument of a message send, determine the preferred type (if any) for that argument expression.

Definition at line 8093 of file SemaCodeComplete.cpp.

References clang::CCP_Unlikely, clang::ASTContext::hasSameUnqualifiedType(), clang::QualType::isNull(), clang::ObjCMethodDecl::parameters(), and clang::Result.

Referenced by clang::Sema::CodeCompleteObjCClassMessage(), and clang::Sema::CodeCompleteObjCInstanceMessage().

◆ getPreferredTypeOfBinaryRHS()

static QualType getPreferredTypeOfBinaryRHS ( Sema S,
Expr LHS,
tok::TokenKind  Op 
)
static

◆ getPreferredTypeOfUnaryArg()

static QualType getPreferredTypeOfUnaryArg ( Sema S,
QualType  ContextType,
tok::TokenKind  Op 
)
static

Get preferred type for an argument of an unary expression.

ContextType is preferred type of the whole unary expression.

Definition at line 547 of file SemaCodeComplete.cpp.

References clang::ASTContext::BoolTy, ContextType, clang::Sema::getASTContext(), clang::ASTContext::getPointerType(), and clang::ASTContext::IntTy.

Referenced by clang::PreferredTypeBuilder::enterUnary().

◆ GetPrototypeLoc()

static FunctionProtoTypeLoc GetPrototypeLoc ( Expr Fn)
static

◆ getRequiredQualification()

static NestedNameSpecifier * getRequiredQualification ( ASTContext Context,
const DeclContext CurContext,
const DeclContext TargetContext 
)
static

Compute the qualification required to get from the current context (CurContext) to the target context (TargetContext).

Parameters
Contextthe AST context in which the qualification will be used.
CurContextthe context where an entity is being named, which is typically based on the current scope.
TargetContextthe context in which the named entity actually resides.
Returns
a nested name specifier that refers into the target context, or NULL if no qualification is needed.

Definition at line 733 of file SemaCodeComplete.cpp.

References clang::NestedNameSpecifier::Create(), clang::DeclContext::Encloses(), clang::ASTContext::getTypeDeclType(), clang::QualType::getTypePtr(), Parent, and clang::Result.

Referenced by AddEnumerators(), and MaybeAddOverrideCalls().

◆ HandleCodeCompleteResults()

static void HandleCodeCompleteResults ( Sema S,
CodeCompleteConsumer CodeCompleter,
const CodeCompletionContext Context,
CodeCompletionResult Results,
unsigned  NumResults 
)
static

Definition at line 4233 of file SemaCodeComplete.cpp.

References clang::CodeCompleteConsumer::ProcessCodeCompleteResults().

Referenced by clang::Sema::CodeCompleteAfterFunctionEquals(), clang::Sema::CodeCompleteAfterIf(), clang::Sema::CodeCompleteAttribute(), clang::Sema::CodeCompleteAvailabilityPlatformName(), clang::Sema::CodeCompleteCase(), clang::Sema::CodeCompleteConstructorInitializer(), clang::Sema::CodeCompleteDeclSpec(), clang::Sema::CodeCompleteDesignator(), clang::Sema::CodeCompleteExpression(), clang::Sema::CodeCompleteFunctionQualifiers(), clang::Sema::CodeCompleteIncludedFile(), clang::Sema::CodeCompleteLambdaIntroducer(), clang::Sema::CodeCompleteMemberReferenceExpr(), clang::Sema::CodeCompleteModuleImport(), clang::Sema::CodeCompleteNamespaceAliasDecl(), clang::Sema::CodeCompleteNamespaceDecl(), clang::Sema::CodeCompleteNaturalLanguage(), clang::Sema::CodeCompleteObjCAtDirective(), clang::Sema::CodeCompleteObjCAtExpression(), clang::Sema::CodeCompleteObjCAtStatement(), clang::Sema::CodeCompleteObjCAtVisibility(), clang::Sema::CodeCompleteObjCClassForwardDecl(), clang::Sema::CodeCompleteObjCClassMessage(), clang::Sema::CodeCompleteObjCClassPropertyRefExpr(), clang::Sema::CodeCompleteObjCImplementationCategory(), clang::Sema::CodeCompleteObjCImplementationDecl(), clang::Sema::CodeCompleteObjCInstanceMessage(), clang::Sema::CodeCompleteObjCInterfaceCategory(), clang::Sema::CodeCompleteObjCInterfaceDecl(), clang::Sema::CodeCompleteObjCMessageReceiver(), clang::Sema::CodeCompleteObjCMethodDecl(), clang::Sema::CodeCompleteObjCMethodDeclSelector(), clang::Sema::CodeCompleteObjCPassingType(), clang::Sema::CodeCompleteObjCPropertyDefinition(), clang::Sema::CodeCompleteObjCPropertyFlags(), clang::Sema::CodeCompleteObjCPropertyGetter(), clang::Sema::CodeCompleteObjCPropertySetter(), clang::Sema::CodeCompleteObjCPropertySynthesizeIvar(), clang::Sema::CodeCompleteObjCProtocolDecl(), clang::Sema::CodeCompleteObjCProtocolReferences(), clang::Sema::CodeCompleteObjCSelector(), clang::Sema::CodeCompleteObjCSuperclass(), clang::Sema::CodeCompleteOperatorName(), clang::Sema::CodeCompleteOrdinaryName(), clang::Sema::CodeCompletePreprocessorDirective(), clang::Sema::CodeCompletePreprocessorExpression(), clang::Sema::CodeCompletePreprocessorMacroName(), clang::Sema::CodeCompleteQualifiedId(), clang::Sema::CodeCompleteTag(), clang::Sema::CodeCompleteTypeQualifiers(), clang::Sema::CodeCompleteUsing(), and clang::Sema::CodeCompleteUsingDirective().

◆ InheritsFromClassNamed()

static bool InheritsFromClassNamed ( ObjCInterfaceDecl Class,
StringRef  Name 
)
static

Determine whether the given class is or inherits from a class by the given name.

Definition at line 8943 of file SemaCodeComplete.cpp.

References clang::Class, and InheritsFromClassNamed().

Referenced by AddObjCKeyValueCompletions(), and InheritsFromClassNamed().

◆ isAcceptableObjCMethod()

static bool isAcceptableObjCMethod ( ObjCMethodDecl Method,
ObjCMethodKind  WantKind,
ArrayRef< IdentifierInfo * >  SelIdents,
bool  AllowSameLength = true 
)
static

◆ isAcceptableObjCSelector()

static bool isAcceptableObjCSelector ( Selector  Sel,
ObjCMethodKind  WantKind,
ArrayRef< IdentifierInfo * >  SelIdents,
bool  AllowSameLength = true 
)
static

◆ isConstructor()

static bool isConstructor ( const Decl ND)
static

Definition at line 1106 of file SemaCodeComplete.cpp.

Referenced by AddResultTypeChunk().

◆ isNamespaceScope()

static bool isNamespaceScope ( Scope S)
static

Determine whether this scope denotes a namespace.

Definition at line 7045 of file SemaCodeComplete.cpp.

References clang::DeclContext::isFileContext().

Referenced by clang::Sema::CodeCompleteLambdaIntroducer().

◆ isObjCReceiverType()

static bool isObjCReceiverType ( ASTContext C,
QualType  T 
)
static

◆ mapCodeCompletionContext()

static CodeCompletionContext mapCodeCompletionContext ( Sema S,
Sema::ParserCompletionContext  PCC 
)
static

◆ MaybeAddOverrideCalls()

static void MaybeAddOverrideCalls ( Sema S,
DeclContext InContext,
ResultBuilder &  Results 
)
static

If we're in a C++ virtual member function, add completion results that invoke the functions we override, since it's common to invoke the overridden function as well as adding new functionality.

Parameters
SThe semantic analysis object for which we are generating results.
InContextThis context in which the nested-name-specifier preceding the code-completion point

Definition at line 4310 of file SemaCodeComplete.cpp.

References clang::CCP_SuperCompletion, clang::CodeCompletionString::CK_Comma, clang::CodeCompletionString::CK_LeftParen, clang::CodeCompletionString::CK_RightParen, clang::Sema::Context, clang::Sema::CurContext, CXAvailability_Available, CXCursor_CXXMethod, clang::DeclContext::Equals(), clang::CXXMethodDecl::getCanonicalDecl(), getCompletionPrintingPolicy(), clang::DeclContext::getParent(), getRequiredQualification(), clang::CXXMethodDecl::isVirtual(), clang::CXXMethodDecl::overridden_methods(), P, clang::FunctionDecl::parameters(), and clang::NestedNameSpecifier::print().

Referenced by clang::Sema::CodeCompleteOrdinaryName(), and clang::Sema::CodeCompleteQualifiedId().

◆ MaybeAddSentinel()

static void MaybeAddSentinel ( Preprocessor PP,
const NamedDecl FunctionOrMethod,
CodeCompletionBuilder Result 
)
static

◆ mergeCandidatesWithResults()

static void mergeCandidatesWithResults ( Sema SemaRef,
SmallVectorImpl< ResultCandidate > &  Results,
OverloadCandidateSet CandidateSet,
SourceLocation  Loc,
size_t  ArgSize 
)
static

◆ noUnderscoreAttrScope()

static const char * noUnderscoreAttrScope ( llvm::StringRef  Scope)
static

Definition at line 4586 of file SemaCodeComplete.cpp.

Referenced by clang::Sema::CodeCompleteAttribute().

◆ ObjCPropertyFlagConflicts()

static bool ObjCPropertyFlagConflicts ( unsigned  Attributes,
unsigned  NewFlag 
)
static

◆ printOverrideString()

static void printOverrideString ( const CodeCompletionString CCS,
std::string &  BeforeName,
std::string &  NameAndSignature 
)
static

◆ ProduceSignatureHelp()

static QualType ProduceSignatureHelp ( Sema SemaRef,
MutableArrayRef< ResultCandidate Candidates,
unsigned  CurrentArg,
SourceLocation  OpenParLoc,
bool  Braced 
)
static

◆ setInBaseClass()

static void setInBaseClass ( ResultBuilder::Result R)
static

◆ shouldIgnoreDueToReservedName()

static bool shouldIgnoreDueToReservedName ( const NamedDecl ND,
Sema SemaRef 
)
static

◆ templateResultType()

static std::string templateResultType ( const TemplateDecl TD,
const PrintingPolicy Policy 
)
static

Definition at line 3931 of file SemaCodeComplete.cpp.

Referenced by createTemplateSignatureString().

◆ TryDeconstructFunctionLike()

static const FunctionProtoType * TryDeconstructFunctionLike ( QualType  T)
static

Try to find a corresponding FunctionProtoType for function-like types (e.g.

function pointers, std::function, etc).

Definition at line 4775 of file SemaCodeComplete.cpp.

References clang::Type::getAs(), clang::TemplateArgument::getAsType(), clang::TemplateArgument::getKind(), clang::Type::getPointeeType(), clang::QualType::isNull(), clang::Type::isPointerType(), clang::Specialization, and clang::TemplateArgument::Type.

Referenced by clang::Sema::CodeCompleteExpression().

◆ underscoreAttrScope()

static const char * underscoreAttrScope ( llvm::StringRef  Scope)
static

Definition at line 4578 of file SemaCodeComplete.cpp.

Referenced by clang::Sema::CodeCompleteAttribute().

◆ WantTypesInContext()

static bool WantTypesInContext ( Sema::ParserCompletionContext  CCC,
const LangOptions LangOpts 
)
static