summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-20 19:11:22 +0000
committerChris Lattner <sabre@nondot.org>2009-01-20 19:11:22 +0000
commit1ce41edd8da47d7c438c18a819ced3237a2f49f7 (patch)
treecdc57b07696a11d253611686b05a923a5435b89f /clang/lib/Sema/SemaDecl.cpp
parent72854c3811e7c952e3f26e5eed6b51a49dd218be (diff)
downloadbcm5719-llvm-1ce41edd8da47d7c438c18a819ced3237a2f49f7.tar.gz
bcm5719-llvm-1ce41edd8da47d7c438c18a819ced3237a2f49f7.zip
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. llvm-svn: 62599
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 6f731ca5480..c91d174d654 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud