Skip to content

Commit 4bf8199

Browse files
committed
IsSameAllocation/AreSameAllocation
1 parent 2b557ad commit 4bf8199

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

flang/lib/Semantics/check-allocate.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ static bool HaveCompatibleLengths(
470470
}
471471
}
472472

473-
bool IsSameAllocation(const SomeExpr *root, const SomeExpr *path) {
473+
bool AreSameAllocation(const SomeExpr *root, const SomeExpr *path) {
474474
if (root && path) {
475475
// For now we just use equality of expressions. If we implement a more
476476
// sophisticated alias analysis we should use it here.
@@ -712,11 +712,11 @@ bool AllocationCheckerHelper::RunChecks(SemanticsContext &context) {
712712
}
713713

714714
if (const SomeExpr *allocObj{GetExpr(context, allocateObject_)}) {
715-
if (IsSameAllocation(allocObj, allocateInfo_.statVar)) {
715+
if (AreSameAllocation(allocObj, allocateInfo_.statVar)) {
716716
context.Say(allocateInfo_.statSource.value_or(name_.source),
717717
"STAT variable in ALLOCATE must not be the variable being allocated"_err_en_US);
718718
}
719-
if (IsSameAllocation(allocObj, allocateInfo_.msgVar)) {
719+
if (AreSameAllocation(allocObj, allocateInfo_.msgVar)) {
720720
context.Say(allocateInfo_.msgSource.value_or(name_.source),
721721
"ERRMSG variable in ALLOCATE must not be the variable being allocated"_err_en_US);
722722
}

flang/lib/Semantics/check-allocate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ class AllocateChecker : public virtual BaseChecker {
2424
private:
2525
SemanticsContext &context_;
2626
};
27-
bool IsSameAllocation(const SomeExpr *root, const SomeExpr *path);
27+
bool AreSameAllocation(const SomeExpr *root, const SomeExpr *path);
2828
} // namespace Fortran::semantics
2929
#endif // FORTRAN_SEMANTICS_CHECK_ALLOCATE_H_

flang/lib/Semantics/check-deallocate.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ void DeallocateChecker::Leave(const parser::DeallocateStmt &deallocateStmt) {
135135
},
136136
allocateObject.u);
137137
if (const SomeExpr *allocObj{GetExpr(context_, allocateObject)}) {
138-
if (IsSameAllocation(allocObj, statVar)) {
138+
if (AreSameAllocation(allocObj, statVar)) {
139139
context_.Say(statSource.value_or(source),
140140
"STAT variable in DEALLOCATE must not be the variable being deallocated"_err_en_US);
141141
}
142-
if (IsSameAllocation(allocObj, msgVar)) {
142+
if (AreSameAllocation(allocObj, msgVar)) {
143143
context_.Say(msgSource.value_or(source),
144144
"ERRMSG variable in DEALLOCATE must not be the variable being deallocated"_err_en_US);
145145
}

0 commit comments

Comments
 (0)