[cfe-commits] r63210 - in /cfe/trunk/lib/Sema: Sema.h SemaDecl.cpp SemaExpr.cpp SemaExprCXX.cpp SemaExprObjC.cpp

Steve Naroff snaroff at apple.com
Wed Jan 28 08:09:22 PST 2009


Author: snaroff
Date: Wed Jan 28 10:09:22 2009
New Revision: 63210

URL: http://llvm.org/viewvc/llvm-project?rev=63210&view=rev
Log:
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.


Modified:
    cfe/trunk/lib/Sema/Sema.h
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/lib/Sema/SemaExpr.cpp
    cfe/trunk/lib/Sema/SemaExprCXX.cpp
    cfe/trunk/lib/Sema/SemaExprObjC.cpp

Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=63210&r1=63209&r2=63210&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Wed Jan 28 10:09:22 2009
@@ -784,8 +784,7 @@
                                 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, 

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=63210&r1=63209&r2=63210&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Jan 28 10:09:22 2009
@@ -215,7 +215,7 @@
 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 @@
 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 @@
        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 @@
 
   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 @@
   
   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;

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=63210&r1=63209&r2=63210&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Jan 28 10:09:22 2009
@@ -4034,7 +4034,7 @@
     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);

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=63210&r1=63209&r2=63210&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Wed Jan 28 10:09:22 2009
@@ -61,8 +61,7 @@
     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);

Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=63210&r1=63209&r2=63210&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Wed Jan 28 10:09:22 2009
@@ -210,7 +210,7 @@
     } 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 @@
   //
   // 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();





More information about the cfe-commits mailing list