clang API Documentation
#include "clang/Sema/SemaInternal.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.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/ExternalSemaSource.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Overload.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.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 |
Defines | |
#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) |
Typedefs | |
typedef llvm::SmallPtrSet < IdentifierInfo *, 16 > | AddedPropertiesSet |
The set of properties that have already been added, referenced by property name. | |
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 ). | |
static bool | isReservedName (const IdentifierInfo *Id) |
static bool | isObjCReceiverType (ASTContext &C, QualType T) |
static void | AddTypeSpecifierResults (const LangOptions &LangOpts, ResultBuilder &Results) |
Add type specifiers for the current language as keyword results. | |
static void | AddStorageSpecifiers (Sema::ParserCompletionContext CCC, const LangOptions &LangOpts, ResultBuilder &Results) |
static void | AddFunctionSpecifiers (Sema::ParserCompletionContext CCC, const LangOptions &LangOpts, ResultBuilder &Results) |
static void | AddObjCExpressionResults (ResultBuilder &Results, bool NeedAt) |
static void | AddObjCStatementResults (ResultBuilder &Results, bool NeedAt) |
static void | AddObjCVisibilityResults (const LangOptions &LangOpts, ResultBuilder &Results, bool NeedAt) |
static void | AddObjCImplementationResults (const LangOptions &LangOpts, ResultBuilder &Results, bool NeedAt) |
static void | AddObjCInterfaceResults (const LangOptions &LangOpts, ResultBuilder &Results, bool NeedAt) |
static void | AddObjCTopLevelResults (ResultBuilder &Results, bool NeedAt) |
static void | AddTypedefResult (ResultBuilder &Results) |
static bool | WantTypesInContext (Sema::ParserCompletionContext CCC, const LangOptions &LangOpts) |
static PrintingPolicy | getCompletionPrintingPolicy (const ASTContext &Context, const Preprocessor &PP) |
static PrintingPolicy | getCompletionPrintingPolicy (Sema &S) |
Retrieve a printing policy suitable for code completion. | |
static const char * | GetCompletionTypeString (QualType T, ASTContext &Context, const PrintingPolicy &Policy, CodeCompletionAllocator &Allocator) |
Retrieve the string representation of the given type as a string that has the appropriate lifetime for code completion. | |
static void | addThisCompletion (Sema &S, ResultBuilder &Results) |
Add a completion for "this", if we're in a member function. | |
static void | AddOrdinaryNameResults (Sema::ParserCompletionContext CCC, Scope *S, Sema &SemaRef, ResultBuilder &Results) |
Add language constructs that show up for "ordinary" names. | |
static void | AddResultTypeChunk (ASTContext &Context, const PrintingPolicy &Policy, const NamedDecl *ND, CodeCompletionBuilder &Result) |
If the given declaration has an associated type, add it as a result type chunk. | |
static void | MaybeAddSentinel (ASTContext &Context, const NamedDecl *FunctionOrMethod, CodeCompletionBuilder &Result) |
static std::string | formatObjCParamQualifiers (unsigned ObjCQuals) |
static std::string | FormatFunctionParameter (ASTContext &Context, const PrintingPolicy &Policy, const ParmVarDecl *Param, bool SuppressName=false, bool SuppressBlock=false) |
static void | AddFunctionParameterChunks (ASTContext &Context, const PrintingPolicy &Policy, const FunctionDecl *Function, CodeCompletionBuilder &Result, unsigned Start=0, bool InOptional=false) |
Add function parameter chunks to the given code completion string. | |
static void | AddTemplateParameterChunks (ASTContext &Context, const PrintingPolicy &Policy, const TemplateDecl *Template, CodeCompletionBuilder &Result, unsigned MaxParameters=0, unsigned Start=0, bool InDefaultArg=false) |
Add template parameter chunks to the given code completion string. | |
static void | AddQualifierToCompletionString (CodeCompletionBuilder &Result, NestedNameSpecifier *Qualifier, bool QualifierIsInformative, ASTContext &Context, const PrintingPolicy &Policy) |
Add a qualifier to the given code-completion string, if the provided nested-name-specifier is non-NULL. | |
static void | AddFunctionTypeQualsToCompletionString (CodeCompletionBuilder &Result, const FunctionDecl *Function) |
static void | 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. | |
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? | |
static void | AddObjCProperties (ObjCContainerDecl *Container, bool AllowCategories, bool AllowNullaryMethods, DeclContext *CurContext, AddedPropertiesSet &AddedProperties, ResultBuilder &Results) |
static bool | anyNullArguments (ArrayRef< Expr * > Args) |
static bool | isNamespaceScope (Scope *S) |
Determine whether this scope denotes a namespace. | |
static bool | ObjCPropertyFlagConflicts (unsigned Attributes, unsigned NewFlag) |
Determine whether the addition of the given flag to an Objective-C property's attributes will cause a conflict. | |
static bool | isAcceptableObjCSelector (Selector Sel, ObjCMethodKind WantKind, ArrayRef< IdentifierInfo * > SelIdents, bool AllowSameLength=true) |
static bool | isAcceptableObjCMethod (ObjCMethodDecl *Method, ObjCMethodKind WantKind, ArrayRef< IdentifierInfo * > SelIdents, bool AllowSameLength=true) |
static void | AddObjCMethods (ObjCContainerDecl *Container, bool WantInstanceMethods, ObjCMethodKind WantKind, ArrayRef< IdentifierInfo * > SelIdents, DeclContext *CurContext, VisitedSelectorSet &Selectors, bool AllowSameLength, ResultBuilder &Results, bool InOriginalClass=true) |
Add all of the Objective-C methods in the given Objective-C container to the set of results. | |
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. This routine returns that class type, or NULL if no better result could be determined. | |
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. | |
static void | AddProtocolResults (DeclContext *Ctx, DeclContext *CurContext, bool OnlyForwardDeclarations, ResultBuilder &Results) |
Add all of the protocol declarations that we find in the given (translation unit) context. | |
static void | AddInterfaceResults (DeclContext *Ctx, DeclContext *CurContext, bool OnlyForwardDeclarations, bool OnlyUnimplemented, ResultBuilder &Results) |
Add all of the Objective-C interface declarations that we find in the given (translation unit) context. | |
static void | FindImplementableMethods (ASTContext &Context, ObjCContainerDecl *Container, 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. Insert those methods into the map of known methods, indexed by selector so they can be easily found. | |
static void | AddObjCPassingTypeChunk (QualType Type, unsigned ObjCDeclQuals, ASTContext &Context, const PrintingPolicy &Policy, CodeCompletionBuilder &Builder) |
Add the parenthesized return or parameter type chunk to a code completion string. | |
static bool | InheritsFromClassNamed (ObjCInterfaceDecl *Class, StringRef Name) |
Determine whether the given class is or inherits from a class by the given name. | |
static void | AddObjCKeyValueCompletions (ObjCPropertyDecl *Property, bool IsInstanceMethod, QualType ReturnType, ASTContext &Context, VisitedSelectorSet &KnownSelectors, ResultBuilder &Results) |
Add code completions for Objective-C Key-Value Coding (KVC) and Key-Value Observing (KVO). |
#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 4370 of file SemaCodeComplete.cpp.
Referenced by AddObjCExpressionResults(), AddObjCImplementationResults(), AddObjCInterfaceResults(), AddObjCStatementResults(), AddObjCTopLevelResults(), 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 | |||
) |
if (std::strcmp(Spelling, "?")) \ Results.AddResult(Result(Spelling));
#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 3437 of file SemaCodeComplete.cpp.
typedef llvm::DenseMap< Selector, llvm::PointerIntPair<ObjCMethodDecl *, 1, bool> > KnownMethodsMap |
Definition at line 6049 of file SemaCodeComplete.cpp.
enum ObjCMethodKind |
Describes the kind of Objective-C method that we want to find via code completion.
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 4734 of file SemaCodeComplete.cpp.
static void AddClassMessageCompletions | ( | Sema & | SemaRef, |
Scope * | S, | ||
ParsedType | Receiver, | ||
ArrayRef< IdentifierInfo * > | SelIdents, | ||
bool | AtArgumentExpression, | ||
bool | IsSuper, | ||
ResultBuilder & | Results | ||
) | [static] |
Definition at line 5343 of file SemaCodeComplete.cpp.
References AddObjCMethods(), AddSuperSendCompletion(), clang::Sema::CurContext, clang::Type::getAs(), clang::Sema::getCurMethodDecl(), clang::ExternalASTSource::GetExternalSelector(), clang::Sema::getExternalSource(), clang::ExternalASTSource::GetNumExternalSelectors(), clang::Sema::GetTypeFromParser(), isAcceptableObjCMethod(), clang::QualType::isNull(), clang::Selector::isNull(), clang::ObjCMethodList::Method, clang::Sema::MethodPool, MK_Any, and clang::Sema::ReadMethodPool().
Referenced by clang::Sema::CodeCompleteDeclSpec(), and clang::Sema::CodeCompleteObjCClassMessage().
static void AddFunctionParameterChunks | ( | ASTContext & | Context, |
const PrintingPolicy & | Policy, | ||
const FunctionDecl * | Function, | ||
CodeCompletionBuilder & | Result, | ||
unsigned | Start = 0 , |
||
bool | InOptional = false |
||
) | [static] |
Add function parameter chunks to the given code completion string.
Definition at line 2251 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(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), clang::ParmVarDecl::hasDefaultArg(), clang::FunctionDecl::isVariadic(), MaybeAddSentinel(), and P.
Referenced by clang::CodeCompletionResult::CreateCodeCompletionString().
static void AddFunctionSpecifiers | ( | Sema::ParserCompletionContext | CCC, |
const LangOptions & | LangOpts, | ||
ResultBuilder & | Results | ||
) | [static] |
Definition at line 1360 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.
Referenced by AddOrdinaryNameResults().
static void AddFunctionTypeQualsToCompletionString | ( | CodeCompletionBuilder & | Result, |
const FunctionDecl * | Function | ||
) | [static] |
Definition at line 2403 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.
Referenced by clang::CodeCompletionResult::CreateCodeCompletionString().
static void AddInterfaceResults | ( | DeclContext * | Ctx, |
DeclContext * | CurContext, | ||
bool | OnlyForwardDeclarations, | ||
bool | OnlyUnimplemented, | ||
ResultBuilder & | Results | ||
) | [static] |
Add all of the Objective-C interface declarations that we find in the given (translation unit) context.
Definition at line 5758 of file SemaCodeComplete.cpp.
References clang::DeclContext::decls().
Referenced by clang::Sema::CodeCompleteObjCImplementationDecl(), clang::Sema::CodeCompleteObjCInterfaceDecl(), and clang::Sema::CodeCompleteObjCSuperclass().
static void AddMacroResults | ( | Preprocessor & | PP, |
ResultBuilder & | Results, | ||
bool | IncludeUndefined, | ||
bool | TargetTypeIsPointer = false |
||
) | [static] |
Definition at line 2983 of file SemaCodeComplete.cpp.
References clang::Preprocessor::getLangOpts(), clang::getMacroUsagePriority(), clang::Preprocessor::macro_begin(), and clang::Preprocessor::macro_end().
Referenced by clang::Sema::CodeCompleteAfterIf(), clang::Sema::CodeCompleteCase(), clang::Sema::CodeCompleteExpression(), clang::Sema::CodeCompleteObjCMessageReceiver(), clang::Sema::CodeCompleteObjCPassingType(), clang::Sema::CodeCompleteOrdinaryName(), clang::Sema::CodeCompletePreprocessorExpression(), and clang::Sema::GatherGlobalCodeCompletions().
static void AddObjCExpressionResults | ( | ResultBuilder & | Results, |
bool | NeedAt | ||
) | [static] |
Definition at line 4483 of file SemaCodeComplete.cpp.
References Builder, clang::CodeCompletionString::CK_Colon, clang::CodeCompletionString::CK_HorizontalSpace, clang::CodeCompletionString::CK_LeftParen, clang::CodeCompletionString::CK_RightBrace, clang::CodeCompletionString::CK_RightBracket, clang::CodeCompletionString::CK_RightParen, and OBJC_AT_KEYWORD_NAME.
Referenced by AddOrdinaryNameResults(), clang::Sema::CodeCompleteObjCAtExpression(), and clang::Sema::CodeCompleteObjCAtStatement().
static void AddObjCImplementationResults | ( | const LangOptions & | LangOpts, |
ResultBuilder & | Results, | ||
bool | NeedAt | ||
) | [static] |
Definition at line 4372 of file SemaCodeComplete.cpp.
References Builder, clang::CodeCompletionString::CK_HorizontalSpace, and OBJC_AT_KEYWORD_NAME.
Referenced by AddOrdinaryNameResults(), and clang::Sema::CodeCompleteObjCAtDirective().
static void AddObjCInterfaceResults | ( | const LangOptions & | LangOpts, |
ResultBuilder & | Results, | ||
bool | NeedAt | ||
) | [static] |
Definition at line 4396 of file SemaCodeComplete.cpp.
References OBJC_AT_KEYWORD_NAME.
Referenced by AddOrdinaryNameResults(), and clang::Sema::CodeCompleteObjCAtDirective().
static void AddObjCKeyValueCompletions | ( | ObjCPropertyDecl * | Property, |
bool | IsInstanceMethod, | ||
QualType | ReturnType, | ||
ASTContext & | Context, | ||
VisitedSelectorSet & | KnownSelectors, | ||
ResultBuilder & | Results | ||
) | [static] |
Add code completions for Objective-C Key-Value Coding (KVC) and Key-Value Observing (KVO).
Definition at line 6170 of file SemaCodeComplete.cpp.
References AddObjCPassingTypeChunk(), Allocator, Builder, clang::CCD_ProbablyNotObjCCollection, clang::CCP_CodePattern, clang::CodeCompletionString::CK_HorizontalSpace, clang::CodeCompletionString::CK_LeftParen, clang::CodeCompletionString::CK_RightParen, Context, clang::CodeCompletionAllocator::CopyString(), CXCursor_ObjCClassMethodDecl, CXCursor_ObjCInstanceMethodDecl, clang::IdentifierTable::get(), clang::Type::getAs(), getCompletionPrintingPolicy(), GetCompletionTypeString(), clang::ObjCPropertyDecl::getGetterMethodDecl(), clang::NamedDecl::getIdentifier(), clang::IdentifierInfo::getLength(), clang::IdentifierInfo::getName(), clang::NamedDecl::getName(), clang::QualType::getNonReferenceType(), clang::ObjCPropertyDecl::getSetterMethodDecl(), clang::ObjCPropertyDecl::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::ASTContext::Idents, InheritsFromClassNamed(), clang::Type::isBooleanType(), clang::Type::isIntegerType(), clang::QualType::isNull(), clang::Type::isObjCObjectPointerType(), clang::Type::isVoidType(), clang::ASTContext::Selectors, and clang::toUppercase().
Referenced by clang::Sema::CodeCompleteObjCMethodDecl().
static void AddObjCMethods | ( | ObjCContainerDecl * | Container, |
bool | WantInstanceMethods, | ||
ObjCMethodKind | WantKind, | ||
ArrayRef< IdentifierInfo * > | SelIdents, | ||
DeclContext * | CurContext, | ||
VisitedSelectorSet & | Selectors, | ||
bool | AllowSameLength, | ||
ResultBuilder & | Results, | ||
bool | InOriginalClass = true |
||
) | [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 4798 of file SemaCodeComplete.cpp.
References clang::ObjCList< T >::begin(), clang::CCD_InBaseClass, clang::ObjCList< T >::end(), getContainerDef(), clang::ObjCInterfaceDecl::getImplementation(), clang::ObjCInterfaceDecl::getSuperClass(), clang::ObjCInterfaceDecl::hasDefinition(), isAcceptableObjCMethod(), clang::ObjCInterfaceDecl::known_categories(), clang::ObjCContainerDecl::methods(), MK_Any, and clang::ObjCInterfaceDecl::protocols().
Referenced by AddClassMessageCompletions(), clang::Sema::CodeCompleteObjCInstanceMessage(), clang::Sema::CodeCompleteObjCPropertyGetter(), and clang::Sema::CodeCompleteObjCPropertySetter().
static void AddObjCPassingTypeChunk | ( | QualType | Type, |
unsigned | ObjCDeclQuals, | ||
ASTContext & | Context, | ||
const PrintingPolicy & | Policy, | ||
CodeCompletionBuilder & | Builder | ||
) | [static] |
Add the parenthesized return or parameter type chunk to a code completion string.
Definition at line 6141 of file SemaCodeComplete.cpp.
References clang::CodeCompletionBuilder::AddChunk(), clang::CodeCompletionBuilder::AddTextChunk(), clang::CodeCompletionString::CK_LeftParen, clang::CodeCompletionString::CK_RightParen, clang::CodeCompletionAllocator::CopyString(), formatObjCParamQualifiers(), clang::CodeCompletionBuilder::getAllocator(), and GetCompletionTypeString().
Referenced by AddObjCKeyValueCompletions(), and clang::Sema::CodeCompleteObjCMethodDecl().
static void AddObjCProperties | ( | ObjCContainerDecl * | Container, |
bool | AllowCategories, | ||
bool | AllowNullaryMethods, | ||
DeclContext * | CurContext, | ||
AddedPropertiesSet & | AddedProperties, | ||
ResultBuilder & | Results | ||
) | [static] |
Definition at line 3457 of file SemaCodeComplete.cpp.
References AddResultTypeChunk(), Builder, clang::CCD_MethodAsProperty, clang::CCP_MemberDeclaration, clang::Decl::getASTContext(), getCompletionPrintingPolicy(), getContainerDef(), clang::ObjCContainerDecl::methods(), P, and clang::ObjCContainerDecl::properties().
Referenced by clang::Sema::CodeCompleteMemberReferenceExpr(), and clang::Sema::CodeCompleteObjCPropertyDefinition().
static void AddObjCStatementResults | ( | ResultBuilder & | Results, |
bool | NeedAt | ||
) | [static] |
Definition at line 4548 of file SemaCodeComplete.cpp.
References Builder, clang::CodeCompletionString::CK_HorizontalSpace, clang::CodeCompletionString::CK_LeftBrace, clang::CodeCompletionString::CK_LeftParen, clang::CodeCompletionString::CK_RightBrace, clang::CodeCompletionString::CK_RightParen, and OBJC_AT_KEYWORD_NAME.
Referenced by AddOrdinaryNameResults(), and clang::Sema::CodeCompleteObjCAtStatement().
static void AddObjCTopLevelResults | ( | ResultBuilder & | Results, |
bool | NeedAt | ||
) | [static] |
Definition at line 4416 of file SemaCodeComplete.cpp.
References Builder, clang::CodeCompletionString::CK_HorizontalSpace, and OBJC_AT_KEYWORD_NAME.
Referenced by AddOrdinaryNameResults(), and clang::Sema::CodeCompleteObjCAtDirective().
static void AddObjCVisibilityResults | ( | const LangOptions & | LangOpts, |
ResultBuilder & | Results, | ||
bool | NeedAt | ||
) | [static] |
Definition at line 4594 of file SemaCodeComplete.cpp.
References OBJC_AT_KEYWORD_NAME.
Referenced by AddOrdinaryNameResults(), and clang::Sema::CodeCompleteObjCAtVisibility().
static void AddOrdinaryNameResults | ( | Sema::ParserCompletionContext | CCC, |
Scope * | S, | ||
Sema & | SemaRef, | ||
ResultBuilder & | Results | ||
) | [static] |
Add language constructs that show up for "ordinary" names.
while (condition) { statements }
Definition at line 1516 of file SemaCodeComplete.cpp.
References AddFunctionSpecifiers(), AddObjCExpressionResults(), AddObjCImplementationResults(), AddObjCInterfaceResults(), AddObjCStatementResults(), AddObjCTopLevelResults(), AddObjCVisibilityResults(), AddStorageSpecifiers(), addThisCompletion(), AddTypedefResult(), AddTypeSpecifierResults(), Builder, clang::CodeCompletionString::CK_Colon, clang::CodeCompletionString::CK_Equal, clang::CodeCompletionString::CK_HorizontalSpace, clang::CodeCompletionString::CK_LeftAngle, clang::CodeCompletionString::CK_LeftBrace, clang::CodeCompletionString::CK_LeftBracket, clang::CodeCompletionString::CK_LeftParen, clang::CodeCompletionString::CK_RightAngle, clang::CodeCompletionString::CK_RightBrace, clang::CodeCompletionString::CK_RightBracket, clang::CodeCompletionString::CK_RightParen, clang::CodeCompletionString::CK_SemiColon, clang::CodeCompletionString::CK_VerticalSpace, clang::CodeCompletionAllocator::CopyString(), clang::Sema::CurContext, clang::IdentifierTable::get(), clang::Sema::getASTContext(), clang::Scope::getBreakParent(), getCompletionPrintingPolicy(), clang::Scope::getContinueParent(), clang::Sema::getCurBlock(), clang::Sema::getCurFunction(), clang::Sema::getCurMethodDecl(), clang::Sema::getLangOpts(), clang::IdentifierInfo::hasMacroDefinition(), clang::ASTContext::Idents, clang::DeclContext::isDependentContext(), clang::QualType::isNull(), clang::Type::isVoidType(), clang::Sema::PCC_Class, clang::Sema::PCC_Condition, clang::Sema::PCC_Expression, clang::Sema::PCC_ForInit, clang::Sema::PCC_LocalDeclarationSpecifiers, clang::Sema::PCC_MemberTemplate, clang::Sema::PCC_Namespace, clang::Sema::PCC_ObjCImplementation, clang::Sema::PCC_ObjCInstanceVariableList, clang::Sema::PCC_ObjCInterface, clang::Sema::PCC_ParenthesizedExpression, clang::Sema::PCC_RecoveryInFunction, clang::Sema::PCC_Statement, clang::Sema::PCC_Template, clang::Sema::PCC_Type, clang::sema::CapturingScopeInfo::ReturnType, clang::sema::FunctionScopeInfo::SwitchStack, and WantTypesInContext().
Referenced by clang::Sema::CodeCompleteAfterIf(), clang::Sema::CodeCompleteExpression(), clang::Sema::CodeCompleteObjCPassingType(), and clang::Sema::CodeCompleteOrdinaryName().
static void AddPrettyFunctionResults | ( | const LangOptions & | LangOpts, |
ResultBuilder & | Results | ||
) | [static] |
Definition at line 3009 of file SemaCodeComplete.cpp.
References clang::CCP_Constant.
Referenced by clang::Sema::CodeCompleteAfterIf(), clang::Sema::CodeCompleteExpression(), and clang::Sema::CodeCompleteOrdinaryName().
static void AddProtocolResults | ( | DeclContext * | Ctx, |
DeclContext * | CurContext, | ||
bool | OnlyForwardDeclarations, | ||
ResultBuilder & | Results | ||
) | [static] |
Add all of the protocol declarations that we find in the given (translation unit) context.
Definition at line 5693 of file SemaCodeComplete.cpp.
References clang::DeclContext::decls().
Referenced by clang::Sema::CodeCompleteObjCProtocolDecl(), and clang::Sema::CodeCompleteObjCProtocolReferences().
static void AddQualifierToCompletionString | ( | CodeCompletionBuilder & | Result, |
NestedNameSpecifier * | Qualifier, | ||
bool | QualifierIsInformative, | ||
ASTContext & | Context, | ||
const PrintingPolicy & | Policy | ||
) | [static] |
Add a qualifier to the given code-completion string, if the provided nested-name-specifier is non-NULL.
Definition at line 2383 of file SemaCodeComplete.cpp.
References clang::CodeCompletionBuilder::AddInformativeChunk(), clang::CodeCompletionBuilder::AddTextChunk(), clang::CodeCompletionAllocator::CopyString(), clang::CodeCompletionBuilder::getAllocator(), and clang::NestedNameSpecifier::print().
Referenced by clang::CodeCompletionResult::CreateCodeCompletionString().
static void AddResultTypeChunk | ( | ASTContext & | Context, |
const PrintingPolicy & | Policy, | ||
const NamedDecl * | ND, | ||
CodeCompletionBuilder & | Result | ||
) | [static] |
If the given declaration has an associated type, add it as a result type chunk.
Definition at line 2055 of file SemaCodeComplete.cpp.
References clang::CodeCompletionBuilder::AddResultTypeChunk(), clang::ASTContext::DependentTy, clang::CodeCompletionBuilder::getAllocator(), clang::Decl::getAsFunction(), GetCompletionTypeString(), clang::ASTContext::getTypeDeclType(), clang::ASTContext::hasSameType(), and clang::QualType::isNull().
Referenced by AddObjCProperties(), AddSuperSendCompletion(), clang::CodeCompletionResult::CreateCodeCompletionString(), and clang::CodeCompleteConsumer::OverloadCandidate::CreateSignatureString().
static void AddStorageSpecifiers | ( | Sema::ParserCompletionContext | CCC, |
const LangOptions & | LangOpts, | ||
ResultBuilder & | Results | ||
) | [static] |
Definition at line 1349 of file SemaCodeComplete.cpp.
Referenced by AddOrdinaryNameResults().
static ObjCMethodDecl* AddSuperSendCompletion | ( | Sema & | S, |
bool | NeedSuperKeyword, | ||
ArrayRef< IdentifierInfo * > | SelIdents, | ||
ResultBuilder & | Results | ||
) | [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 5106 of file SemaCodeComplete.cpp.
References AddResultTypeChunk(), Builder, clang::CCP_SuperCompletion, clang::CodeCompletionString::CK_HorizontalSpace, clang::Sema::Context, clang::ObjCMethodDecl::getClassInterface(), getCompletionPrintingPolicy(), clang::Sema::getCurMethodDecl(), clang::ObjCContainerDecl::getMethod(), clang::Selector::getNameForSlot(), clang::Selector::getNumArgs(), clang::ObjCMethodDecl::getSelector(), clang::ObjCInterfaceDecl::getSuperClass(), clang::ASTContext::hasSameUnqualifiedType(), clang::ObjCMethodDecl::isInstanceMethod(), clang::Selector::isUnarySelector(), clang::ObjCMethodDecl::isVariadic(), clang::ObjCInterfaceDecl::known_categories(), clang::ObjCMethodDecl::param_begin(), clang::ObjCMethodDecl::param_end(), and clang::ObjCMethodDecl::param_size().
Referenced by AddClassMessageCompletions(), clang::Sema::CodeCompleteObjCInstanceMessage(), and clang::Sema::CodeCompleteObjCMessageReceiver().
static void AddTemplateParameterChunks | ( | ASTContext & | Context, |
const PrintingPolicy & | Policy, | ||
const TemplateDecl * | Template, | ||
CodeCompletionBuilder & | Result, | ||
unsigned | MaxParameters = 0 , |
||
unsigned | Start = 0 , |
||
bool | InDefaultArg = false |
||
) | [static] |
Add template parameter chunks to the given code completion string.
Definition at line 2304 of file SemaCodeComplete.cpp.
References clang::CodeCompletionBuilder::AddChunk(), clang::CodeCompletionBuilder::AddOptionalChunk(), clang::CodeCompletionBuilder::AddPlaceholderChunk(), clang::TemplateParameterList::begin(), clang::CodeCompletionString::CK_Comma, clang::CodeCompletionAllocator::CopyString(), clang::TemplateParameterList::end(), clang::CodeCompletionBuilder::getAllocator(), clang::CodeCompletionBuilder::getCodeCompletionTUInfo(), clang::NamedDecl::getIdentifier(), clang::IdentifierInfo::getName(), clang::TemplateDecl::getTemplateParameters(), clang::TemplateTemplateParmDecl::hasDefaultArgument(), and P.
Referenced by clang::CodeCompletionResult::CreateCodeCompletionString().
static void addThisCompletion | ( | Sema & | S, |
ResultBuilder & | Results | ||
) | [static] |
Add a completion for "this", if we're in a member function.
Definition at line 1499 of file SemaCodeComplete.cpp.
References Builder, clang::Sema::Context, getCompletionPrintingPolicy(), GetCompletionTypeString(), clang::Sema::getCurrentThisType(), and clang::QualType::isNull().
Referenced by AddOrdinaryNameResults(), clang::Sema::CodeCompleteLambdaIntroducer(), and clang::Sema::CodeCompleteObjCMessageReceiver().
static void AddTypedefResult | ( | ResultBuilder & | Results | ) | [static] |
Definition at line 1409 of file SemaCodeComplete.cpp.
References Builder, and clang::CodeCompletionString::CK_HorizontalSpace.
Referenced by AddOrdinaryNameResults().
static void AddTypeSpecifierResults | ( | const LangOptions & | LangOpts, |
ResultBuilder & | Results | ||
) | [static] |
Add type specifiers for the current language as keyword results.
Definition at line 1273 of file SemaCodeComplete.cpp.
References Builder, clang::CCD_bool_in_ObjC, clang::CCP_Type, clang::CodeCompletionString::CK_HorizontalSpace, clang::CodeCompletionString::CK_LeftParen, and clang::CodeCompletionString::CK_RightParen.
Referenced by AddOrdinaryNameResults().
static bool anyNullArguments | ( | ArrayRef< Expr * > | Args | ) | [static] |
Definition at line 3808 of file SemaCodeComplete.cpp.
Referenced by clang::Sema::CodeCompleteCall().
static void FindImplementableMethods | ( | ASTContext & | Context, |
ObjCContainerDecl * | Container, | ||
bool | WantInstanceMethods, | ||
QualType | ReturnType, | ||
KnownMethodsMap & | KnownMethods, | ||
bool | InOriginalClass = true |
||
) | [static] |
Find all of the methods that reside in the given container (and its superclasses, protocols, etc.) that meet the given criteria. Insert those methods into the map of known methods, indexed by selector so they can be easily found.
Definition at line 6055 of file SemaCodeComplete.cpp.
References clang::ObjCList< T >::begin(), clang::ObjCList< T >::end(), clang::ASTContext::hasSameUnqualifiedType(), clang::QualType::isNull(), and clang::ObjCContainerDecl::methods().
Referenced by clang::Sema::CodeCompleteObjCMethodDecl().
static std::string FormatFunctionParameter | ( | ASTContext & | Context, |
const PrintingPolicy & | Policy, | ||
const ParmVarDecl * | Param, | ||
bool | SuppressName = false , |
||
bool | SuppressBlock = false |
||
) | [static] |
Definition at line 2121 of file SemaCodeComplete.cpp.
References formatObjCParamQualifiers(), clang::TypeLoc::getAs(), clang::QualType::getAsStringInternal(), clang::Decl::getDeclContext(), clang::NamedDecl::getIdentifier(), clang::IdentifierInfo::getName(), clang::FunctionTypeLoc::getNumParams(), clang::ParmVarDecl::getObjCDeclQualifier(), clang::FunctionTypeLoc::getParam(), clang::FunctionType::getReturnType(), clang::ValueDecl::getType(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), clang::InheritingConcreteTypeLoc< Base, Derived, TypeClass >::getTypePtr(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::TypeLoc::getUnqualifiedLoc(), clang::QualType::getUnqualifiedType(), clang::TypeLoc::IgnoreParens(), clang::Type::isBlockPointerType(), clang::Type::isDependentType(), clang::FunctionProtoType::isVariadic(), and clang::Type::isVoidType().
Referenced by AddFunctionParameterChunks(), and clang::CodeCompletionResult::CreateCodeCompletionString().
static std::string formatObjCParamQualifiers | ( | unsigned | ObjCQuals | ) | [static] |
Definition at line 2104 of file SemaCodeComplete.cpp.
References clang::Decl::OBJC_TQ_Bycopy, clang::Decl::OBJC_TQ_Byref, clang::Decl::OBJC_TQ_In, clang::Decl::OBJC_TQ_Inout, clang::Decl::OBJC_TQ_Oneway, and clang::Decl::OBJC_TQ_Out.
Referenced by AddObjCPassingTypeChunk(), clang::CodeCompletionResult::CreateCodeCompletionString(), and FormatFunctionParameter().
static ObjCInterfaceDecl* GetAssumedMessageSendExprType | ( | Expr * | E | ) | [static] |
When we have an expression with type "id", we may assume that it has some more-specific class type based on knowledge of common uses of Objective-C. This routine returns that class type, or NULL if no better result could be determined.
Definition at line 5023 of file SemaCodeComplete.cpp.
References clang::ObjCMessageExpr::Class, clang::Type::getAs(), clang::ObjCMessageExpr::getClassReceiver(), clang::Selector::getIdentifierInfoForSlot(), clang::ObjCMessageExpr::getInstanceReceiver(), clang::ObjCMessageExpr::getMethodDecl(), clang::IdentifierInfo::getName(), clang::ObjCMessageExpr::getReceiverKind(), clang::ObjCMessageExpr::getSelector(), clang::ObjCInterfaceDecl::getSuperClass(), clang::Expr::getType(), clang::ObjCMessageExpr::Instance, clang::ObjCMethodDecl::isInstanceMethod(), clang::Selector::isNull(), clang::ObjCMessageExpr::SuperClass, and clang::ObjCMessageExpr::SuperInstance.
Referenced by clang::Sema::CodeCompleteObjCInstanceMessage().
static PrintingPolicy getCompletionPrintingPolicy | ( | const ASTContext & | Context, |
const Preprocessor & | PP | ||
) | [static] |
Definition at line 1450 of file SemaCodeComplete.cpp.
References clang::PrintingPolicy::AnonymousTagLocations, clang::Sema::getPrintingPolicy(), clang::PrintingPolicy::SuppressStrongLifetime, and clang::PrintingPolicy::SuppressUnwrittenScope.
Referenced by AddObjCKeyValueCompletions(), AddObjCProperties(), AddOrdinaryNameResults(), AddSuperSendCompletion(), addThisCompletion(), clang::Sema::CodeCompleteConstructorInitializer(), clang::Sema::CodeCompleteObjCMethodDecl(), clang::Sema::CodeCompleteObjCPropertySynthesizeIvar(), clang::CodeCompletionResult::CreateCodeCompletionString(), clang::CodeCompleteConsumer::OverloadCandidate::CreateSignatureString(), getCompletionPrintingPolicy(), and MaybeAddOverrideCalls().
static PrintingPolicy getCompletionPrintingPolicy | ( | Sema & | S | ) | [static] |
Retrieve a printing policy suitable for code completion.
Definition at line 1460 of file SemaCodeComplete.cpp.
References clang::Sema::Context, getCompletionPrintingPolicy(), and clang::Sema::PP.
static const char* GetCompletionTypeString | ( | QualType | T, |
ASTContext & | Context, | ||
const PrintingPolicy & | Policy, | ||
CodeCompletionAllocator & | Allocator | ||
) | [static] |
Retrieve the string representation of the given type as a string that has the appropriate lifetime for code completion.
This routine provides a fast path where we provide constant strings for common type names.
Definition at line 1469 of file SemaCodeComplete.cpp.
References clang::CodeCompletionAllocator::CopyString(), clang::QualType::getAsStringInternal(), clang::QualType::getLocalQualifiers(), clang::TTK_Class, clang::TTK_Enum, clang::TTK_Interface, clang::TTK_Struct, and clang::TTK_Union.
Referenced by AddObjCKeyValueCompletions(), AddObjCPassingTypeChunk(), AddResultTypeChunk(), addThisCompletion(), clang::Sema::CodeCompleteObjCPropertySynthesizeIvar(), and clang::CodeCompleteConsumer::OverloadCandidate::CreateSignatureString().
static ObjCContainerDecl* getContainerDef | ( | ObjCContainerDecl * | Container | ) | [static] |
Retrieve the container definition, if any?
Definition at line 3440 of file SemaCodeComplete.cpp.
Referenced by AddObjCMethods(), AddObjCProperties(), and clang::Sema::CodeCompleteObjCPropertyDefinition().
static QualType getPreferredArgumentTypeForMessageSend | ( | ResultBuilder & | Results, |
unsigned | NumSelIdents | ||
) | [static] |
Given a set of code-completion results for the argument of a message send, determine the preferred type (if any) for that argument expression.
Definition at line 5311 of file SemaCodeComplete.cpp.
References clang::CCP_Unlikely, clang::ASTContext::hasSameUnqualifiedType(), clang::QualType::isNull(), and clang::ObjCMethodDecl::parameters().
Referenced by clang::Sema::CodeCompleteObjCClassMessage(), and clang::Sema::CodeCompleteObjCInstanceMessage().
static NestedNameSpecifier* getRequiredQualification | ( | ASTContext & | Context, |
const DeclContext * | CurContext, | ||
const DeclContext * | TargetContext | ||
) | [static] |
Compute the qualification required to get from the current context (CurContext
) to the target context (TargetContext
).
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.
References clang::NestedNameSpecifier::Create(), clang::DeclContext::Encloses(), clang::ASTContext::getTypeDeclType(), and clang::QualType::getTypePtr().
Referenced by clang::Sema::CodeCompleteCase(), and MaybeAddOverrideCalls().
static void HandleCodeCompleteResults | ( | Sema * | S, |
CodeCompleteConsumer * | CodeCompleter, | ||
CodeCompletionContext | Context, | ||
CodeCompletionResult * | Results, | ||
unsigned | NumResults | ||
) | [static] |
Definition at line 3022 of file SemaCodeComplete.cpp.
References clang::CodeCompleteConsumer::ProcessCodeCompleteResults().
Referenced by clang::Sema::CodeCompleteAfterIf(), clang::Sema::CodeCompleteCase(), clang::Sema::CodeCompleteConstructorInitializer(), clang::Sema::CodeCompleteDeclSpec(), clang::Sema::CodeCompleteExpression(), clang::Sema::CodeCompleteLambdaIntroducer(), clang::Sema::CodeCompleteMemberReferenceExpr(), clang::Sema::CodeCompleteModuleImport(), clang::Sema::CodeCompleteNamespaceAliasDecl(), clang::Sema::CodeCompleteNamespaceDecl(), clang::Sema::CodeCompleteNaturalLanguage(), clang::Sema::CodeCompleteObjCAtDirective(), clang::Sema::CodeCompleteObjCAtExpression(), clang::Sema::CodeCompleteObjCAtStatement(), clang::Sema::CodeCompleteObjCAtVisibility(), clang::Sema::CodeCompleteObjCClassMessage(), clang::Sema::CodeCompleteObjCImplementationCategory(), clang::Sema::CodeCompleteObjCImplementationDecl(), clang::Sema::CodeCompleteObjCInstanceMessage(), clang::Sema::CodeCompleteObjCInterfaceCategory(), clang::Sema::CodeCompleteObjCInterfaceDecl(), clang::Sema::CodeCompleteObjCMessageReceiver(), clang::Sema::CodeCompleteObjCMethodDecl(), clang::Sema::CodeCompleteObjCMethodDeclSelector(), clang::Sema::CodeCompleteObjCPassingType(), clang::Sema::CodeCompleteObjCPropertyDefinition(), clang::Sema::CodeCompleteObjCPropertyFlags(), clang::Sema::CodeCompleteObjCPropertyGetter(), clang::Sema::CodeCompleteObjCPropertySetter(), clang::Sema::CodeCompleteObjCPropertySynthesizeIvar(), clang::Sema::CodeCompleteObjCProtocolDecl(), clang::Sema::CodeCompleteObjCProtocolReferences(), clang::Sema::CodeCompleteObjCSelector(), clang::Sema::CodeCompleteObjCSuperclass(), clang::Sema::CodeCompleteOrdinaryName(), clang::Sema::CodeCompletePreprocessorDirective(), clang::Sema::CodeCompletePreprocessorExpression(), clang::Sema::CodeCompletePreprocessorMacroName(), clang::Sema::CodeCompleteQualifiedId(), clang::Sema::CodeCompleteTag(), clang::Sema::CodeCompleteTypeQualifiers(), clang::Sema::CodeCompleteUsing(), and clang::Sema::CodeCompleteUsingDirective().
static bool InheritsFromClassNamed | ( | ObjCInterfaceDecl * | Class, |
StringRef | Name | ||
) | [static] |
Determine whether the given class is or inherits from a class by the given name.
Definition at line 6157 of file SemaCodeComplete.cpp.
References clang::NamedDecl::getIdentifier(), clang::IdentifierInfo::getName(), and clang::ObjCInterfaceDecl::getSuperClass().
Referenced by AddObjCKeyValueCompletions().
static bool isAcceptableObjCMethod | ( | ObjCMethodDecl * | Method, |
ObjCMethodKind | WantKind, | ||
ArrayRef< IdentifierInfo * > | SelIdents, | ||
bool | AllowSameLength = true |
||
) | [static] |
Definition at line 4764 of file SemaCodeComplete.cpp.
References clang::ObjCMethodDecl::getSelector(), and isAcceptableObjCSelector().
Referenced by AddClassMessageCompletions(), AddObjCMethods(), clang::Sema::CodeCompleteObjCInstanceMessage(), and clang::Sema::CodeCompleteObjCMethodDeclSelector().
static bool isAcceptableObjCSelector | ( | Selector | Sel, |
ObjCMethodKind | WantKind, | ||
ArrayRef< IdentifierInfo * > | SelIdents, | ||
bool | AllowSameLength = true |
||
) | [static] |
Definition at line 4740 of file SemaCodeComplete.cpp.
References clang::Selector::getIdentifierInfoForSlot(), clang::Selector::getNumArgs(), clang::Selector::isUnarySelector(), MK_Any, MK_OneArgSelector, and MK_ZeroArgSelector.
Referenced by clang::Sema::CodeCompleteObjCSelector(), and isAcceptableObjCMethod().
static bool isNamespaceScope | ( | Scope * | S | ) | [static] |
Determine whether this scope denotes a namespace.
Definition at line 4316 of file SemaCodeComplete.cpp.
References clang::Scope::getEntity(), and clang::DeclContext::isFileContext().
Referenced by clang::Sema::CodeCompleteLambdaIntroducer().
static bool isObjCReceiverType | ( | ASTContext & | C, |
QualType | T | ||
) | [static] |
Definition at line 1170 of file SemaCodeComplete.cpp.
References clang::ASTContext::getCanonicalType(), clang::ASTContext::getLangOpts(), clang::Type::getTypeClass(), clang::Type::isDependentType(), and clang::Type::isRecordType().
static bool isReservedName | ( | const IdentifierInfo * | Id | ) | [static] |
Determine whether Id
is a name reserved for the implementation (C99 7.1.3, C++ [lib.global.names]).
Definition at line 485 of file SemaCodeComplete.cpp.
References clang::IdentifierInfo::getLength(), and clang::IdentifierInfo::getNameStart().
static enum CodeCompletionContext::Kind mapCodeCompletionContext | ( | Sema & | S, |
Sema::ParserCompletionContext | PCC | ||
) | [static] |
Definition at line 3031 of file SemaCodeComplete.cpp.
References clang::CodeCompletionContext::CCC_ClassStructUnion, clang::CodeCompletionContext::CCC_Expression, clang::CodeCompletionContext::CCC_ObjCImplementation, clang::CodeCompletionContext::CCC_ObjCInterface, clang::CodeCompletionContext::CCC_ObjCIvarList, clang::CodeCompletionContext::CCC_Other, clang::CodeCompletionContext::CCC_ParenthesizedExpression, clang::CodeCompletionContext::CCC_Recovery, clang::CodeCompletionContext::CCC_Statement, clang::CodeCompletionContext::CCC_TopLevel, clang::CodeCompletionContext::CCC_Type, clang::Sema::CurContext, clang::Sema::getLangOpts(), clang::DeclContext::isFileContext(), clang::DeclContext::isRecord(), 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.
Referenced by clang::Sema::CodeCompleteAfterIf(), and clang::Sema::CodeCompleteOrdinaryName().
static void MaybeAddOverrideCalls | ( | Sema & | S, |
DeclContext * | InContext, | ||
ResultBuilder & | Results | ||
) | [static] |
If we're in a C++ virtual member function, add completion results that invoke the functions we override, since it's common to invoke the overridden function as well as adding new functionality.
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 3095 of file SemaCodeComplete.cpp.
References clang::CXXMethodDecl::begin_overridden_methods(), Builder, clang::CCP_SuperCompletion, clang::CodeCompletionString::CK_Comma, clang::CodeCompletionString::CK_LeftParen, clang::CodeCompletionString::CK_RightParen, clang::Sema::Context, clang::Sema::CurContext, CXAvailability_Available, CXCursor_CXXMethod, clang::CXXMethodDecl::end_overridden_methods(), clang::DeclContext::Equals(), clang::CXXMethodDecl::getCanonicalDecl(), getCompletionPrintingPolicy(), clang::DeclContext::getParent(), getRequiredQualification(), clang::CXXMethodDecl::isVirtual(), P, clang::FunctionDecl::params(), and clang::NestedNameSpecifier::print().
Referenced by clang::Sema::CodeCompleteOrdinaryName(), and clang::Sema::CodeCompleteQualifiedId().
static void MaybeAddSentinel | ( | ASTContext & | Context, |
const NamedDecl * | FunctionOrMethod, | ||
CodeCompletionBuilder & | Result | ||
) | [static] |
Definition at line 2089 of file SemaCodeComplete.cpp.
References clang::CodeCompletionBuilder::AddTextChunk(), clang::IdentifierTable::get(), clang::Decl::getAttr(), clang::ASTContext::getLangOpts(), clang::IdentifierInfo::hasMacroDefinition(), and clang::ASTContext::Idents.
Referenced by AddFunctionParameterChunks(), and clang::CodeCompletionResult::CreateCodeCompletionString().
static bool ObjCPropertyFlagConflicts | ( | unsigned | Attributes, |
unsigned | NewFlag | ||
) | [static] |
Determine whether the addition of the given flag to an Objective-C property's attributes will cause a conflict.
Definition at line 4644 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.
Referenced by clang::Sema::CodeCompleteObjCPropertyFlags().
static bool WantTypesInContext | ( | Sema::ParserCompletionContext | CCC, |
const LangOptions & | LangOpts | ||
) | [static] |
Definition at line 1420 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.
Referenced by AddOrdinaryNameResults(), clang::Sema::CodeCompleteExpression(), and clang::Sema::CodeCompleteOrdinaryName().