clang 22.0.0git
|
#include "clang/AST/ASTContext.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclLookups.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/ModuleLoader.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Overload.h"
#include "clang/Sema/RISCVIntrinsicManager.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/Sema.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/SemaRISCV.h"
#include "clang/Sema/TemplateDeduction.h"
#include "clang/Sema/TypoCorrection.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/STLForwardCompat.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/TinyPtrVector.h"
#include "llvm/ADT/edit_distance.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include <algorithm>
#include <iterator>
#include <list>
#include <optional>
#include <set>
#include <utility>
#include <vector>
#include "OpenCLBuiltins.inc"
#include "clang/Basic/BuiltinTemplates.inc"
#include "clang/AST/TypeNodes.inc"
Go to the source code of this file.
Macros | |
#define | BuiltinTemplate(BIName) |
#define | CPlusPlusBuiltinTemplate(BIName) |
#define | BuiltinTemplate(BIName) |
#define | HLSLBuiltinTemplate(BIName) |
#define | TYPE(Class, Base) |
#define | DEPENDENT_TYPE(Class, Base) |
#define | NON_CANONICAL_TYPE(Class, Base) |
#define | NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) |
#define | ABSTRACT_TYPE(Class, Base) |
Functions | |
static unsigned | getIDNS (Sema::LookupNameKind NameKind, bool CPlusPlus, bool Redeclaration) |
static const DeclContext * | getContextForScopeMatching (const Decl *D) |
Get a representative context for a declaration such that two declarations will have the same context if they were found within the same scope. | |
static bool | isPreferredLookupResult (Sema &S, Sema::LookupNameKind Kind, const NamedDecl *D, const NamedDecl *Existing) |
Determine whether D is a better lookup result than Existing , given that they declare the same entity. | |
static bool | canHideTag (const NamedDecl *D) |
Determine whether D can hide a tag declaration. | |
static QualType | diagOpenCLBuiltinTypeError (Sema &S, llvm::StringRef TypeClass, llvm::StringRef Name) |
Diagnose a missing builtin type. | |
static QualType | getOpenCLEnumType (Sema &S, llvm::StringRef Name) |
Lookup an OpenCL enum type. | |
static QualType | getOpenCLTypedefType (Sema &S, llvm::StringRef Name) |
Lookup an OpenCL typedef type. | |
static void | GetQualTypesForOpenCLBuiltin (Sema &S, const OpenCLBuiltinStruct &OpenCLBuiltin, unsigned &GenTypeMaxCnt, SmallVector< QualType, 1 > &RetTypes, SmallVector< SmallVector< QualType, 1 >, 5 > &ArgTypes) |
Get the QualType instances of the return type and arguments for an OpenCL builtin function signature. | |
static void | GetOpenCLBuiltinFctOverloads (ASTContext &Context, unsigned GenTypeMaxCnt, std::vector< QualType > &FunctionList, SmallVector< QualType, 1 > &RetTypes, SmallVector< SmallVector< QualType, 1 >, 5 > &ArgTypes) |
Create a list of the candidate function overloads for an OpenCL builtin function. | |
static void | InsertOCLBuiltinDeclarationsFromTable (Sema &S, LookupResult &LR, IdentifierInfo *II, const unsigned FctIndex, const unsigned Len) |
When trying to resolve a function name, if isOpenCLBuiltin() returns a non-null <Index, Len> pair, then the name is referencing an OpenCL builtin function. | |
static void | LookupPredefedObjCSuperType (Sema &Sema, Scope *S) |
Looks up the declaration of "struct objc_super" and saves it for later use in building builtin declaration of objc_msgSendSuper and objc_msgSendSuper_stret. | |
static bool | CanDeclareSpecialMemberFunction (const CXXRecordDecl *Class) |
Determine whether we can declare a special member function within the class at this point. | |
static bool | isImplicitlyDeclaredMemberFunctionName (DeclarationName Name) |
Determine whether this is the name of an implicitly-declared special member function. | |
static void | DeclareImplicitMemberFunctionsWithName (Sema &S, DeclarationName Name, SourceLocation Loc, const DeclContext *DC) |
If there are any implicit member functions with the given name that need to be declared in the given declaration context, do so. | |
static bool | LookupDirect (Sema &S, LookupResult &R, const DeclContext *DC) |
static bool | CppNamespaceLookup (Sema &S, LookupResult &R, ASTContext &Context, const DeclContext *NS, UnqualUsingDirectiveSet &UDirs) |
static bool | isNamespaceOrTranslationUnitScope (Scope *S) |
static DeclContext * | findOuterContext (Scope *S) |
Find the outer declaration context from this scope. | |
static Module * | getDefiningModule (Sema &S, Decl *Entity) |
Find the module in which the given declaration was defined. | |
template<typename ParmDecl> | |
static bool | hasAcceptableDefaultArgument (Sema &S, const ParmDecl *D, llvm::SmallVectorImpl< Module * > *Modules, Sema::AcceptableKind Kind) |
template<typename Filter> | |
static bool | hasAcceptableDeclarationImpl (Sema &S, const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules, Filter F, Sema::AcceptableKind Kind) |
static bool | hasAcceptableExplicitSpecialization (Sema &S, const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules, Sema::AcceptableKind Kind) |
static bool | hasAcceptableMemberSpecialization (Sema &S, const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules, Sema::AcceptableKind Kind) |
static NamedDecl * | findAcceptableDecl (Sema &SemaRef, NamedDecl *D, unsigned IDNS) |
Retrieve the visible declaration corresponding to D, if any. | |
static bool | LookupQualifiedNameInUsingDirectives (Sema &S, LookupResult &R, DeclContext *StartDC) |
Perform qualified name lookup in the namespaces nominated by using directives by the given context. | |
static void | addAssociatedClassesAndNamespaces (AssociatedLookup &Result, QualType T) |
static void | CollectEnclosingNamespace (Sema::AssociatedNamespaceSet &Namespaces, DeclContext *Ctx) |
static void | addAssociatedClassesAndNamespaces (AssociatedLookup &Result, const TemplateArgument &Arg) |
static void | addAssociatedClassesAndNamespaces (AssociatedLookup &Result, CXXRecordDecl *Class) |
static bool | isCandidateViable (CorrectionCandidateCallback &CCC, TypoCorrection &Candidate) |
static void | LookupPotentialTypoResult (Sema &SemaRef, LookupResult &Res, IdentifierInfo *Name, Scope *S, CXXScopeSpec *SS, DeclContext *MemberContext, bool EnteringContext, bool isObjCIvarLookup, bool FindHidden) |
Perform name lookup for a possible result for typo correction. | |
static void | checkCorrectionVisibility (Sema &SemaRef, TypoCorrection &TC) |
Check whether the declarations found for a typo correction are visible. | |
static void | getNestedNameSpecifierIdentifiers (NestedNameSpecifier NNS, SmallVectorImpl< const IdentifierInfo * > &Identifiers) |
static void | AddKeywordsToConsumer (Sema &SemaRef, TypoCorrectionConsumer &Consumer, Scope *S, CorrectionCandidateCallback &CCC, bool AfterNestedNameSpecifier) |
Add keywords to the consumer as possible typo corrections. | |
static const NamedDecl * | getDefinitionToImport (const NamedDecl *D) |
Find which declaration we should import to provide the definition of the given declaration. | |
static std::string | getHeaderNameForHeader (Preprocessor &PP, FileEntryRef E, llvm::StringRef IncludingFile) |
Get a "quoted.h" or <angled.h> include path to use in a diagnostic suggesting the addition of a #include of the specified file. |
Variables | |
static const unsigned | MaxTypoDistanceResultSets = 5 |
#define ABSTRACT_TYPE | ( | Class, | |
Base ) |
#define BuiltinTemplate | ( | BIName | ) |
#define BuiltinTemplate | ( | BIName | ) |
#define CPlusPlusBuiltinTemplate | ( | BIName | ) |
#define DEPENDENT_TYPE | ( | Class, | |
Base ) |
#define HLSLBuiltinTemplate | ( | BIName | ) |
#define NON_CANONICAL_TYPE | ( | Class, | |
Base ) |
#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE | ( | Class, | |
Base ) |
#define TYPE | ( | Class, | |
Base ) |
|
static |
Definition at line 2998 of file SemaLookup.cpp.
References addAssociatedClassesAndNamespaces(), CollectEnclosingNamespace(), clang::TemplateArgument::Declaration, clang::TemplateArgument::Expression, clang::TemplateArgument::getAsTemplateOrTemplatePattern(), clang::TemplateArgument::getAsType(), clang::TemplateArgument::getKind(), clang::TemplateArgument::Integral, clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_elements(), clang::TemplateArgument::StructuralValue, clang::Template, clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.
|
static |
Definition at line 3049 of file SemaLookup.cpp.
References addAssociatedClassesAndNamespaces(), clang::CXXRecordDecl::bases(), CollectEnclosingNamespace(), clang::Decl::getDeclContext(), and clang::TemplateArgumentList::size().
|
static |
Definition at line 3140 of file SemaLookup.cpp.
References addAssociatedClassesAndNamespaces(), clang::cast(), CollectEnclosingNamespace(), clang::Enum, clang::Type::getCanonicalTypeInternal(), clang::FunctionType::getReturnType(), clang::QualType::getTypePtr(), clang::FunctionProtoType::param_types(), and clang::T.
Referenced by addAssociatedClassesAndNamespaces(), addAssociatedClassesAndNamespaces(), addAssociatedClassesAndNamespaces(), and clang::Sema::FindAssociatedClassesAndNamespaces().
|
static |
Add keywords to the consumer as possible typo corrections.
Definition at line 5116 of file SemaLookup.cpp.
References clang::TypoCorrectionConsumer::addKeywordResult(), clang::cast(), clang::Sema::CurContext, clang::Scope::getBreakParent(), clang::Scope::getContinueParent(), clang::Sema::getCurBlock(), clang::Sema::getCurFunction(), clang::Sema::getCurFunctionOrMethodDecl(), clang::Sema::getLangOpts(), clang::isa(), clang::Scope::isClassScope(), clang::sema::FunctionScopeInfo::SwitchStack, clang::CorrectionCandidateCallback::WantCXXNamedCasts, clang::CorrectionCandidateCallback::WantExpressionKeywords, clang::CorrectionCandidateCallback::WantFunctionLikeCasts, clang::CorrectionCandidateCallback::WantObjCSuper, clang::CorrectionCandidateCallback::WantRemainingKeywords, and clang::CorrectionCandidateCallback::WantTypeSpecifiers.
|
static |
Determine whether we can declare a special member function within the class at this point.
Definition at line 1014 of file SemaLookup.cpp.
Referenced by DeclareImplicitMemberFunctionsWithName(), clang::Sema::ForceDeclarationOfImplicitMembers(), clang::Sema::LookupConstructors(), and clang::Sema::LookupSpecialMember().
Determine whether D
can hide a tag declaration.
Definition at line 468 of file SemaLookup.cpp.
References clang::NamedDecl::getUnderlyingDecl(), and clang::isa().
Referenced by clang::LookupResult::resolveKind().
|
static |
Check whether the declarations found for a typo correction are visible.
Set the correction's RequiresImport flag to true if none of the declarations are visible, false otherwise.
Definition at line 4510 of file SemaLookup.cpp.
References clang::TypoCorrection::begin(), clang::TypoCorrection::end(), clang::LookupResult::isVisible(), clang::TypoCorrection::setCorrectionDecls(), and clang::TypoCorrection::setRequiresImport().
Referenced by clang::TypoCorrectionConsumer::addCorrection(), and clang::Sema::CorrectTypo().
|
static |
Definition at line 2922 of file SemaLookup.cpp.
References clang::cast(), clang::Decl::getASTContext(), clang::Decl::getOwningModule(), clang::DeclContext::getParent(), clang::DeclContext::getPrimaryContext(), clang::DeclContext::isFileContext(), clang::DeclContext::isInlineNamespace(), clang::Decl::isInNamedModule(), and clang::ASTContext::isInSameModule().
Referenced by addAssociatedClassesAndNamespaces(), addAssociatedClassesAndNamespaces(), and addAssociatedClassesAndNamespaces().
|
static |
Definition at line 1230 of file SemaLookup.cpp.
References clang::Found, clang::DeclContext::isFileContext(), LookupDirect(), and clang::LookupResult::resolveKind().
|
static |
If there are any implicit member functions with the given name that need to be declared in the given declaration context, do so.
Definition at line 1074 of file SemaLookup.cpp.
References CanDeclareSpecialMemberFunction(), clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXDeductionGuideName, clang::DeclarationName::CXXDestructorName, clang::DeclarationName::CXXOperatorName, clang::Sema::DeclareImplicitCopyAssignment(), clang::Sema::DeclareImplicitCopyConstructor(), clang::Sema::DeclareImplicitDeductionGuides(), clang::Sema::DeclareImplicitDefaultConstructor(), clang::Sema::DeclareImplicitDestructor(), clang::Sema::DeclareImplicitMoveAssignment(), clang::Sema::DeclareImplicitMoveConstructor(), clang::DeclarationName::getCXXDeductionGuideTemplate(), clang::DeclarationName::getCXXOverloadedOperator(), clang::Sema::getLangOpts(), and clang::DeclarationName::getNameKind().
Referenced by LookupDirect().
|
static |
Diagnose a missing builtin type.
Definition at line 702 of file SemaLookup.cpp.
References clang::Sema::Context, clang::SemaBase::Diag(), and clang::ASTContext::VoidTy.
Referenced by getOpenCLEnumType(), and getOpenCLTypedefType().
Retrieve the visible declaration corresponding to D, if any.
This routine determines whether the declaration D is visible in the current module, with the current imports. If not, it checks whether any redeclaration of D is visible, and if so, returns that declaration.
Definition at line 2090 of file SemaLookup.cpp.
References clang::cast(), clang::LookupResult::isAvailableForLookup(), and clang::Decl::redecls().
Referenced by argumentDependentLookup().
|
static |
Find the outer declaration context from this scope.
This indicates the context that we should search up to (exclusive) before considering the parent of the specified scope.
Definition at line 1259 of file SemaLookup.cpp.
References clang::Scope::getParent().
|
static |
Get a representative context for a declaration such that two declarations will have the same context if they were found within the same scope.
Definition at line 359 of file SemaLookup.cpp.
References clang::Decl::getDeclContext(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::getRedeclContext(), and clang::DeclContext::isFunctionOrMethod().
Referenced by clang::LookupResult::resolveKind().
Find the module in which the given declaration was defined.
Definition at line 1587 of file SemaLookup.cpp.
References clang::cast(), getDefiningModule(), clang::Decl::getLexicalDeclContext(), clang::Sema::getOwningModule(), clang::CXXRecordDecl::getTemplateInstantiationPattern(), clang::FunctionDecl::getTemplateInstantiationPattern(), and clang::VarDecl::getTemplateInstantiationPattern().
Referenced by getDefiningModule(), and clang::Sema::getLookupModules().
Find which declaration we should import to provide the definition of the given declaration.
Definition at line 5645 of file SemaLookup.cpp.
References getDefinitionToImport().
Referenced by clang::Sema::diagnoseMissingImport(), and getDefinitionToImport().
|
static |
Get a "quoted.h" or <angled.h> include path to use in a diagnostic suggesting the addition of a #include of the specified file.
Definition at line 5684 of file SemaLookup.cpp.
References clang::Preprocessor::getHeaderSearchInfo(), and clang::HeaderSearch::suggestPathToFileForDiagnostics().
Referenced by clang::Sema::diagnoseMissingImport().
|
inlinestatic |
Definition at line 214 of file SemaLookup.cpp.
References clang::CPlusPlus, clang::Decl::IDNS_Label, clang::Decl::IDNS_LocalExtern, clang::Decl::IDNS_Member, clang::Decl::IDNS_Namespace, clang::Decl::IDNS_NonMemberOperator, clang::Decl::IDNS_ObjCProtocol, clang::Decl::IDNS_OMPMapper, clang::Decl::IDNS_OMPReduction, clang::Decl::IDNS_Ordinary, clang::Decl::IDNS_OrdinaryFriend, clang::Decl::IDNS_Tag, clang::Decl::IDNS_TagFriend, clang::Decl::IDNS_Type, clang::Decl::IDNS_Using, clang::Sema::LookupAnyName, clang::Sema::LookupDestructorName, clang::Sema::LookupLabel, clang::Sema::LookupLocalFriendName, clang::Sema::LookupMemberName, clang::Sema::LookupNamespaceName, clang::Sema::LookupNestedNameSpecifierName, clang::Sema::LookupObjCImplicitSelfParam, clang::Sema::LookupObjCProtocolName, clang::Sema::LookupOMPMapperName, clang::Sema::LookupOMPReductionName, clang::Sema::LookupOperatorName, clang::Sema::LookupOrdinaryName, clang::Sema::LookupRedeclarationWithLinkage, clang::Sema::LookupTagName, clang::Sema::LookupUsingDeclName, and clang::Redeclaration.
|
static |
Definition at line 4548 of file SemaLookup.cpp.
References clang::cast(), clang::TemplateName::getAsDependentTemplateName(), clang::NestedNameSpecifier::getAsNamespaceAndPrefix(), clang::TemplateName::getAsQualifiedTemplateName(), clang::TemplateName::getAsTemplateDecl(), clang::NestedNameSpecifier::getAsType(), getIdentifier(), clang::NestedNameSpecifier::getKind(), getNestedNameSpecifierIdentifiers(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::MicrosoftSuper, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::Null, clang::T, and clang::NestedNameSpecifier::Type.
Referenced by getNestedNameSpecifierIdentifiers().
|
static |
Create a list of the candidate function overloads for an OpenCL builtin function.
Context | (in) The ASTContext instance. |
GenTypeMaxCnt | (in) Maximum number of types contained in a generic type used as return type or as argument. Only meaningful for generic types, otherwise equals 1. |
FunctionList | (out) List of FunctionTypes. |
RetTypes | (in) List of the possible return types. |
ArgTypes | (in) List of the possible types for the arguments. |
Definition at line 776 of file SemaLookup.cpp.
References clang::FunctionProtoType::ExtProtoInfo::Variadic.
Referenced by InsertOCLBuiltinDeclarationsFromTable().
Lookup an OpenCL enum type.
Definition at line 710 of file SemaLookup.cpp.
References clang::Sema::Context, diagOpenCLBuiltinTypeError(), clang::IdentifierTable::get(), clang::ASTContext::getCanonicalTagType(), clang::ASTContext::Idents, clang::Sema::LookupName(), clang::Sema::LookupTagName, clang::Result, and clang::Sema::TUScope.
Lookup an OpenCL typedef type.
Definition at line 723 of file SemaLookup.cpp.
References clang::Sema::Context, diagOpenCLBuiltinTypeError(), clang::IdentifierTable::get(), clang::ASTContext::getTypedefType(), clang::ASTContext::Idents, clang::Sema::LookupName(), clang::Sema::LookupOrdinaryName, clang::None, clang::Result, and clang::Sema::TUScope.
|
static |
Get the QualType instances of the return type and arguments for an OpenCL builtin function signature.
S | (in) The Sema instance. |
OpenCLBuiltin | (in) The signature currently handled. |
GenTypeMaxCnt | (out) Maximum number of types contained in a generic type used as return type or as argument. Only meaningful for generic types, otherwise equals 1. |
RetTypes | (out) List of the possible return types. |
ArgTypes | (out) List of the possible argument types. For each argument, ArgTypes contains QualTypes for the Cartesian product of (vector sizes) x (types) . |
Definition at line 747 of file SemaLookup.cpp.
Referenced by InsertOCLBuiltinDeclarationsFromTable().
|
static |
Definition at line 1744 of file SemaLookup.cpp.
References clang::cast(), clang::Sema::isAcceptable(), and clang::Decl::redecls().
Referenced by hasAcceptableExplicitSpecialization(), hasAcceptableMemberSpecialization(), clang::Sema::hasReachableDeclarationSlow(), and clang::Sema::hasVisibleDeclarationSlow().
|
static |
Definition at line 1693 of file SemaLookup.cpp.
References clang::Sema::getOwningModule(), and clang::Sema::isAcceptable().
|
static |
Definition at line 1771 of file SemaLookup.cpp.
References hasAcceptableDeclarationImpl(), and clang::TSK_ExplicitSpecialization.
|
static |
Definition at line 1804 of file SemaLookup.cpp.
References clang::Decl::getDeclContext(), clang::Decl::getLexicalDeclContext(), hasAcceptableDeclarationImpl(), clang::isa(), and clang::DeclContext::isFileContext().
Referenced by clang::Sema::hasReachableMemberSpecialization(), and clang::Sema::hasVisibleMemberSpecialization().
|
static |
When trying to resolve a function name, if isOpenCLBuiltin() returns a non-null <Index, Len> pair, then the name is referencing an OpenCL builtin function.
Add all candidate signatures to the LookUpResult.
S | (in) The Sema instance. |
LR | (inout) The LookupResult instance. |
II | (in) The identifier being resolved. |
FctIndex | (in) Starting index in the BuiltinTable. |
Len | (in) The signature list has Len elements. |
Definition at line 821 of file SemaLookup.cpp.
References clang::Decl::addAttr(), clang::LookupResult::addDecl(), clang::cast(), clang::Sema::Context, clang::FunctionDecl::Create(), clang::ParmVarDecl::Create(), clang::Sema::getCurFPFeatures(), clang::Sema::getLangOpts(), clang::LookupResult::getNameLoc(), GetOpenCLBuiltinFctOverloads(), clang::Sema::getPreprocessor(), GetQualTypesForOpenCLBuiltin(), clang::FPOptions::isFPConstrained(), clang::Preprocessor::isMacroDefined(), clang::LookupResult::resolveKind(), clang::SC_Extern, clang::SC_None, clang::Decl::setImplicit(), and clang::ParmVarDecl::setScopeInfo().
Referenced by clang::Sema::LookupBuiltin().
|
static |
Definition at line 4492 of file SemaLookup.cpp.
References clang::TypoCorrection::getEditDistance(), clang::TypoCorrection::InvalidDistance, clang::CorrectionCandidateCallback::RankCandidate(), and clang::TypoCorrection::setCallbackDistance().
Referenced by clang::TypoCorrectionConsumer::addCorrection().
|
static |
Determine whether this is the name of an implicitly-declared special member function.
Definition at line 1056 of file SemaLookup.cpp.
References clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXDestructorName, clang::DeclarationName::CXXOperatorName, clang::DeclarationName::getCXXOverloadedOperator(), and clang::DeclarationName::getNameKind().
Definition at line 1250 of file SemaLookup.cpp.
References clang::Scope::getEntity(), and clang::DeclContext::isFileContext().
Referenced by clang::Sema::LookupName().
|
static |
Determine whether D
is a better lookup result than Existing
, given that they declare the same entity.
Definition at line 374 of file SemaLookup.cpp.
References clang::cast(), clang::Decl::getPreviousDecl(), clang::NamedDecl::getUnderlyingDecl(), clang::Sema::hasVisibleDefaultArgument(), clang::isa(), clang::Sema::isVisible(), clang::Sema::LookupDestructorName, clang::Sema::LookupTagName, and clang::Sema::LookupUsingDeclName.
Referenced by clang::LookupResult::resolveKind().
|
static |
Definition at line 1130 of file SemaLookup.cpp.
References clang::LookupResult::addDecl(), clang::cast(), clang::CC_C, clang::Sema::Context, clang::DeclarationName::CXXConversionFunctionName, DeclareImplicitMemberFunctionsWithName(), clang::Sema::DeduceTemplateArguments(), clang::EST_None, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::Found, clang::LookupResult::getAcceptableDecl(), clang::Type::getAs(), clang::Type::getContainedDeducedType(), clang::DeclarationName::getCXXNameType(), clang::FunctionProtoType::getExtProtoInfo(), clang::ASTContext::getFunctionType(), clang::Sema::getLangOpts(), clang::LookupResult::getLookupName(), clang::DeclarationName::getNameKind(), clang::LookupResult::getNameLoc(), clang::LookupResult::getSema(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::ValueDecl::getType(), clang::isa(), clang::Type::isDependentType(), clang::LookupResult::isForRedeclaration(), clang::DeclContext::isTranslationUnit(), clang::DeclContext::lookup(), clang::Sema::LookupBuiltin(), clang::Specialization, clang::Success, and clang::FunctionType::ExtInfo::withCallingConv().
Referenced by CppNamespaceLookup(), clang::Sema::LookupQualifiedName(), and LookupQualifiedNameInUsingDirectives().
|
static |
Perform name lookup for a possible result for typo correction.
Definition at line 5061 of file SemaLookup.cpp.
References clang::LookupResult::addDecl(), clang::LookupResult::clear(), clang::LookupResult::empty(), clang::Sema::getCurMethodDecl(), clang::LookupResult::getFoundDecl(), clang::Decl::isDefinedOutsideFunctionOrMethod(), clang::LookupResult::isSingleResult(), clang::Sema::LookupParsedName(), clang::Sema::LookupQualifiedName(), clang::OBJC_PR_query_instance, clang::LookupResult::resolveKind(), clang::LookupResult::setAllowHidden(), clang::LookupResult::setLookupName(), and clang::LookupResult::suppressDiagnostics().
Looks up the declaration of "struct objc_super" and saves it for later use in building builtin declaration of objc_msgSendSuper and objc_msgSendSuper_stret.
Definition at line 997 of file SemaLookup.cpp.
References clang::Sema::Context, clang::Found, clang::Sema::LookupName(), clang::Sema::LookupTagName, and clang::Result.
Referenced by clang::Sema::LookupNecessaryTypesForBuiltin().
|
static |
Perform qualified name lookup in the namespaces nominated by using directives by the given context.
C++98 [namespace.qual]p2: Given X::m (where X is a user-declared namespace), or given ::m (where X is the global namespace), let S be the set of all declarations of m in X and in the transitive closure of all namespaces nominated by using-directives in X and its used namespaces, except that using-directives are ignored in any namespace, including X, directly containing one or more declarations of m. No namespace is searched more than once in the lookup of a name. If S is the empty set, the program is ill-formed. Otherwise, if S has exactly one member, or if the context of the reference is a using-declaration (namespace.udecl), S is the required set of declarations of m. Otherwise if the use of m is not one that allows a unique declaration to be chosen from S, the program is ill-formed.
C++98 [namespace.qual]p5: During the lookup of a qualified namespace member name, if the lookup finds more than one declaration of the member, and if one declaration introduces a class name or enumeration name and the other declarations either introduce the same object, the same enumerator or a set of functions, the non-type name hides the class or enumeration name if and only if the declarations are from the same namespace; otherwise (the declarations are from different namespaces), the program is ill-formed.
Definition at line 2352 of file SemaLookup.cpp.
References clang::LookupResult::addAllDecls(), clang::LookupResult::clear(), clang::LookupResult::empty(), clang::Found, clang::DeclContext::isFileContext(), clang::LookupResult::isSingleTagDecl(), clang::Sema::isVisible(), LookupDirect(), clang::LookupResult::resolveKind(), clang::LookupResult::setAmbiguousQualifiedTagHiding(), clang::LookupResult::Temporary, and clang::DeclContext::using_directives().
Referenced by clang::Sema::LookupQualifiedName().
|
static |
Definition at line 4698 of file SemaLookup.cpp.
Referenced by clang::TypoCorrectionConsumer::addCorrection().