r217809 - Simplify the code a bit, NFC.
Rafael Espindola
rafael.espindola at gmail.com
Mon Sep 15 12:24:44 PDT 2014
Author: rafael
Date: Mon Sep 15 14:24:44 2014
New Revision: 217809
URL: http://llvm.org/viewvc/llvm-project?rev=217809&view=rev
Log:
Simplify the code a bit, NFC.
hasConstructorVariants is always true for MS and false for Itanium.
Modified:
cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
Modified: cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp?rev=217809&r1=217808&r2=217809&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp (original)
+++ cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp Mon Sep 15 14:24:44 2014
@@ -3002,13 +3002,8 @@ ItaniumCXXABI::RTTIUniquenessKind Itaniu
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(
Modified: cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp?rev=217809&r1=217808&r2=217809&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp (original)
+++ cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp Mon Sep 15 14:24:44 2014
@@ -2876,20 +2876,8 @@ MicrosoftCXXABI::getMSCompleteObjectLoca
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);
More information about the cfe-commits
mailing list