clang
8.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/Basic/CharInfo.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 <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 | 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 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) |
DeclContext::lookup_result | getConstructors (ASTContext &Context, const CXXRecordDecl *Record) |
static bool | isConstructor (const Decl *ND) |
static void | setInBaseClass (ResultBuilder::Result &R) |
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 | printOverrideString (llvm::raw_ostream &OS, CodeCompletionString *CCS) |
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 | 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 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, 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 QualType | getPreferredTypeOfBinaryRHS (Sema &S, Expr *LHS, tok::TokenKind Op) |
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 5377 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 3933 of file SemaCodeComplete.cpp.
typedef llvm::DenseMap<Selector, llvm::PointerIntPair<ObjCMethodDecl *, 1, bool> > KnownMethodsMap |
Definition at line 7034 of file SemaCodeComplete.cpp.
Definition at line 4574 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 5780 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 5738 of file SemaCodeComplete.cpp.
|
static |
Definition at line 6341 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 |
Add function parameter chunks to the given code completion string.
Definition at line 2583 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 1465 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 2736 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 6747 of file SemaCodeComplete.cpp.
References clang::DeclContext::decls().
|
static |
|
static |
Adds a block invocation code completion result for the given block declaration BD
.
Definition at line 3955 of file SemaCodeComplete.cpp.
|
static |
Definition at line 5488 of file SemaCodeComplete.cpp.
Referenced by AddFunctionSpecifiers().
|
static |
Definition at line 5379 of file SemaCodeComplete.cpp.
References OBJC_AT_KEYWORD_NAME.
Referenced by AddFunctionSpecifiers().
|
static |
Definition at line 5402 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 7153 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 5802 of file SemaCodeComplete.cpp.
Referenced by AddClassMessageCompletions().
|
static |
Add the parenthesized return or parameter type chunk to a code completion string.
Definition at line 7126 of file SemaCodeComplete.cpp.
|
static |
Definition at line 3992 of file SemaCodeComplete.cpp.
|
static |
Definition at line 5553 of file SemaCodeComplete.cpp.
Referenced by AddFunctionSpecifiers().
|
static |
Definition at line 5421 of file SemaCodeComplete.cpp.
Referenced by AddFunctionSpecifiers().
|
static |
Definition at line 5599 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 1703 of file SemaCodeComplete.cpp.
|
static |
Add function overload parameter chunks to the given code completion string.
Definition at line 3225 of file SemaCodeComplete.cpp.
|
static |
Definition at line 1648 of file SemaCodeComplete.cpp.
|
static |
Definition at line 3503 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 6684 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 2716 of file SemaCodeComplete.cpp.
Referenced by clang::CodeCompletionResult::createCodeCompletionStringForDecl().
|
static |
Definition at line 4173 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 2258 of file SemaCodeComplete.cpp.
Referenced by clang::CodeCompletionResult::createCodeCompletionStringForDecl(), and clang::CodeCompletionBuilder::getCodeCompletionTUInfo().
|
static |
Definition at line 1620 of file SemaCodeComplete.cpp.
|
static |
Definition at line 1439 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 6110 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 2637 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 1606 of file SemaCodeComplete.cpp.
|
static |
Definition at line 1511 of file SemaCodeComplete.cpp.
|
static |
Add the name of the given declaration.
Definition at line 2772 of file SemaCodeComplete.cpp.
Referenced by clang::CodeCompletionResult::createCodeCompletionStringForDecl().
|
static |
Definition at line 4423 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 1357 of file SemaCodeComplete.cpp.
References clang::CCP_Type.
Definition at line 4563 of file SemaCodeComplete.cpp.
Referenced by clang::Sema::ProduceCallSignatureHelp().
|
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 7040 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 2360 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 2497 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 2409 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 2319 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 6026 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 1552 of file SemaCodeComplete.cpp.
Referenced by clang::CodeCompletionResult::CreateCodeCompletionString().
|
static |
Retrieve a printing policy suitable for code completion.
Definition at line 1563 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 1572 of file SemaCodeComplete.cpp.
DeclContext::lookup_result getConstructors | ( | ASTContext & | Context, |
const CXXRecordDecl * | Record | ||
) |
Definition at line 795 of file SemaCodeComplete.cpp.
|
static |
Retrieve the container definition, if any?
Definition at line 3936 of file SemaCodeComplete.cpp.
|
static |
Definition at line 2551 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 4600 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 6309 of file SemaCodeComplete.cpp.
|
static |
Definition at line 4880 of file SemaCodeComplete.cpp.
References clang::ASTContext::BoolTy, clang::Sema::getASTContext(), clang::ASTContext::getPointerDiffType(), clang::Expr::getType(), clang::ASTContext::IntTy, clang::Type::isIntegralOrEnumerationType(), and clang::Type::isPointerType().
Referenced by clang::Sema::CodeCompleteBinaryRHS().
|
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 450 of file SemaCodeComplete.cpp.
Referenced by clang::Sema::CodeCompleteCase(), and shouldIgnoreDueToReservedName().
|
static |
Definition at line 3516 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 7141 of file SemaCodeComplete.cpp.
|
static |
Definition at line 5770 of file SemaCodeComplete.cpp.
References clang::ObjCMethodDecl::getSelector(), and isAcceptableObjCSelector().
Referenced by AddClassMessageCompletions().
|
static |
Definition at line 5744 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 833 of file SemaCodeComplete.cpp.
References clang::Decl::getCanonicalDecl(), clang::Decl::getIdentifierNamespace(), and clang::CodeCompletionResult::ShadowDecl.
Referenced by setInBaseClass().
Determine whether this scope denotes a namespace.
Definition at line 5325 of file SemaCodeComplete.cpp.
References clang::Scope::getEntity(), and clang::DeclContext::isFileContext().
|
static |
Definition at line 1201 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 482 of file SemaCodeComplete.cpp.
References clang::IdentifierInfo::getLength().
Referenced by shouldIgnoreDueToReservedName().
|
static |
Definition at line 3526 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 3591 of file SemaCodeComplete.cpp.
|
static |
Definition at line 2305 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 4576 of file SemaCodeComplete.cpp.
References clang::OverloadCandidateSet::begin(), clang::OverloadCandidateSet::empty(), clang::OverloadCandidateSet::end(), 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 5645 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 1635 of file SemaCodeComplete.cpp.
References clang::CodeCompletionString::CK_Optional, and clang::CodeCompletionString::CK_ResultType.
Referenced by clang::CodeCompletionResult::createCodeCompletionStringForOverride().
|
static |
Definition at line 4625 of file SemaCodeComplete.cpp.
References clang::Sema::CodeCompleter, getParamType(), and clang::CodeCompleteConsumer::ProcessOverloadCandidates().
|
static |
Definition at line 958 of file SemaCodeComplete.cpp.
References clang::CCD_InBaseClass, clang::CCD_ObjectQualifierMatch, clang::CCP_NestedNameSpecifier, clang::Sema::Context, clang::NestedNameSpecifier::Create(), clang::Decl::getIdentifierNamespace(), clang::Sema::getLangOpts(), clang::ASTContext::getTypeDeclType(), clang::QualType::getTypePtr(), clang::NamedDecl::getUnderlyingDecl(), clang::Decl::IDNS_LocalExtern, clang::Decl::IDNS_Member, clang::Decl::IDNS_Namespace, clang::Decl::IDNS_Ordinary, clang::Decl::IDNS_Tag, clang::CodeCompletionResult::InBaseClass, clang::Sema::isAcceptableNestedNameSpecifier(), isConstructor(), clang::CodeCompletionResult::Priority, clang::CodeCompletionResult::ShadowDecl, clang::TTK_Class, clang::TTK_Interface, clang::TTK_Struct, and clang::TTK_Union.
Definition at line 495 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 |
Definition at line 1522 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.