Skip to content

Commit 530a889

Browse files
committed
Rename API for clarity
1 parent 716d84a commit 530a889

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

clang/include/clang/AST/DeclCXX.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2858,7 +2858,7 @@ class CXXDestructorDecl : public CXXMethodDecl {
28582858
/// Will this destructor ever be called when considering which deallocation
28592859
/// function is associated with the destructor? Can optionally be passed an
28602860
/// 'operator delete' function declaration to test against specifically.
2861-
bool isDestructorCalled(const FunctionDecl *OpDel = nullptr) const;
2861+
bool isCalledByDelete(const FunctionDecl *OpDel = nullptr) const;
28622862

28632863
CXXDestructorDecl *getCanonicalDecl() override {
28642864
return cast<CXXDestructorDecl>(FunctionDecl::getCanonicalDecl());

clang/lib/AST/DeclCXX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2969,7 +2969,7 @@ void CXXDestructorDecl::setOperatorDelete(FunctionDecl *OD, Expr *ThisArg) {
29692969
}
29702970
}
29712971

2972-
bool CXXDestructorDecl::isDestructorCalled(const FunctionDecl *OpDel) const {
2972+
bool CXXDestructorDecl::isCalledByDelete(const FunctionDecl *OpDel) const {
29732973
// C++20 [expr.delete]p6: If the value of the operand of the delete-
29742974
// expression is not a null pointer value and the selected deallocation
29752975
// function (see below) is not a destroying operator delete, the delete-

clang/lib/Sema/SemaExceptionSpec.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ CanThrowResult Sema::canThrow(const Stmt *S) {
12131213
const FunctionDecl *OperatorDelete = DE->getOperatorDelete();
12141214
if (const auto *RD = DTy->getAsCXXRecordDecl()) {
12151215
if (const CXXDestructorDecl *DD = RD->getDestructor();
1216-
DD && DD->isDestructorCalled(OperatorDelete))
1216+
DD && DD->isCalledByDelete(OperatorDelete))
12171217
CT = canCalleeThrow(*this, DE, DD);
12181218
}
12191219

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3794,7 +3794,7 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal,
37943794

37953795
if (!PointeeRD->hasIrrelevantDestructor()) {
37963796
if (CXXDestructorDecl *Dtor = LookupDestructor(PointeeRD)) {
3797-
if (Dtor->isDestructorCalled(OperatorDelete)) {
3797+
if (Dtor->isCalledByDelete(OperatorDelete)) {
37983798
MarkFunctionReferenced(StartLoc,
37993799
const_cast<CXXDestructorDecl *>(Dtor));
38003800
if (DiagnoseUseOfDecl(Dtor, StartLoc))
@@ -3836,7 +3836,7 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal,
38363836
bool IsVirtualDelete = false;
38373837
if (PointeeRD) {
38383838
if (CXXDestructorDecl *Dtor = LookupDestructor(PointeeRD)) {
3839-
if (Dtor->isDestructorCalled(OperatorDelete))
3839+
if (Dtor->isCalledByDelete(OperatorDelete))
38403840
CheckDestructorAccess(Ex.get()->getExprLoc(), Dtor,
38413841
PDiag(diag::err_access_dtor) << PointeeElem);
38423842
IsVirtualDelete = Dtor->isVirtual();

0 commit comments

Comments
 (0)