Simplify the code a bit, NFC.

hasConstructorVariants is always true for MS and false for Itanium.

llvm-svn: 217809
This commit is contained in:
Rafael Espindola 2014-09-15 19:24:44 +00:00
parent fe5a5f6124
commit d48b51be23
2 changed files with 4 additions and 21 deletions

View File

@ -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(

View File

@ -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);