diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/Type.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/ItaniumCXXABI.cpp | 22 |
2 files changed, 2 insertions, 22 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 2555ab31fb..b32908bc8f 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -2239,7 +2239,7 @@ QualType::DestructionKind QualType::isDestructedTypeImpl(QualType type) { /// with non-trivial destructors. const CXXRecordDecl *record = type->getBaseElementTypeUnsafe()->getAsCXXRecordDecl(); - if (record && !record->hasTrivialDestructor()) + if (record && record->hasDefinition() && !record->hasTrivialDestructor()) return DK_cxx_destructor; return DK_none; diff --git a/lib/CodeGen/ItaniumCXXABI.cpp b/lib/CodeGen/ItaniumCXXABI.cpp index db891db22b..4a10f9ccad 100644 --- a/lib/CodeGen/ItaniumCXXABI.cpp +++ b/lib/CodeGen/ItaniumCXXABI.cpp @@ -829,27 +829,7 @@ bool ItaniumCXXABI::NeedsArrayCookie(const CXXDeleteExpr *expr, if (expr->doesUsualArrayDeleteWantSize()) return true; - // Automatic Reference Counting: - // We need an array cookie for pointers with strong or weak lifetime. - if (getContext().getLangOptions().ObjCAutoRefCount && - elementType->isObjCLifetimeType()) { - switch (elementType.getObjCLifetime()) { - case Qualifiers::OCL_None: - case Qualifiers::OCL_ExplicitNone: - case Qualifiers::OCL_Autoreleasing: - return false; - - case Qualifiers::OCL_Strong: - case Qualifiers::OCL_Weak: - return true; - } - } - - // Otherwise, if the class has a non-trivial destructor, it always - // needs a cookie. - const CXXRecordDecl *record = - elementType->getBaseElementTypeUnsafe()->getAsCXXRecordDecl(); - return (record && !record->hasTrivialDestructor()); + return elementType.isDestructedType(); } CharUnits ItaniumCXXABI::GetArrayCookieSize(const CXXNewExpr *expr) { |