[cfe-commits] r66996 - in /cfe/trunk: include/clang/AST/DeclarationName.h lib/AST/DeclarationName.cpp

Ted Kremenek kremenek at apple.com
Fri Mar 13 17:27:41 PDT 2009


Author: kremenek
Date: Fri Mar 13 19:27:40 2009
New Revision: 66996

URL: http://llvm.org/viewvc/llvm-project?rev=66996&view=rev
Log:
Remove dead DeclarationName constructors that involving knowing about the
internal implementation of Selector.

Modified:
    cfe/trunk/include/clang/AST/DeclarationName.h
    cfe/trunk/lib/AST/DeclarationName.cpp

Modified: cfe/trunk/include/clang/AST/DeclarationName.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclarationName.h?rev=66996&r1=66995&r2=66996&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclarationName.h (original)
+++ cfe/trunk/include/clang/AST/DeclarationName.h Fri Mar 13 19:27:40 2009
@@ -132,26 +132,6 @@
     Ptr |= StoredDeclarationNameExtra;
   }
 
-  // Construct a declaration name from a zero- or one-argument
-  // Objective-C selector.
-  DeclarationName(IdentifierInfo *II, unsigned numArgs) 
-    : Ptr(reinterpret_cast<uintptr_t>(II)) {
-    assert((Ptr & PtrMask) == 0 && "Improperly aligned IdentifierInfo");
-    assert(numArgs < 2 && "Use MultiKeywordSelector for >= 2 arguments");
-    if (numArgs == 0)
-      Ptr |= StoredObjCZeroArgSelector;
-    else
-      Ptr |= StoredObjCOneArgSelector;
-  }
-
-  // Construct a declaration name from an Objective-C multiple-keyword
-  // selector.
-  DeclarationName(MultiKeywordSelector *SI)
-    : Ptr(reinterpret_cast<uintptr_t>(SI)) {
-    assert((Ptr & PtrMask) == 0 && "Improperly aligned MultiKeywordSelector");
-    Ptr |= StoredDeclarationNameExtra;
-  }
-
   /// Construct a declaration name from a raw pointer.
   DeclarationName(uintptr_t Ptr) : Ptr(Ptr) { }
 

Modified: cfe/trunk/lib/AST/DeclarationName.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclarationName.cpp?rev=66996&r1=66995&r2=66996&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclarationName.cpp (original)
+++ cfe/trunk/lib/AST/DeclarationName.cpp Fri Mar 13 19:27:40 2009
@@ -63,16 +63,19 @@
   switch (Sel.getNumArgs()) {
   case 0:
     Ptr = reinterpret_cast<uintptr_t>(Sel.getAsIdentifierInfo());
+    assert((Ptr & PtrMask) == 0 && "Improperly aligned IdentifierInfo");
     Ptr |= StoredObjCZeroArgSelector;
     break;
 
   case 1:
     Ptr = reinterpret_cast<uintptr_t>(Sel.getAsIdentifierInfo());
+    assert((Ptr & PtrMask) == 0 && "Improperly aligned IdentifierInfo");
     Ptr |= StoredObjCOneArgSelector;
     break;
 
   default:
     Ptr = Sel.InfoPtr & ~Selector::ArgFlags;
+    assert((Ptr & PtrMask) == 0 && "Improperly aligned MultiKeywordSelector");
     Ptr |= StoredDeclarationNameExtra;
     break;
   }





More information about the cfe-commits mailing list