Skip to content

Commit 8af42a6

Browse files
committed
[flang] Add missing #include for MSVC
I moved a function to Evaluate/tools.cpp in an attempt to dodge some MSVC compiler issue but didn't add an include directive for Evaluate/tools.h to Evaluate/constant.cpp.
1 parent e27e9ca commit 8af42a6

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

flang/include/flang/Evaluate/tools.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@ bool IsVarSubexpressionOf(
15221522
std::optional<Expr<SomeType>> GetConvertInput(const Expr<SomeType> &x);
15231523

15241524
// How many ancestors does have a derived type have?
1525-
std::optional<int> DerivedTypeDepth(const semantics::Scope &);
1525+
std::optional<int> GetDerivedTypeDepth(const semantics::Scope &);
15261526

15271527
} // namespace Fortran::evaluate
15281528

flang/lib/Evaluate/constant.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "flang/Evaluate/constant.h"
1010
#include "flang/Evaluate/expression.h"
1111
#include "flang/Evaluate/shape.h"
12+
#include "flang/Evaluate/tools.h"
1213
#include "flang/Evaluate/type.h"
1314
#include <string>
1415

@@ -392,8 +393,8 @@ std::size_t Constant<SomeDerived>::CopyFrom(const Constant<SomeDerived> &source,
392393
bool ComponentCompare::operator()(SymbolRef x, SymbolRef y) const {
393394
if (&x->owner() != &y->owner()) {
394395
// Not components of the same derived type; put ancestors' components first.
395-
if (auto xDepth{DerivedTypeDepth(x->owner())}) {
396-
if (auto yDepth{DerivedTypeDepth(y->owner())}) {
396+
if (auto xDepth{GetDerivedTypeDepth(x->owner())}) {
397+
if (auto yDepth{GetDerivedTypeDepth(y->owner())}) {
397398
if (*xDepth != *yDepth) {
398399
return *xDepth < *yDepth;
399400
}

flang/lib/Evaluate/tools.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,7 @@ bool IsVarSubexpressionOf(
19501950
return VariableFinder{sub}(super);
19511951
}
19521952

1953-
std::optional<int> DerivedTypeDepth(const semantics::Scope &scope) {
1953+
std::optional<int> GetDerivedTypeDepth(const semantics::Scope &scope) {
19541954
if (scope.IsDerivedType()) {
19551955
for (auto iter{scope.cbegin()}; iter != scope.cend(); ++iter) {
19561956
const Symbol &symbol{*iter->second};
@@ -1962,7 +1962,7 @@ std::optional<int> DerivedTypeDepth(const semantics::Scope &scope) {
19621962
parent = derived->typeSymbol().scope();
19631963
}
19641964
if (parent) {
1965-
if (auto parentDepth{DerivedTypeDepth(*parent)}) {
1965+
if (auto parentDepth{GetDerivedTypeDepth(*parent)}) {
19661966
return 1 + *parentDepth;
19671967
}
19681968
}

0 commit comments

Comments
 (0)