]> granicus.if.org Git - clang/commitdiff
Remove 'NamespaceNameOnly' argument to Sema::LookupDecl(). It is unused.
authorSteve Naroff <snaroff@apple.com>
Wed, 28 Jan 2009 16:09:22 +0000 (16:09 +0000)
committerSteve Naroff <snaroff@apple.com>
Wed, 28 Jan 2009 16:09:22 +0000 (16:09 +0000)
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

lib/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaExprObjC.cpp

index 65b18d2ddf762e1e0236bc4356be9b90b06c6a9a..9206dd53c919a045ef3dc614def6d3793b851333 100644 (file)
@@ -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, 
index 7746917e3b9d895473b4b727bb2cc2283ee2abd0..e0cb526c6012ce304595886e21310dc8c576c4fa 100644 (file)
@@ -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;
index 48d62729dc96575a735736d4fe2ba4c088c400c4..770404d82ac1fd5bfe7a5b1dcdb5a94cf972f376 100644 (file)
@@ -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);
index ee40a30ff1c21d1b75399e613276173849ca2014..55317db5024b5576a2c68da8d962ce628b0eba72 100644 (file)
@@ -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);
index f0aa3b76a594f39a2ef97a6ba323351abbafd6ff..eff259d8faf5417656595b4107d5fd101e7aa87a 100644 (file)
@@ -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();