diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-01-09 19:42:16 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-01-09 19:42:16 +0000 |
commit | 6037fcba3431b47de1a994c9b286feac17894eff (patch) | |
tree | dda557567a56f1f2133a97c91453537a9cc7a1b9 /lib/Sema/SemaDeclObjC.cpp | |
parent | a8cc8ce044e5d2589128f0c1a84e586cce743b27 (diff) |
Replace DeclContext's vector of ScopedDecl pointers with a linked list
of ScopedDecls (using the new ScopedDecl::NextDeclInScope
pointer). Performance-wise:
- It's a net win in memory utilization, since DeclContext is now one
pointer smaller than it used to be (std::vectors are typically 3
pointers; we now use 2 pointers) and
- Parsing Cocoa.h with -fsyntax-only (with a Release-Asserts Clang)
is about 1.9% faster than before, most likely because we no longer
have the memory allocations and copying associated with the
std::vector.
I'll re-enable serialization of DeclContexts once I've sorted out the
NextDeclarator/NextDeclInScope question.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62001 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index f39b84c270..49a8c835c5 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1078,6 +1078,7 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property, ObjCPropertyDecl::Optional) ? ObjCMethodDecl::Optional : ObjCMethodDecl::Required); + CD->addDecl(Context, GetterMethod); } else // A user declared getter will be synthesize when @synthesize of // the property with the same name is seen in the @implementation @@ -1108,6 +1109,7 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property, VarDecl::None, 0, 0); SetterMethod->setMethodParams(&Argument, 1); + CD->addDecl(Context, SetterMethod); } else // A user declared setter will be synthesize when @synthesize of // the property with the same name is seen in the @implementation @@ -1126,14 +1128,10 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property, // double bar = [foo bar]; // } // - if (GetterMethod) { - CD->addDecl(Context, GetterMethod); + if (GetterMethod) AddInstanceMethodToGlobalPool(GetterMethod); - } - if (SetterMethod) { - CD->addDecl(Context, SetterMethod); + if (SetterMethod) AddInstanceMethodToGlobalPool(SetterMethod); - } } // Note: For class/category implemenations, allMethods/allProperties is |