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
diff --git a/lib/Sema/IdentifierResolver.cpp b/lib/Sema/IdentifierResolver.cpp
index 609c872..10eec7a 100644
--- a/lib/Sema/IdentifierResolver.cpp
+++ b/lib/Sema/IdentifierResolver.cpp
@@ -231,18 +231,16 @@
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();
}
//===----------------------------------------------------------------------===//