summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-09-15 19:24:44 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-09-15 19:24:44 +0000
commitd48b51be23b5627ef7ec81e2f060e6ce1912657f (patch)
treedd90654c2bf815f9f836877c6bd56de06444ae87 /clang
parentfe5a5f6124c68b7da8529ad02fca2a176485dc09 (diff)
downloadbcm5719-llvm-d48b51be23b5627ef7ec81e2f060e6ce1912657f.tar.gz
bcm5719-llvm-d48b51be23b5627ef7ec81e2f060e6ce1912657f.zip
Simplify the code a bit, NFC.
hasConstructorVariants is always true for MS and false for Itanium. llvm-svn: 217809
Diffstat (limited to 'clang')
-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