summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-09-15 19:43:47 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-09-15 19:43:47 +0000
commitede1e7d490b4e38cacbffcfcd15666a15c50cf4b (patch)
tree4fa2f4c0870c0e33d503f2913471e29f536b8461 /clang/lib
parent4d57159c09b226a5608a26c1bc57f7b66cb80a24 (diff)
downloadbcm5719-llvm-ede1e7d490b4e38cacbffcfcd15666a15c50cf4b.tar.gz
bcm5719-llvm-ede1e7d490b4e38cacbffcfcd15666a15c50cf4b.zip
Reduce code duplication a bit more. NFC.
llvm-svn: 217813
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/ItaniumCXXABI.cpp13
-rw-r--r--clang/lib/CodeGen/MicrosoftCXXABI.cpp13
2 files changed, 2 insertions, 24 deletions
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index 22839cd0fae..91e9d4d7a08 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -3038,18 +3038,7 @@ static void emitCXXDestructor(CodeGenModule &CGM, const CXXDestructorDecl *dtor,
if (dtorType == StructorType::Base && !CGM.TryEmitBaseDestructorAsAlias(dtor))
return;
- const CGFunctionInfo &fnInfo =
- CGM.getTypes().arrangeCXXStructorDeclaration(dtor, dtorType);
-
- auto *fn = cast<llvm::Function>(
- CGM.getAddrOfCXXStructor(dtor, dtorType, &fnInfo, nullptr, true));
-
- GlobalDecl GD(dtor, toCXXDtorType(dtorType));
- CGM.setFunctionLinkage(GD, fn);
- CodeGenFunction(CGM).GenerateCode(GD, fn, fnInfo);
-
- CGM.setFunctionDefinitionAttributes(dtor, fn);
- CGM.SetLLVMFunctionAttributesForDefinition(dtor, fn);
+ CGM.codegenCXXStructor(dtor, dtorType);
}
void ItaniumCXXABI::emitCXXStructor(const CXXMethodDecl *MD,
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index 42cb29c8b44..36392bc5ed0 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -2903,18 +2903,7 @@ static void emitCXXDestructor(CodeGenModule &CGM, const CXXDestructorDecl *dtor,
if (dtorType == StructorType::Base && !CGM.TryEmitBaseDestructorAsAlias(dtor))
return;
- const CGFunctionInfo &fnInfo =
- CGM.getTypes().arrangeCXXStructorDeclaration(dtor, dtorType);
-
- auto *fn = cast<llvm::Function>(
- CGM.getAddrOfCXXStructor(dtor, dtorType, &fnInfo, nullptr, true));
-
- GlobalDecl GD(dtor, toCXXDtorType(dtorType));
- CGM.setFunctionLinkage(GD, fn);
- CodeGenFunction(CGM).GenerateCode(GD, fn, fnInfo);
-
- CGM.setFunctionDefinitionAttributes(dtor, fn);
- CGM.SetLLVMFunctionAttributesForDefinition(dtor, fn);
+ CGM.codegenCXXStructor(dtor, dtorType);
}
void MicrosoftCXXABI::emitCXXStructor(const CXXMethodDecl *MD,
OpenPOWER on IntegriCloud