From: Rafael Espindola Date: Mon, 15 Sep 2014 19:24:44 +0000 (+0000) Subject: Simplify the code a bit, NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87db5aed474a95612044118330a9997406a40b98;p=clang Simplify the code a bit, NFC. hasConstructorVariants is always true for MS and false for Itanium. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217809 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/ItaniumCXXABI.cpp b/lib/CodeGen/ItaniumCXXABI.cpp index 877d32cc5f..b897abc2c0 100644 --- a/lib/CodeGen/ItaniumCXXABI.cpp +++ b/lib/CodeGen/ItaniumCXXABI.cpp @@ -3002,13 +3002,8 @@ ItaniumCXXABI::RTTIUniquenessKind ItaniumCXXABI::classifyRTTIUniqueness( static void emitCXXConstructor(CodeGenModule &CGM, const CXXConstructorDecl *ctor, StructorType ctorType) { - if (!CGM.getTarget().getCXXABI().hasConstructorVariants()) { - // If there are no constructor variants, always emit the complete - // destructor. - ctorType = StructorType::Complete; - } else if (!ctor->getParent()->getNumVBases() && - (ctorType == StructorType::Complete || - ctorType == StructorType::Base)) { + if (!ctor->getParent()->getNumVBases() && + (ctorType == StructorType::Complete || ctorType == StructorType::Base)) { // The complete constructor is equivalent to the base constructor // for classes with no virtual bases. Try to emit it as an alias. bool ProducedAlias = !CGM.TryEmitDefinitionAsAlias( diff --git a/lib/CodeGen/MicrosoftCXXABI.cpp b/lib/CodeGen/MicrosoftCXXABI.cpp index 51446bba74..9324b20a4f 100644 --- a/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/lib/CodeGen/MicrosoftCXXABI.cpp @@ -2876,20 +2876,8 @@ MicrosoftCXXABI::getMSCompleteObjectLocator(const CXXRecordDecl *RD, static void emitCXXConstructor(CodeGenModule &CGM, const CXXConstructorDecl *ctor, StructorType ctorType) { - if (!CGM.getTarget().getCXXABI().hasConstructorVariants()) { - // If there are no constructor variants, always emit the complete - // destructor. - ctorType = StructorType::Complete; - } else if (!ctor->getParent()->getNumVBases() && - (ctorType == StructorType::Complete || - ctorType == StructorType::Base)) { - // The complete constructor is equivalent to the base constructor - // for classes with no virtual bases. Try to emit it as an alias. - bool ProducedAlias = !CGM.TryEmitDefinitionAsAlias( - GlobalDecl(ctor, Ctor_Complete), GlobalDecl(ctor, Ctor_Base), true); - if (ctorType == StructorType::Complete && ProducedAlias) - return; - } + // There are no constructor variants, always emit the complete destructor. + ctorType = StructorType::Complete; const CGFunctionInfo &fnInfo = CGM.getTypes().arrangeCXXStructorDeclaration(ctor, ctorType);