Reduce code duplication a bit more. NFC.

llvm-svn: 217813
This commit is contained in:
Rafael Espindola 2014-09-15 19:43:47 +00:00
parent 4d57159c09
commit ede1e7d490
2 changed files with 2 additions and 24 deletions

View File

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

View File

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