diff options
author | Steve Naroff <snaroff@apple.com> | 2009-01-28 16:09:22 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-01-28 16:09:22 +0000 |
commit | 133147d2d31bdcd6943635f80e77d78d2504148f (patch) | |
tree | e746f9d50323335cc30097d3a23f5f5858b9186f | |
parent | 939837f67e0558668be9afec67f2e51eb40d86f0 (diff) |
Remove 'NamespaceNameOnly' argument to Sema::LookupDecl(). It is unused.
Even though Sema::LookupDecl() is deprecated, it's still used all over the place. Simplifying the interface will make it easier to understand/optimize/convert.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63210 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/Sema.h | 3 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 16 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 3 | ||||
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 4 |
5 files changed, 11 insertions, 17 deletions
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 65b18d2ddf..9206dd53c9 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -784,8 +784,7 @@ public: DeclarationName Name, LookupCriteria Criteria); LookupResult LookupDecl(DeclarationName Name, unsigned NSI, Scope *S, const DeclContext *LookupCtx = 0, - bool LookInParent = true, - bool NamespaceNameOnly = false); + bool LookInParent = true); bool DiagnoseAmbiguousLookup(LookupResult &Result, DeclarationName Name, SourceLocation NameLoc, diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 7746917e3b..e0cb526c60 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -215,7 +215,7 @@ void Sema::ActOnPopScope(SourceLocation Loc, Scope *S) { ObjCInterfaceDecl *Sema::getObjCInterfaceDecl(IdentifierInfo *Id) { // The third "scope" argument is 0 since we aren't enabling lazy built-in // creation from this context. - Decl *IDecl = LookupDecl(Id, Decl::IDNS_Ordinary, 0, false); + Decl *IDecl = LookupDecl(Id, Decl::IDNS_Ordinary, 0); return dyn_cast_or_null<ObjCInterfaceDecl>(IDecl); } @@ -263,14 +263,10 @@ Scope *Sema::getNonFieldDeclScope(Scope *S) { Sema::LookupResult Sema::LookupDecl(DeclarationName Name, unsigned NSI, Scope *S, const DeclContext *LookupCtx, - bool LookInParent, - bool NamespaceNameOnly) { + bool LookInParent) { LookupCriteria::NameKind Kind; if (NSI == Decl::IDNS_Ordinary) { - if (NamespaceNameOnly) - Kind = LookupCriteria::Namespace; - else - Kind = LookupCriteria::Ordinary; + Kind = LookupCriteria::Ordinary; } else if (NSI == Decl::IDNS_Tag) Kind = LookupCriteria::Tag; else { @@ -780,7 +776,7 @@ bool Sema::InjectAnonymousStructOrUnionMembers(Scope *S, DeclContext *Owner, F != FEnd; ++F) { if ((*F)->getDeclName()) { Decl *PrevDecl = LookupDecl((*F)->getDeclName(), Decl::IDNS_Ordinary, - S, Owner, false, false); + S, Owner, false); if (PrevDecl && !isa<TagDecl>(PrevDecl)) { // C++ [class.union]p2: // The names of the members of an anonymous union shall be @@ -3235,7 +3231,7 @@ Sema::DeclTy *Sema::ActOnField(Scope *S, DeclTy *TagD, if (II) { Decl *PrevDecl - = LookupDecl(II, Decl::IDNS_Member, S, 0, false, false); + = LookupDecl(II, Decl::IDNS_Member, S, 0, false); if (PrevDecl && isDeclInScope(PrevDecl, CurContext, S) && !isa<TagDecl>(PrevDecl)) { Diag(Loc, diag::err_duplicate_member) << II; @@ -3328,7 +3324,7 @@ Sema::DeclTy *Sema::ActOnIvar(Scope *S, if (II) { Decl *PrevDecl - = LookupDecl(II, Decl::IDNS_Member, S, 0, false, false); + = LookupDecl(II, Decl::IDNS_Member, S, 0, false); if (PrevDecl && isDeclInScope(PrevDecl, CurContext, S) && !isa<TagDecl>(PrevDecl)) { Diag(Loc, diag::err_duplicate_member) << II; diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 48d62729dc..770404d82a 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -4034,7 +4034,7 @@ Sema::ExprResult Sema::ActOnBuiltinOffsetOf(Scope *S, FieldDecl *MemberDecl = dyn_cast_or_null<FieldDecl>(LookupDecl(OC.U.IdentInfo, Decl::IDNS_Ordinary, - S, RD, false, false).getAsDecl()); + S, RD, false).getAsDecl()); if (!MemberDecl) return Diag(BuiltinLoc, diag::err_typecheck_no_member) << OC.U.IdentInfo << SourceRange(OC.LocStart, OC.LocEnd); diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index ee40a30ff1..55317db502 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -61,8 +61,7 @@ Sema::ActOnCXXTypeid(SourceLocation OpLoc, SourceLocation LParenLoc, return Diag(OpLoc, diag::err_need_header_before_typeid); IdentifierInfo *TypeInfoII = &PP.getIdentifierTable().get("type_info"); - Decl *TypeInfoDecl = LookupDecl(TypeInfoII, Decl::IDNS_Tag, - 0, StdNs, /*createBuiltins=*/false); + Decl *TypeInfoDecl = LookupDecl(TypeInfoII, Decl::IDNS_Tag, 0, StdNs); RecordDecl *TypeInfoRecordDecl = dyn_cast_or_null<RecordDecl>(TypeInfoDecl); if (!TypeInfoRecordDecl) return Diag(OpLoc, diag::err_need_header_before_typeid); diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index f0aa3b76a5..eff259d8fa 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -210,7 +210,7 @@ Sema::ExprResult Sema::ActOnClassMessage( } else { // 'super' has been used outside a method context. If a variable named // 'super' has been declared, redirect. If not, produce a diagnostic. - Decl *SuperDecl = LookupDecl(receiverName, Decl::IDNS_Ordinary, S, false); + Decl *SuperDecl = LookupDecl(receiverName, Decl::IDNS_Ordinary, S); ValueDecl *VD = dyn_cast_or_null<ValueDecl>(SuperDecl); if (VD) { ExprResult ReceiverExpr = new DeclRefExpr(VD, VD->getType(), @@ -235,7 +235,7 @@ Sema::ExprResult Sema::ActOnClassMessage( // // If necessary, the following lookup could move to getObjCInterfaceDecl(). if (!ClassDecl) { - Decl *IDecl = LookupDecl(receiverName, Decl::IDNS_Ordinary, 0, false); + Decl *IDecl = LookupDecl(receiverName, Decl::IDNS_Ordinary, 0); if (TypedefDecl *OCTD = dyn_cast_or_null<TypedefDecl>(IDecl)) { const ObjCInterfaceType *OCIT; OCIT = OCTD->getUnderlyingType()->getAsObjCInterfaceType(); |