diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-04 06:34:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-04 06:34:08 +0000 |
commit | 0b2b6e1cb1573bb295c0a65813dc4df8d57f305b (patch) | |
tree | 589229ea4c46c0f00d28e87cec88880fd2c107be /lib/Sema/IdentifierResolver.cpp | |
parent | 63d1d60e853e6af6b48b1a8cdb93835a7e86f32e (diff) |
Switch attributes to be allocated from the declcontext bump pointer just like
decls. This reduces the number of calls to malloc on cocoa.h with pth and
-disable-free from 15958 to 12444 times (down ~3500).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66023 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/IdentifierResolver.cpp')
-rw-r--r-- | lib/Sema/IdentifierResolver.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Sema/IdentifierResolver.cpp b/lib/Sema/IdentifierResolver.cpp index 609c872395..10eec7afb9 100644 --- a/lib/Sema/IdentifierResolver.cpp +++ b/lib/Sema/IdentifierResolver.cpp @@ -231,18 +231,16 @@ IdentifierResolver::begin(DeclarationName Name) { void *Ptr = Name.getFETokenInfo<void>(); if (!Ptr) return end(); - if (isDeclPtr(Ptr)) { - NamedDecl *D = static_cast<NamedDecl*>(Ptr); - return iterator(D); - } + if (isDeclPtr(Ptr)) + return iterator(static_cast<NamedDecl*>(Ptr)); IdDeclInfo *IDI = toIdDeclInfo(Ptr); IdDeclInfo::DeclsTy::iterator I = IDI->decls_end(); if (I != IDI->decls_begin()) return iterator(I-1); - else // No decls found. - return end(); + // No decls found. + return end(); } //===----------------------------------------------------------------------===// |