summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Sema.h
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-12-18 10:40:03 +0000
committerJohn McCall <rjmccall@apple.com>2009-12-18 10:40:03 +0000
commitea305edd63da4b03f49df6e31fd35a8fd3b7c5a8 (patch)
tree8529afaf67fa9786e9eb0eea43e8877d20385993 /clang/lib/Sema/Sema.h
parent86b9d75dc892f301561521a105bce06e0389dde9 (diff)
downloadbcm5719-llvm-ea305edd63da4b03f49df6e31fd35a8fd3b7c5a8.tar.gz
bcm5719-llvm-ea305edd63da4b03f49df6e31fd35a8fd3b7c5a8.zip
Pull Sema::isAcceptableLookupResult into SemaLookup. Extract the criteria into
different functions and pick the function at lookup initialization time. In theory we could actually divide the criteria functions into N different functions for the N cases, but it's so not worth it. Among other things, lets us invoke LookupQualifiedName without recomputing IDNS info every time. Do some refactoring in SemaDecl to avoid an awkward special case in LQN that was only necessary for redeclaration testing for anonymous structs/unions --- which could be done more efficiently with a scoped lookup anyway. llvm-svn: 91676
Diffstat (limited to 'clang/lib/Sema/Sema.h')
-rw-r--r--clang/lib/Sema/Sema.h34
1 files changed, 0 insertions, 34 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h
index 9d40a13786b..24101c67029 100644
--- a/clang/lib/Sema/Sema.h
+++ b/clang/lib/Sema/Sema.h
@@ -613,10 +613,6 @@ public:
const LookupResult &Previous,
Scope *S);
void DiagnoseFunctionSpecifiers(Declarator& D);
- bool CheckRedeclaration(DeclContext *DC,
- DeclarationName Name,
- SourceLocation NameLoc,
- unsigned Diagnostic);
NamedDecl* ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC,
QualType R, TypeSourceInfo *TInfo,
LookupResult &Previous, bool &Redeclaration);
@@ -1176,36 +1172,6 @@ private:
bool CppLookupName(LookupResult &R, Scope *S);
public:
- /// Determines whether D is a suitable lookup result according to the
- /// lookup criteria.
- static bool isAcceptableLookupResult(NamedDecl *D, LookupNameKind NameKind,
- unsigned IDNS) {
- switch (NameKind) {
- case Sema::LookupOrdinaryName:
- case Sema::LookupTagName:
- case Sema::LookupMemberName:
- case Sema::LookupRedeclarationWithLinkage: // FIXME: check linkage, scoping
- case Sema::LookupUsingDeclName:
- case Sema::LookupObjCProtocolName:
- case Sema::LookupObjCImplementationName:
- return D->isInIdentifierNamespace(IDNS);
-
- case Sema::LookupOperatorName:
- return D->isInIdentifierNamespace(IDNS) &&
- !D->getDeclContext()->isRecord();
-
- case Sema::LookupNestedNameSpecifierName:
- return isa<TypedefDecl>(D) || D->isInIdentifierNamespace(Decl::IDNS_Tag);
-
- case Sema::LookupNamespaceName:
- return isa<NamespaceDecl>(D) || isa<NamespaceAliasDecl>(D);
- }
-
- assert(false &&
- "isAcceptableLookupResult always returns before this point");
- return false;
- }
-
/// \brief Look up a name, looking for a single declaration. Return
/// null if the results were absent, ambiguous, or overloaded.
///
OpenPOWER on IntegriCloud