diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-20 19:11:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-20 19:11:22 +0000 |
commit | 5af2f35c6ad1cb78b2aed3705d221954d1689b8a (patch) | |
tree | d1b84c94cc069b225b2d1c9c2beae4f0d8d2144e /lib/Sema | |
parent | 4f0c90ff1fea80e4b1997b3cdcc02a0ee5a2110d (diff) |
Optimize Declarator to avoid malloc/free traffic for the argument list of a
function DeclaratorChunk in common cases. This uses a fixed array in
Declarator when it is small enough for the first function declarator chunk
in a declarator.
This eliminates all malloc/free traffic from DeclaratorChunk::getFunction
when running on Cocoa.h except for five functions: signal/bsd_signal/sigset,
which have multiple Function DeclChunk's, and
CFUUIDCreateWithBytes/CFUUIDGetConstantUUIDWithBytes, which take more than
16 arguments.
This patch was pair programmed with Steve.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62599 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 6f731ca548..c91d174d65 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2772,7 +2772,7 @@ NamedDecl *Sema::ImplicitlyDefineFunction(SourceLocation Loc, Error = Error; // Silence warning. assert(!Error && "Error setting up implicit decl!"); Declarator D(DS, Declarator::BlockContext); - D.AddTypeInfo(DeclaratorChunk::getFunction(false, false, 0, 0, 0, Loc)); + D.AddTypeInfo(DeclaratorChunk::getFunction(false, false, 0, 0, 0, Loc, D)); D.SetIdentifier(&II, Loc); // Insert this function into translation-unit scope. |