Skip to content

Commit a852a3e

Browse files
committed
CR feedback
1 parent d74fc8a commit a852a3e

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8548,10 +8548,10 @@ class Sema final : public SemaBase {
85488548
ImplicitDeallocationParameters,
85498549
DeclarationName Name,
85508550
bool Diagnose = true);
8551-
FunctionDecl *
8552-
FindDeallocationFunctionForDestructor(SourceLocation StartLoc,
8553-
CXXRecordDecl *RD, bool Diagnose = true,
8554-
bool LookForGlobal = false);
8551+
FunctionDecl *FindDeallocationFunctionForDestructor(SourceLocation StartLoc,
8552+
CXXRecordDecl *RD,
8553+
bool Diagnose,
8554+
bool LookForGlobal);
85558555

85568556
/// ActOnCXXDelete - Parsed a C++ 'delete' expression (C++ 5.3.5), as in:
85578557
/// @code ::delete ptr; @endcode

clang/lib/CodeGen/CGClass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,9 +1613,9 @@ namespace {
16131613
assert(OD->isDestroyingOperatorDelete() == ReturnAfterDelete &&
16141614
"unexpected value for ReturnAfterDelete");
16151615
auto *CondTy = cast<llvm::IntegerType>(ShouldDeleteCondition->getType());
1616-
// MSVC calls global operator delete inside of dtor body, but clang aligned
1617-
// with this behavior only after a particular version and started emitting
1618-
// code that is not ABI-compatible with previous versions.
1616+
// MSVC calls global operator delete inside of the dtor body, but clang
1617+
// aligned with this behavior only after a particular version. This is not
1618+
// ABI-compatible with previous versions.
16191619
ASTContext &Context = CGF.getContext();
16201620
bool CallGlobDelete =
16211621
Context.getTargetInfo().callGlobalDeleteInDeletingDtor(

clang/lib/CodeGen/MicrosoftCXXABI.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,12 +2030,12 @@ llvm::Value *MicrosoftCXXABI::EmitVirtualDestructorCall(
20302030
CGCallee Callee = CGCallee::forVirtual(CE, GD, This, Ty);
20312031

20322032
ASTContext &Context = getContext();
2033-
llvm::Value *ImplicitParam = llvm::ConstantInt::get(
2034-
llvm::IntegerType::getInt32Ty(CGF.getLLVMContext()),
2035-
(DtorType == Dtor_Deleting) |
2036-
4 * (D && D->isGlobalDelete() &&
2037-
Context.getTargetInfo().callGlobalDeleteInDeletingDtor(
2038-
Context.getLangOpts())));
2033+
bool IsDeleting = DtorType == Dtor_Deleting;
2034+
bool IsGlobalDelete = D && D->isGlobalDelete() &&
2035+
Context.getTargetInfo().callGlobalDeleteInDeletingDtor(
2036+
Context.getLangOpts());
2037+
llvm::Value *ImplicitParam =
2038+
CGF.Builder.getInt32((IsDeleting ? 1 : 0) | (IsGlobalDelete ? 4 : 0));
20392039

20402040
QualType ThisTy;
20412041
if (CE) {

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11123,8 +11123,8 @@ bool Sema::CheckDestructor(CXXDestructorDecl *Destructor) {
1112311123
Loc = RD->getLocation();
1112411124

1112511125
// If we have a virtual destructor, look up the deallocation function
11126-
if (FunctionDecl *OperatorDelete =
11127-
FindDeallocationFunctionForDestructor(Loc, RD)) {
11126+
if (FunctionDecl *OperatorDelete = FindDeallocationFunctionForDestructor(
11127+
Loc, RD, /*Diagnose=*/true, /*LookForGlobal=*/false)) {
1112811128
Expr *ThisArg = nullptr;
1112911129

1113011130
// If the notional 'delete this' expression requires a non-trivial

0 commit comments

Comments
 (0)