aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/AST/DeclarationName.h20
-rw-r--r--lib/AST/DeclarationName.cpp3
2 files changed, 3 insertions, 20 deletions
diff --git a/include/clang/AST/DeclarationName.h b/include/clang/AST/DeclarationName.h
index bc9f674f3c..77e5024e37 100644
--- a/include/clang/AST/DeclarationName.h
+++ b/include/clang/AST/DeclarationName.h
@@ -132,26 +132,6 @@ private:
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) { }
diff --git a/lib/AST/DeclarationName.cpp b/lib/AST/DeclarationName.cpp
index c1077c189b..3815a08a65 100644
--- a/lib/AST/DeclarationName.cpp
+++ b/lib/AST/DeclarationName.cpp
@@ -63,16 +63,19 @@ DeclarationName::DeclarationName(Selector Sel) {
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;
}