CodeGen: Declutter the emitVirtualObjectDelete interface
No functionality change intended.
llvm-svn: 221043
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index 93d5ff1..084fd3b 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -106,10 +106,8 @@
llvm::Value *Addr,
const MemberPointerType *MPT) override;
- void emitVirtualObjectDelete(CodeGenFunction &CGF,
- const FunctionDecl *OperatorDelete,
+ void emitVirtualObjectDelete(CodeGenFunction &CGF, const CXXDeleteExpr *DE,
llvm::Value *Ptr, QualType ElementType,
- bool UseGlobalDelete,
const CXXDestructorDecl *Dtor) override;
void EmitFundamentalRTTIDescriptor(QualType Type);
@@ -851,9 +849,12 @@
/// The Itanium ABI always places an offset to the complete object
/// at entry -2 in the vtable.
-void ItaniumCXXABI::emitVirtualObjectDelete(
- CodeGenFunction &CGF, const FunctionDecl *OperatorDelete, llvm::Value *Ptr,
- QualType ElementType, bool UseGlobalDelete, const CXXDestructorDecl *Dtor) {
+void ItaniumCXXABI::emitVirtualObjectDelete(CodeGenFunction &CGF,
+ const CXXDeleteExpr *DE,
+ llvm::Value *Ptr,
+ QualType ElementType,
+ const CXXDestructorDecl *Dtor) {
+ bool UseGlobalDelete = DE->isGlobalDelete();
if (UseGlobalDelete) {
// Derive the complete-object pointer, which is what we need
// to pass to the deallocation function.
@@ -873,7 +874,8 @@
// If we're supposed to call the global delete, make sure we do so
// even if the destructor throws.
- CGF.pushCallObjectDeleteCleanup(OperatorDelete, CompletePtr, ElementType);
+ CGF.pushCallObjectDeleteCleanup(DE->getOperatorDelete(), CompletePtr,
+ ElementType);
}
// FIXME: Provide a source location here even though there's no