summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/CodeGen/ItaniumCXXABI.cpp9
-rw-r--r--clang/lib/CodeGen/MicrosoftCXXABI.cpp16
2 files changed, 4 insertions, 21 deletions
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index 877d32cc5f8..b897abc2c04 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/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/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index 51446bba744..9324b20a4f3 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud