diff options
author | John McCall <rjmccall@apple.com> | 2012-10-17 04:53:31 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-10-17 04:53:31 +0000 |
commit | 0d54a17b52bfb5cd20ac39e8d9e5b0533f4aa08c (patch) | |
tree | 294032f34e34e9e41f292efdc74eac565b80e282 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | ef19dbb62031b20798badebc9d11ae0fa369a3c0 (diff) | |
download | bcm5719-llvm-0d54a17b52bfb5cd20ac39e8d9e5b0533f4aa08c.tar.gz bcm5719-llvm-0d54a17b52bfb5cd20ac39e8d9e5b0533f4aa08c.zip |
Set a special flag in class metadata when an Objective-C class
has ivars that require destruction, but none that require anything
except zero-initialization. This is common in ARC and (when true
throughout a class hierarchy) permits the elimination of an
unnecessary message-send during allocation.
llvm-svn: 166088
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index e9344a1351b..95753d540e7 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -2541,7 +2541,7 @@ void CodeGenModule::EmitObjCIvarInitializations(ObjCImplementationDecl *D) { /*isDefined=*/false, ObjCMethodDecl::Required); D->addInstanceMethod(DTORMethod); CodeGenFunction(*this).GenerateObjCCtorDtorMethod(D, DTORMethod, false); - D->setHasCXXStructors(true); + D->setHasDestructors(true); } // If the implementation doesn't have any ivar initializers, we don't need @@ -2565,7 +2565,7 @@ void CodeGenModule::EmitObjCIvarInitializations(ObjCImplementationDecl *D) { ObjCMethodDecl::Required); D->addInstanceMethod(CTORMethod); CodeGenFunction(*this).GenerateObjCCtorDtorMethod(D, CTORMethod, true); - D->setHasCXXStructors(true); + D->setHasNonZeroConstructors(true); } /// EmitNamespace - Emit all declarations in a namespace. |