clang
9.0.0
|
#include "clang/AST/Decl.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/QualTypeNames.h"
#include "clang/AST/Type.h"
#include "clang/Basic/CharInfo.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/Lookup.h"
#include "clang/Sema/Overload.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/SemaInternal.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/Path.h"
#include <list>
#include <map>
#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. More... | |
Typedefs | |
typedef llvm::SmallPtrSet< IdentifierInfo *, 16 > | AddedPropertiesSet |
The set of properties that have already been added, referenced by property name. More... | |
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. More... | |
typedef llvm::DenseMap< Selector, llvm::PointerIntPair< ObjCMethodDecl *, 1, bool > > | KnownMethodsMap |
Enumerations | |
enum | OverloadCompare { OverloadCompare::BothViable, OverloadCompare::Dominates, OverloadCompare::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 | 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. More... | |
static NestedNameSpecifier * | getRequiredQualification (ASTContext &Context, const DeclContext *CurContext, const DeclContext *TargetContext) |
Compute the qualification required to get from the current context (CurContext ) to the target context (TargetContext ). More... | |
static bool | isReservedName (const IdentifierInfo *Id, bool doubleUnderscoreOnly=false) |
Determine whether Id is a name reserved for the implementation (C99 7.1.3, C++ [lib.global.names]). More... | |
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. More... | |
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 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. More... | |
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. More... | |
static void | addThisCompletion (Sema &S, ResultBuilder &Results) |
Add a completion for "this", if we're in a member function. More... | |
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. More... | |
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. More... | |
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. More... | |
static std::string | formatBlockPlaceholder (const PrintingPolicy &Policy, const NamedDecl *BlockDecl, FunctionTypeLoc &Block, FunctionProtoTypeLoc &BlockProto, bool SuppressBlockName, bool SuppressBlock, Optional< ArrayRef< QualType >> ObjCSubsts) |
Returns a placeholder string that corresponds to an Objective-C block declaration. More... | |
static std::string | FormatFunctionParameter (const PrintingPolicy &Policy, const ParmVarDecl *Param, bool SuppressName=false, bool SuppressBlock=false, Optional< ArrayRef< QualType >> ObjCSubsts=None) |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
static void | printOverrideString (const CodeCompletionString &CCS, std::string &BeforeName, std::string &NameAndSignature) |
static void | AddOverloadParameterChunks (ASTContext &Context, const PrintingPolicy &Policy, const FunctionDecl *Function, const FunctionProtoType *Prototype, CodeCompletionBuilder &Result, unsigned CurrentArg, unsigned Start=0, bool InOptional=false) |
Add function overload parameter chunks to the given code completion string. More... | |
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, 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. More... | |
static void | AddClassMessageCompletions (Sema &SemaRef, Scope *S, ParsedType Receiver, ArrayRef< IdentifierInfo *> SelIdents, bool AtArgumentExpression, bool IsSuper, ResultBuilder &Results) |
static void | AddEnumerators (ResultBuilder &Results, ASTContext &Context, EnumDecl *Enum, DeclContext *CurContext, const CoveredEnumerators &Enumerators) |
static const FunctionProtoType * | TryDeconstructFunctionLike (QualType T) |
Try to find a corresponding FunctionProtoType for function-like types (e.g. More... | |
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. More... | |
static ObjCContainerDecl * | getContainerDef (ObjCContainerDecl *Container) |
Retrieve the container definition, if any? More... | |
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 . More... | |
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, Optional< FixItHint > AccessOpFixIt) |
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) |
static QualType | getParamType (Sema &SemaRef, ArrayRef< ResultCandidate > Candidates, unsigned N) |
Get the type of the Nth parameter from a given set of overload candidates. More... | |
static QualType | ProduceSignatureHelp (Sema &SemaRef, Scope *S, MutableArrayRef< ResultCandidate > Candidates, unsigned CurrentArg, SourceLocation OpenParLoc) |
static bool | isNamespaceScope (Scope *S) |
Determine whether this scope denotes a namespace. More... | |
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. More... | |
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. More... | |
static ObjCInterfaceDecl * | GetAssumedMessageSendExprType (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. More... | |
static ObjCMethodDecl * | AddSuperSendCompletion (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. More... | |
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. More... | |
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. More... | |
static void | FindImplementableMethods (ASTContext &Context, ObjCContainerDecl *Container, 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. More... | |
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. More... | |
static bool | InheritsFromClassNamed (ObjCInterfaceDecl *Class, StringRef Name) |
Determine whether the given class is or inherits from a class by the given name. More... | |
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). More... | |
#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 5761 of file SemaCodeComplete.cpp.
Referenced by AddObjCImplementationResults(), AddObjCInterfaceResults(), and AddObjCVisibilityResults().
#define OVERLOADED_OPERATOR | ( | Name, | |
Spelling, | |||
Token, | |||
Unary, | |||
Binary, | |||
MemberOnly | |||
) |
#define OVERLOADED_OPERATOR | ( | Name, | |
Spelling, | |||
Token, | |||
Unary, | |||
Binary, | |||
MemberOnly | |||
) |
#define OVERLOADED_OPERATOR_MULTI | ( | Name, | |
Spelling, | |||
Unary, | |||
Binary, | |||
MemberOnly | |||
) |
typedef llvm::SmallPtrSet<IdentifierInfo *, 16> AddedPropertiesSet |
The set of properties that have already been added, referenced by property name.
Definition at line 4415 of file SemaCodeComplete.cpp.
typedef llvm::DenseMap<Selector, llvm::PointerIntPair<ObjCMethodDecl *, 1, bool> > KnownMethodsMap |
Definition at line 7419 of file SemaCodeComplete.cpp.
Definition at line 5043 of file SemaCodeComplete.cpp.
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.
Definition at line 6164 of file SemaCodeComplete.cpp.
enum 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 6122 of file SemaCodeComplete.cpp.
|
strong |
Enumerator | |
---|---|
BothViable | |
Dominates | |
Dominated |
Definition at line 1179 of file SemaCodeComplete.cpp.
|
static |
Definition at line 6726 of file SemaCodeComplete.cpp.
References AddObjCMethods(), AddSuperSendCompletion(), clang::Sema::CurContext, clang::Type::getAs(), clang::Sema::getCurMethodDecl(), clang::ExternalASTSource::GetExternalSelector(), clang::Sema::getExternalSource(), clang::ObjCMethodList::getMethod(), clang::ExternalASTSource::GetNumExternalSelectors(), clang::Sema::GetTypeFromParser(), isAcceptableObjCMethod(), clang::QualType::isNull(), clang::Selector::isNull(), clang::Sema::MethodPool, MK_Any, and clang::Sema::ReadMethodPool().
|
static |
Definition at line 4236 of file SemaCodeComplete.cpp.
|
static |
Add function parameter chunks to the given code completion string.
Definition at line 2916 of file SemaCodeComplete.cpp.
References clang::CodeCompletionBuilder::AddChunk(), clang::CodeCompletionBuilder::AddOptionalChunk(), clang::CodeCompletionBuilder::AddPlaceholderChunk(), clang::CodeCompletionString::CK_Comma, clang::CodeCompletionAllocator::CopyString(), FormatFunctionParameter(), clang::CodeCompletionBuilder::getAllocator(), clang::Type::getAs(), clang::CodeCompletionBuilder::getCodeCompletionTUInfo(), GetDefaultValueString(), clang::Preprocessor::getLangOpts(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::Preprocessor::getSourceManager(), clang::ValueDecl::getType(), clang::ParmVarDecl::hasDefaultArg(), clang::FunctionDecl::isVariadic(), MaybeAddSentinel(), and P.
Referenced by clang::CodeCompletionResult::createCodeCompletionStringForDecl().
|
static |
Definition at line 1761 of file SemaCodeComplete.cpp.
References AddObjCExpressionResults(), AddObjCImplementationResults(), AddObjCInterfaceResults(), AddObjCStatementResults(), AddObjCTopLevelResults(), AddObjCVisibilityResults(), 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, and clang::Sema::PCC_Type.
|
static |
Definition at line 3069 of file SemaCodeComplete.cpp.
References clang::CodeCompletionBuilder::AddInformativeChunk(), clang::CodeCompletionAllocator::CopyString(), clang::CodeCompletionBuilder::getAllocator(), clang::Type::getAs(), and clang::ValueDecl::getType().
Referenced by clang::CodeCompletionResult::createCodeCompletionStringForDecl().
|
static |
Add all of the Objective-C interface declarations that we find in the given (translation unit) context.
Definition at line 7132 of file SemaCodeComplete.cpp.
References clang::DeclContext::decls().
|
static |
Adds a pattern completion for a lambda expression with the specified parameter types and placeholders for parameter names.
Definition at line 4281 of file SemaCodeComplete.cpp.
References clang::CodeCompletionBuilder::AddChunk(), clang::CodeCompletionString::CK_HorizontalSpace, clang::CodeCompletionString::CK_LeftBrace, clang::CodeCompletionString::CK_LeftBracket, clang::CodeCompletionString::CK_LeftParen, clang::CodeCompletionString::CK_RightBrace, clang::CodeCompletionString::CK_RightBracket, clang::CodeCompletionString::CK_RightParen, clang::First, and clang::Parameter.
|
static |
|
static |
Adds a block invocation code completion result for the given block declaration BD
.
Definition at line 4437 of file SemaCodeComplete.cpp.
|
static |
Definition at line 5872 of file SemaCodeComplete.cpp.
Referenced by AddFunctionSpecifiers().
|
static |
Definition at line 5763 of file SemaCodeComplete.cpp.
References OBJC_AT_KEYWORD_NAME.
Referenced by AddFunctionSpecifiers().
|
static |
Definition at line 5786 of file SemaCodeComplete.cpp.
References OBJC_AT_KEYWORD_NAME.
Referenced by AddFunctionSpecifiers().
|
static |
Add code completions for Objective-C Key-Value Coding (KVC) and Key-Value Observing (KVO).
Definition at line 7538 of file SemaCodeComplete.cpp.
|
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.
Container | the container in which we'll look to find methods. |
WantInstanceMethods | Whether to add instance methods (only); if false, this routine will add factory methods (only). |
CurContext | the context in which we're performing the lookup that finds methods. |
AllowSameLength | Whether we allow a method to be added to the list when it has the same number of parameters as we have selector identifiers. |
Results | the structure into which we'll add results. |
Definition at line 6186 of file SemaCodeComplete.cpp.
Referenced by AddClassMessageCompletions().
|
static |
Add the parenthesized return or parameter type chunk to a code completion string.
Definition at line 7511 of file SemaCodeComplete.cpp.
|
static |
Definition at line 4474 of file SemaCodeComplete.cpp.
|
static |
Definition at line 5937 of file SemaCodeComplete.cpp.
Referenced by AddFunctionSpecifiers().
|
static |
Definition at line 5805 of file SemaCodeComplete.cpp.
Referenced by AddFunctionSpecifiers().
|
static |
Definition at line 5983 of file SemaCodeComplete.cpp.
References OBJC_AT_KEYWORD_NAME.
Referenced by AddFunctionSpecifiers().
|
static |
Add language constructs that show up for "ordinary" names.
while (condition) { statements }
Definition at line 1988 of file SemaCodeComplete.cpp.
|
static |
Add function overload parameter chunks to the given code completion string.
Definition at line 3581 of file SemaCodeComplete.cpp.
|
static |
Definition at line 1933 of file SemaCodeComplete.cpp.
|
static |
Definition at line 3859 of file SemaCodeComplete.cpp.
References clang::CCP_Constant.
|
static |
Add all of the protocol declarations that we find in the given (translation unit) context.
Definition at line 7069 of file SemaCodeComplete.cpp.
References clang::DeclContext::decls().
|
static |
Add a qualifier to the given code-completion string, if the provided nested-name-specifier is non-NULL.
Definition at line 3049 of file SemaCodeComplete.cpp.
Referenced by clang::CodeCompletionResult::createCodeCompletionStringForDecl().
|
static |
Definition at line 4654 of file SemaCodeComplete.cpp.
References clang::Sema::CodeCompleter, clang::Sema::getLangOpts(), clang::Scope::getParent(), clang::QualType::getQualifiers(), clang::CodeCompleteConsumer::includeGlobals(), clang::Type::isDependentType(), clang::CodeCompleteConsumer::loadExternal(), clang::Sema::LookupMemberName, and clang::Sema::LookupVisibleDecls().
|
static |
If the given declaration has an associated type, add it as a result type chunk.
Definition at line 2586 of file SemaCodeComplete.cpp.
Referenced by clang::CodeCompletionResult::createCodeCompletionStringForDecl(), and clang::CodeCompletionBuilder::getCodeCompletionTUInfo().
|
static |
Definition at line 1917 of file SemaCodeComplete.cpp.
|
static |
Definition at line 1735 of file SemaCodeComplete.cpp.
|
static |
S | The semantic analysis object. |
NeedSuperKeyword | Whether we need to prefix this completion with the "super" keyword. Otherwise, we just need to provide the arguments. |
SelIdents | The identifiers in the selector that have already been provided as arguments for a send to "super". |
Results | The set of results to augment. |
Definition at line 6494 of file SemaCodeComplete.cpp.
References clang::Sema::Context, clang::ObjCMethodDecl::getClassInterface(), clang::Sema::getCurMethodDecl(), clang::ObjCContainerDecl::getMethod(), clang::ObjCMethodDecl::getSelector(), clang::ObjCInterfaceDecl::getSuperClass(), clang::ASTContext::hasSameUnqualifiedType(), clang::ObjCMethodDecl::isInstanceMethod(), clang::ObjCMethodDecl::isVariadic(), clang::ObjCInterfaceDecl::known_categories(), clang::ObjCMethodDecl::param_begin(), clang::ObjCMethodDecl::param_end(), and clang::ObjCMethodDecl::param_size().
Referenced by AddClassMessageCompletions().
|
static |
Add template parameter chunks to the given code completion string.
Definition at line 2970 of file SemaCodeComplete.cpp.
Referenced by clang::CodeCompletionResult::createCodeCompletionStringForDecl().
|
static |
Add a completion for "this", if we're in a member function.
Definition at line 1903 of file SemaCodeComplete.cpp.
|
static |
Definition at line 1807 of file SemaCodeComplete.cpp.
|
static |
Add the name of the given declaration.
Definition at line 3105 of file SemaCodeComplete.cpp.
Referenced by clang::CodeCompletionResult::createCodeCompletionStringForDecl().
|
static |
Definition at line 4908 of file SemaCodeComplete.cpp.
References clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::TQ_atomic, clang::DeclSpec::TQ_const, clang::DeclSpec::TQ_restrict, clang::DeclSpec::TQ_unaligned, and clang::DeclSpec::TQ_volatile.
|
static |
Add type specifiers for the current language as keyword results.
Definition at line 1653 of file SemaCodeComplete.cpp.
References clang::CCP_Type.
Definition at line 5032 of file SemaCodeComplete.cpp.
Referenced by clang::Sema::ProduceCallSignatureHelp().
|
static |
Definition at line 1184 of file SemaCodeComplete.cpp.
References BothViable, clang::CCD_ObjectQualifierMatch, clang::CCP_NestedNameSpecifier, clang::Qualifiers::compatiblyIncludes(), clang::Sema::Context, clang::NestedNameSpecifier::Create(), Dominated, Dominates, clang::Decl::getIdentifierNamespace(), clang::Sema::getLangOpts(), clang::CXXMethodDecl::getMethodQualifiers(), clang::FunctionDecl::getMinRequiredArguments(), clang::FunctionDecl::getNumParams(), clang::CXXMethodDecl::getRefQualifier(), clang::ASTContext::getTypeDeclType(), clang::QualType::getTypePtr(), clang::NamedDecl::getUnderlyingDecl(), clang::Qualifiers::hasConst(), clang::Decl::IDNS_LocalExtern, clang::Decl::IDNS_Member, clang::Decl::IDNS_Namespace, clang::Decl::IDNS_Ordinary, clang::Decl::IDNS_Tag, clang::Sema::isAcceptableNestedNameSpecifier(), isConstructor(), clang::FunctionDecl::isVariadic(), clang::FunctionDecl::parameters(), clang::RQ_LValue, clang::RQ_None, clang::RQ_RValue, setInBaseClass(), clang::CodeCompletionResult::ShadowDecl, clang::Decl::specific_attrs(), clang::TTK_Class, clang::TTK_Interface, clang::TTK_Struct, clang::TTK_Union, clang::VK_LValue, and clang::VK_XValue.
|
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 7425 of file SemaCodeComplete.cpp.
Referenced by clang::Sema::CodeCompleteObjCMethodDecl().
|
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 2688 of file SemaCodeComplete.cpp.
References formatBlockPlaceholder(), clang::TypeLoc::getAs(), clang::TypeSourceInfo::getTypeLoc(), clang::TypeLoc::getUnqualifiedLoc(), and clang::TypeLoc::IgnoreParens().
Referenced by FormatFunctionParameter().
|
static |
Returns a placeholder string that corresponds to an Objective-C block declaration.
BlockDecl | A declaration with an Objective-C block type. |
Block | The most relevant type location for that block type. |
SuppressBlockName | Determines whether or not the name of the block declaration is included in the resulting string. |
Definition at line 2830 of file SemaCodeComplete.cpp.
References FormatFunctionParameter(), clang::QualType::getAsStringInternal(), clang::Decl::getASTContext(), clang::NamedDecl::getIdentifier(), clang::IdentifierInfo::getName(), clang::FunctionTypeLoc::getNumParams(), clang::FunctionTypeLoc::getParam(), clang::FunctionType::getReturnType(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), clang::InheritingConcreteTypeLoc< Base, Derived, TypeClass >::getTypePtr(), clang::FunctionProtoType::isVariadic(), clang::Type::isVoidType(), clang::Result, and clang::QualType::substObjCTypeArgs().
Referenced by findTypeLocationForBlockDecl(), and FormatFunctionParameter().
|
static |
Definition at line 2737 of file SemaCodeComplete.cpp.
References findTypeLocationForBlockDecl(), formatBlockPlaceholder(), formatObjCParamQualifiers(), clang::QualType::getAsString(), clang::QualType::getAsStringInternal(), clang::Decl::getASTContext(), clang::Decl::getDeclContext(), clang::NamedDecl::getIdentifier(), clang::IdentifierInfo::getName(), clang::ParmVarDecl::getObjCDeclQualifier(), clang::ValueDecl::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::QualType::getUnqualifiedType(), clang::Type::isBlockPointerType(), clang::Type::isDependentType(), clang::Parameter, and clang::QualType::substObjCTypeArgs().
Referenced by AddFunctionParameterChunks(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), and formatBlockPlaceholder().
|
static |
Definition at line 2647 of file SemaCodeComplete.cpp.
References clang::NonNull, clang::Nullable, clang::Decl::OBJC_TQ_Bycopy, clang::Decl::OBJC_TQ_Byref, clang::Decl::OBJC_TQ_CSNullability, clang::Decl::OBJC_TQ_In, clang::Decl::OBJC_TQ_Inout, clang::Decl::OBJC_TQ_Oneway, clang::Decl::OBJC_TQ_Out, clang::AttributedType::stripOuterNullability(), and clang::Unspecified.
Referenced by clang::CodeCompletionResult::createCodeCompletionStringForDecl(), and FormatFunctionParameter().
|
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 6410 of file SemaCodeComplete.cpp.
References clang::ObjCMessageExpr::Class, clang::Type::getAs(), clang::Selector::getIdentifierInfoForSlot(), clang::IdentifierInfo::getName(), clang::ObjCInterfaceDecl::getSuperClass(), Id, clang::ObjCMessageExpr::Instance, clang::ObjCMethodDecl::isInstanceMethod(), clang::Selector::isNull(), clang::ObjCMessageExpr::SuperClass, and clang::ObjCMessageExpr::SuperInstance.
|
static |
Definition at line 1849 of file SemaCodeComplete.cpp.
Referenced by clang::CodeCompletionResult::CreateCodeCompletionString().
|
static |
Retrieve a printing policy suitable for code completion.
Definition at line 1860 of file SemaCodeComplete.cpp.
|
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 1869 of file SemaCodeComplete.cpp.
|
static |
Definition at line 1011 of file SemaCodeComplete.cpp.
|
static |
Retrieve the container definition, if any?
Definition at line 4418 of file SemaCodeComplete.cpp.
|
static |
Definition at line 2884 of file SemaCodeComplete.cpp.
References clang::ParmVarDecl::getDefaultArgRange(), clang::Lexer::getSourceText(), clang::CharSourceRange::getTokenRange(), and clang::CharSourceRange::isInvalid().
Referenced by AddFunctionParameterChunks().
|
static |
Get the type of the Nth parameter from a given set of overload candidates.
Definition at line 5066 of file SemaCodeComplete.cpp.
References clang::Sema::Context, clang::QualType::getNonReferenceType(), clang::ASTContext::hasSameUnqualifiedType(), and clang::QualType::isNull().
Referenced by clang::FunctionProtoType::isTemplateVariadic(), clang::CanProxyAdaptor< FunctionProtoType >::LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(), and ProduceSignatureHelp().
|
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 6694 of file SemaCodeComplete.cpp.
|
static |
Definition at line 409 of file SemaCodeComplete.cpp.
|
static |
Get preferred type for an argument of an unary expression.
ContextType
is preferred type of the whole unary expression.
Definition at line 488 of file SemaCodeComplete.cpp.
|
static |
Compute the qualification required to get from the current context (CurContext
) to the target context (TargetContext
).
Context | the AST context in which the qualification will be used. |
CurContext | the context where an entity is being named, which is typically based on the current scope. |
TargetContext | the context in which the named entity actually resides. |
Definition at line 665 of file SemaCodeComplete.cpp.
Referenced by shouldIgnoreDueToReservedName().
|
static |
Definition at line 3872 of file SemaCodeComplete.cpp.
Referenced by clang::Sema::CodeCompleteNaturalLanguage(), clang::Sema::CodeCompleteObjCMethodDecl(), and clang::Sema::CodeCompleteQualifiedId().
|
static |
Determine whether the given class is or inherits from a class by the given name.
Definition at line 7526 of file SemaCodeComplete.cpp.
|
static |
Definition at line 6154 of file SemaCodeComplete.cpp.
References clang::ObjCMethodDecl::getSelector(), and isAcceptableObjCSelector().
Referenced by AddClassMessageCompletions().
|
static |
Definition at line 6128 of file SemaCodeComplete.cpp.
References clang::Selector::getIdentifierInfoForSlot(), clang::Selector::getNumArgs(), clang::Selector::isUnarySelector(), MK_Any, MK_OneArgSelector, and MK_ZeroArgSelector.
Referenced by isAcceptableObjCMethod().
Definition at line 1049 of file SemaCodeComplete.cpp.
References clang::Decl::getCanonicalDecl(), clang::Decl::getIdentifierNamespace(), and clang::CodeCompletionResult::ShadowDecl.
Referenced by compareOverloads().
Determine whether this scope denotes a namespace.
Definition at line 5709 of file SemaCodeComplete.cpp.
References clang::Scope::getEntity(), and clang::DeclContext::isFileContext().
|
static |
Definition at line 1497 of file SemaCodeComplete.cpp.
References clang::Sema::Context, clang::ASTContext::getBaseElementType(), clang::ASTContext::getCanonicalType(), clang::getDeclUsageType(), clang::ASTContext::getLangOpts(), clang::Sema::getLangOpts(), clang::Type::getTypeClass(), clang::VarDecl::hasLocalStorage(), clang::Type::isDependentType(), clang::QualType::isNull(), clang::Type::isObjCIdType(), clang::Type::isObjCObjectPointerType(), clang::Type::isObjCObjectType(), and clang::Type::isRecordType().
|
static |
Determine whether Id
is a name reserved for the implementation (C99 7.1.3, C++ [lib.global.names]).
Definition at line 697 of file SemaCodeComplete.cpp.
References clang::IdentifierInfo::getLength().
Referenced by shouldIgnoreDueToReservedName().
|
static |
Definition at line 3882 of file SemaCodeComplete.cpp.
|
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.
S | The semantic analysis object for which we are generating results. |
InContext | This context in which the nested-name-specifier preceding the code-completion point |
Definition at line 3947 of file SemaCodeComplete.cpp.
|
static |
Definition at line 2633 of file SemaCodeComplete.cpp.
References clang::CodeCompletionBuilder::AddTextChunk(), clang::Decl::getAttr(), clang::Preprocessor::getLangOpts(), and clang::Preprocessor::isMacroDefined().
Referenced by AddFunctionParameterChunks(), and clang::CodeCompletionResult::createCodeCompletionStringForDecl().
|
static |
Definition at line 5045 of file SemaCodeComplete.cpp.
References clang::OverloadCandidateSet::getKind(), clang::isBetterOverloadCandidate(), and X.
|
static |
Determine whether the addition of the given flag to an Objective-C property's attributes will cause a conflict.
Definition at line 6029 of file SemaCodeComplete.cpp.
References clang::ObjCDeclSpec::DQ_PR_assign, clang::ObjCDeclSpec::DQ_PR_copy, clang::ObjCDeclSpec::DQ_PR_readonly, clang::ObjCDeclSpec::DQ_PR_readwrite, clang::ObjCDeclSpec::DQ_PR_retain, clang::ObjCDeclSpec::DQ_PR_strong, clang::ObjCDeclSpec::DQ_PR_unsafe_unretained, and clang::ObjCDeclSpec::DQ_PR_weak.
|
static |
Definition at line 3288 of file SemaCodeComplete.cpp.
References clang::CodeCompletionString::CK_Optional, and clang::CodeCompletionString::CK_TypedText.
Referenced by clang::CodeCompletionResult::createCodeCompletionStringForOverride().
|
static |
Definition at line 5091 of file SemaCodeComplete.cpp.
References clang::Sema::CodeCompleter, getParamType(), and clang::CodeCompleteConsumer::ProcessOverloadCandidates().
|
static |
Definition at line 1174 of file SemaCodeComplete.cpp.
References clang::CCD_InBaseClass, clang::CodeCompletionResult::InBaseClass, and clang::CodeCompletionResult::Priority.
Referenced by compareOverloads().
Definition at line 710 of file SemaCodeComplete.cpp.
References clang::Sema::Context, clang::Decl::FOK_Undeclared, clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::Decl::getFriendObjectKind(), clang::NamedDecl::getIdentifier(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::DeclContext::getRedeclContext(), getRequiredQualification(), clang::SourceManager::getSpellingLoc(), clang::NamedDecl::getUnderlyingDecl(), Id, clang::DeclContext::isFunctionOrMethod(), clang::SourceManager::isInSystemHeader(), clang::SourceLocation::isInvalid(), isReservedName(), and clang::Sema::SourceMgr.
|
static |
Try to find a corresponding FunctionProtoType for function-like types (e.g.
function pointers, std::function, etc).
Definition at line 4260 of file SemaCodeComplete.cpp.
References clang::Type::getAs(), clang::TemplateArgument::getAsType(), clang::TemplateArgument::getKind(), clang::Type::getPointeeType(), clang::QualType::isNull(), clang::Type::isPointerType(), and clang::TemplateArgument::Type.
|
static |
Definition at line 1819 of file SemaCodeComplete.cpp.
References 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, and clang::Sema::PCC_Type.