@@ -491,15 +491,12 @@ namespace {
491
491
cast<CXXMethodDecl>(CGF.CurCodeDecl )->getParent ();
492
492
493
493
const CXXDestructorDecl *D = BaseClass->getDestructor ();
494
- // We are already inside a destructor, so presumably the object being
495
- // destroyed should have the expected type.
496
- QualType ThisTy = D->getThisObjectType ();
497
494
Address Addr =
498
495
CGF.GetAddressOfDirectBaseInCompleteClass (CGF.LoadCXXThisAddress (),
499
496
DerivedClass, BaseClass,
500
497
BaseIsVirtual);
501
498
CGF.EmitCXXDestructorCall (D, Dtor_Base, BaseIsVirtual,
502
- /* Delegating=*/ false , Addr, ThisTy );
499
+ /* Delegating=*/ false , Addr);
503
500
}
504
501
};
505
502
@@ -1443,11 +1440,9 @@ void CodeGenFunction::EmitDestructorBody(FunctionArgList &Args) {
1443
1440
if (DtorType == Dtor_Deleting) {
1444
1441
RunCleanupsScope DtorEpilogue (*this );
1445
1442
EnterDtorCleanups (Dtor, Dtor_Deleting);
1446
- if (HaveInsertPoint ()) {
1447
- QualType ThisTy = Dtor->getThisObjectType ();
1443
+ if (HaveInsertPoint ())
1448
1444
EmitCXXDestructorCall (Dtor, Dtor_Complete, /* ForVirtualBase=*/ false ,
1449
- /* Delegating=*/ false , LoadCXXThisAddress (), ThisTy);
1450
- }
1445
+ /* Delegating=*/ false , LoadCXXThisAddress ());
1451
1446
return ;
1452
1447
}
1453
1448
@@ -1478,9 +1473,8 @@ void CodeGenFunction::EmitDestructorBody(FunctionArgList &Args) {
1478
1473
EnterDtorCleanups (Dtor, Dtor_Complete);
1479
1474
1480
1475
if (!isTryBody) {
1481
- QualType ThisTy = Dtor->getThisObjectType ();
1482
1476
EmitCXXDestructorCall (Dtor, Dtor_Base, /* ForVirtualBase=*/ false ,
1483
- /* Delegating=*/ false , LoadCXXThisAddress (), ThisTy );
1477
+ /* Delegating=*/ false , LoadCXXThisAddress ());
1484
1478
break ;
1485
1479
}
1486
1480
@@ -2019,7 +2013,7 @@ void CodeGenFunction::destroyCXXObject(CodeGenFunction &CGF,
2019
2013
const CXXDestructorDecl *dtor = record->getDestructor ();
2020
2014
assert (!dtor->isTrivial ());
2021
2015
CGF.EmitCXXDestructorCall (dtor, Dtor_Complete, /* for vbase*/ false ,
2022
- /* Delegating=*/ false , addr, type );
2016
+ /* Delegating=*/ false , addr);
2023
2017
}
2024
2018
2025
2019
void CodeGenFunction::EmitCXXConstructorCall (const CXXConstructorDecl *D,
@@ -2369,11 +2363,8 @@ namespace {
2369
2363
: Dtor(D), Addr(Addr), Type(Type) {}
2370
2364
2371
2365
void Emit (CodeGenFunction &CGF, Flags flags) override {
2372
- // We are calling the destructor from within the constructor.
2373
- // Therefore, "this" should have the expected type.
2374
- QualType ThisTy = Dtor->getThisObjectType ();
2375
2366
CGF.EmitCXXDestructorCall (Dtor, Type, /* ForVirtualBase=*/ false ,
2376
- /* Delegating=*/ true , Addr, ThisTy );
2367
+ /* Delegating=*/ true , Addr);
2377
2368
}
2378
2369
};
2379
2370
} // end anonymous namespace
@@ -2411,32 +2402,31 @@ CodeGenFunction::EmitDelegatingCXXConstructorCall(const CXXConstructorDecl *Ctor
2411
2402
void CodeGenFunction::EmitCXXDestructorCall (const CXXDestructorDecl *DD,
2412
2403
CXXDtorType Type,
2413
2404
bool ForVirtualBase,
2414
- bool Delegating, Address This,
2415
- QualType ThisTy ) {
2405
+ bool Delegating,
2406
+ Address This ) {
2416
2407
CGM.getCXXABI ().EmitDestructorCall (*this , DD, Type, ForVirtualBase,
2417
- Delegating, This, ThisTy );
2408
+ Delegating, This);
2418
2409
}
2419
2410
2420
2411
namespace {
2421
2412
struct CallLocalDtor final : EHScopeStack::Cleanup {
2422
2413
const CXXDestructorDecl *Dtor;
2423
2414
Address Addr;
2424
- QualType Ty;
2425
2415
2426
- CallLocalDtor (const CXXDestructorDecl *D, Address Addr, QualType Ty )
2427
- : Dtor(D), Addr(Addr), Ty(Ty ) {}
2416
+ CallLocalDtor (const CXXDestructorDecl *D, Address Addr)
2417
+ : Dtor(D), Addr(Addr) {}
2428
2418
2429
2419
void Emit (CodeGenFunction &CGF, Flags flags) override {
2430
2420
CGF.EmitCXXDestructorCall (Dtor, Dtor_Complete,
2431
2421
/* ForVirtualBase=*/ false ,
2432
- /* Delegating=*/ false , Addr, Ty );
2422
+ /* Delegating=*/ false , Addr);
2433
2423
}
2434
2424
};
2435
2425
} // end anonymous namespace
2436
2426
2437
2427
void CodeGenFunction::PushDestructorCleanup (const CXXDestructorDecl *D,
2438
- QualType T, Address Addr) {
2439
- EHStack.pushCleanup <CallLocalDtor>(NormalAndEHCleanup, D, Addr, T );
2428
+ Address Addr) {
2429
+ EHStack.pushCleanup <CallLocalDtor>(NormalAndEHCleanup, D, Addr);
2440
2430
}
2441
2431
2442
2432
void CodeGenFunction::PushDestructorCleanup (QualType T, Address Addr) {
@@ -2446,7 +2436,7 @@ void CodeGenFunction::PushDestructorCleanup(QualType T, Address Addr) {
2446
2436
2447
2437
const CXXDestructorDecl *D = ClassDecl->getDestructor ();
2448
2438
assert (D && D->isUsed () && " destructor not marked as used!" );
2449
- PushDestructorCleanup (D, T, Addr);
2439
+ PushDestructorCleanup (D, Addr);
2450
2440
}
2451
2441
2452
2442
void CodeGenFunction::InitializeVTablePointer (const VPtr &Vptr) {
0 commit comments