diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-05-04 18:24:37 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-05-04 18:24:37 +0000 |
commit | 93a586fa90de8d567743c7e04095c72019283e73 (patch) | |
tree | 15c9a951e85e93e3adca146cba616459a4adf7b3 /clang/lib/AST/DeclarationName.cpp | |
parent | 06a48a62b39b480c6c4cc96fcbfa83c296a6477a (diff) | |
download | bcm5719-llvm-93a586fa90de8d567743c7e04095c72019283e73.tar.gz bcm5719-llvm-93a586fa90de8d567743c7e04095c72019283e73.zip |
Synchronize the representations of DeclarationName and Selector so
that bridging between the two is free. Saves ~4k of code size,
although I don't see any measurable performance difference
(unfortunately).
llvm-svn: 156187
Diffstat (limited to 'clang/lib/AST/DeclarationName.cpp')
-rw-r--r-- | clang/lib/AST/DeclarationName.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/clang/lib/AST/DeclarationName.cpp b/clang/lib/AST/DeclarationName.cpp index 895cd5193a0..9eadf325437 100644 --- a/clang/lib/AST/DeclarationName.cpp +++ b/clang/lib/AST/DeclarationName.cpp @@ -135,33 +135,6 @@ int DeclarationName::compare(DeclarationName LHS, DeclarationName RHS) { } // end namespace clang -DeclarationName::DeclarationName(Selector Sel) { - if (!Sel.getAsOpaquePtr()) { - Ptr = 0; - return; - } - - 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; - } -} - DeclarationName::NameKind DeclarationName::getNameKind() const { switch (getStoredNameKind()) { case StoredIdentifier: return Identifier; @@ -305,24 +278,6 @@ IdentifierInfo *DeclarationName::getCXXLiteralIdentifier() const { return 0; } -Selector DeclarationName::getObjCSelector() const { - switch (getNameKind()) { - case ObjCZeroArgSelector: - return Selector(reinterpret_cast<IdentifierInfo *>(Ptr & ~PtrMask), 0); - - case ObjCOneArgSelector: - return Selector(reinterpret_cast<IdentifierInfo *>(Ptr & ~PtrMask), 1); - - case ObjCMultiArgSelector: - return Selector(reinterpret_cast<MultiKeywordSelector *>(Ptr & ~PtrMask)); - - default: - break; - } - - return Selector(); -} - void *DeclarationName::getFETokenInfoAsVoidSlow() const { switch (getNameKind()) { case Identifier: |