clang
7.0.0
|
#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 <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) case OO_##Name: OperatorName = "operator" Spelling; break; |
#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::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) |
static bool | isConstructor (const Decl *ND) |
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 | 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 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 enum CodeCompletionContext::Kind | 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) |
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 void | CodeCompleteOverloadResults (Sema &SemaRef, Scope *S, MutableArrayRef< ResultCandidate > Candidates, unsigned CurrentArg, bool CompleteExpressionWithCurrentArg=true) |
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 5068 of file SemaCodeComplete.cpp.
Referenced by AddObjCImplementationResults(), AddObjCInterfaceResults(), and AddObjCVisibilityResults().
#define OVERLOADED_OPERATOR | ( | Name, | |
Spelling, | |||
Token, | |||
Unary, | |||
Binary, | |||
MemberOnly | |||
) | case OO_##Name: OperatorName = "operator" Spelling; break; |
#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 3764 of file SemaCodeComplete.cpp.
typedef llvm::DenseMap< Selector, llvm::PointerIntPair<ObjCMethodDecl *, 1, bool> > KnownMethodsMap |
Definition at line 6743 of file SemaCodeComplete.cpp.
Definition at line 4386 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 5433 of file SemaCodeComplete.cpp.
|
static |
Definition at line 6045 of file SemaCodeComplete.cpp.
References AddObjCMethods(), AddSuperSendCompletion(), clang::Sema::CurContext, clang::Type::getAs(), clang::Sema::getCurMethodDecl(), clang::Sema::getExternalSource(), clang::Sema::GetTypeFromParser(), clang::QualType::isNull(), and MK_Any.
|
static |
Add function parameter chunks to the given code completion string.
Definition at line 2471 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.
|
static |
Definition at line 1428 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 2628 of file SemaCodeComplete.cpp.
References clang::CodeCompletionBuilder::AddInformativeChunk(), clang::Qualifiers::Const, clang::CodeCompletionAllocator::CopyString(), clang::CodeCompletionBuilder::getAllocator(), clang::Type::getAs(), clang::ValueDecl::getType(), clang::FunctionProtoType::getTypeQuals(), clang::FunctionType::isConst(), clang::FunctionType::isRestrict(), clang::FunctionType::isVolatile(), clang::Qualifiers::Restrict, and clang::Qualifiers::Volatile.
|
static |
Add all of the Objective-C interface declarations that we find in the given (translation unit) context.
Definition at line 6457 of file SemaCodeComplete.cpp.
References clang::DeclContext::decls().
|
static |
Definition at line 3304 of file SemaCodeComplete.cpp.
References clang::Preprocessor::getLangOpts(), clang::Preprocessor::getMacroDefinition(), clang::getMacroUsagePriority(), clang::Preprocessor::macro_begin(), and clang::Preprocessor::macro_end().
|
static |
Adds a block invocation code completion result for the given block declaration BD
.
Definition at line 3786 of file SemaCodeComplete.cpp.
|
static |
Definition at line 5180 of file SemaCodeComplete.cpp.
Referenced by AddFunctionSpecifiers().
|
static |
Definition at line 5070 of file SemaCodeComplete.cpp.
References OBJC_AT_KEYWORD_NAME.
Referenced by AddFunctionSpecifiers().
|
static |
Definition at line 5094 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 6864 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 5497 of file SemaCodeComplete.cpp.
Referenced by AddClassMessageCompletions().
|
static |
Add the parenthesized return or parameter type chunk to a code completion string.
Definition at line 6835 of file SemaCodeComplete.cpp.
|
static |
Definition at line 3822 of file SemaCodeComplete.cpp.
|
static |
Definition at line 5245 of file SemaCodeComplete.cpp.
Referenced by AddFunctionSpecifiers().
|
static |
Definition at line 5114 of file SemaCodeComplete.cpp.
Referenced by AddFunctionSpecifiers().
|
static |
Definition at line 5291 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 1600 of file SemaCodeComplete.cpp.
|
static |
Add function overload parameter chunks to the given code completion string.
Definition at line 3087 of file SemaCodeComplete.cpp.
|
static |
Definition at line 3331 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 6394 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 2608 of file SemaCodeComplete.cpp.
|
static |
Definition at line 3987 of file SemaCodeComplete.cpp.
References clang::Sema::CodeCompleter, clang::Sema::CurContext, 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 2147 of file SemaCodeComplete.cpp.
Referenced by clang::CodeCompletionBuilder::getCodeCompletionTUInfo().
|
static |
Definition at line 1584 of file SemaCodeComplete.cpp.
|
static |
Definition at line 1402 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 5806 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 2525 of file SemaCodeComplete.cpp.
|
static |
Add a completion for "this", if we're in a member function.
Definition at line 1568 of file SemaCodeComplete.cpp.
|
static |
Definition at line 1477 of file SemaCodeComplete.cpp.
|
static |
Add the name of the given declaration.
Definition at line 2665 of file SemaCodeComplete.cpp.
|
static |
Definition at line 4237 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 1320 of file SemaCodeComplete.cpp.
References clang::CCP_Type.
Definition at line 4375 of file SemaCodeComplete.cpp.
Referenced by clang::Sema::CodeCompleteCall().
|
static |
Definition at line 4438 of file SemaCodeComplete.cpp.
References clang::Sema::CodeCompleteExpression(), clang::Sema::CodeCompleteOrdinaryName(), clang::Sema::CodeCompleter, getParamType(), clang::QualType::isNull(), clang::Sema::PCC_Expression, and clang::CodeCompleteConsumer::ProcessOverloadCandidates().
|
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 6749 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 2250 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 2388 of file SemaCodeComplete.cpp.
References clang::QualType::getAsStringInternal(), clang::Decl::getASTContext(), clang::FunctionTypeLoc::getNumParams(), 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 2298 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().
|
static |
Definition at line 2209 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 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 5723 of file SemaCodeComplete.cpp.
|
static |
Definition at line 1518 of file SemaCodeComplete.cpp.
Referenced by clang::CodeCompletionResult::CreateCodeCompletionString().
|
static |
Retrieve a printing policy suitable for code completion.
Definition at line 1529 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 1538 of file SemaCodeComplete.cpp.
|
static |
Retrieve the container definition, if any?
Definition at line 3767 of file SemaCodeComplete.cpp.
|
static |
Definition at line 2442 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 4413 of file SemaCodeComplete.cpp.
References clang::Sema::Context, clang::QualType::getNonReferenceType(), clang::ASTContext::hasSameUnqualifiedType(), and clang::QualType::isNull().
Referenced by CodeCompleteOverloadResults(), clang::FunctionProtoType::isTemplateVariadic(), and clang::CanProxyAdaptor< FunctionProtoType >::LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR().
|
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 6013 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 456 of file SemaCodeComplete.cpp.
Referenced by clang::Sema::CodeCompleteCase(), and shouldIgnoreDueToReservedName().
|
static |
Definition at line 3344 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 6851 of file SemaCodeComplete.cpp.
|
static |
Definition at line 5463 of file SemaCodeComplete.cpp.
References clang::ObjCMethodDecl::getSelector(), and isAcceptableObjCSelector().
|
static |
Definition at line 5439 of file SemaCodeComplete.cpp.
References clang::Selector::getNumArgs(), clang::Selector::isUnarySelector(), MK_Any, MK_OneArgSelector, and MK_ZeroArgSelector.
Referenced by isAcceptableObjCMethod().
Definition at line 846 of file SemaCodeComplete.cpp.
References clang::Decl::getCanonicalDecl(), clang::Decl::getIdentifierNamespace(), and clang::CodeCompletionResult::ShadowDecl.
Determine whether this scope denotes a namespace.
Definition at line 5014 of file SemaCodeComplete.cpp.
References clang::Scope::getEntity(), and clang::DeclContext::isFileContext().
|
static |
Definition at line 1211 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::Decl::hasAttr(), 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 491 of file SemaCodeComplete.cpp.
References clang::IdentifierInfo::getLength().
Referenced by shouldIgnoreDueToReservedName().
|
static |
Definition at line 3353 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 3417 of file SemaCodeComplete.cpp.
|
static |
Definition at line 2195 of file SemaCodeComplete.cpp.
References clang::CodeCompletionBuilder::AddTextChunk(), clang::Decl::getAttr(), clang::Preprocessor::getLangOpts(), and clang::Preprocessor::isMacroDefined().
Referenced by AddFunctionParameterChunks().
|
static |
Definition at line 4388 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 5338 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.
Definition at line 504 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 1488 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.