Skip to content

Commit

Permalink
[flang] Remove GCC 7.2 workarounds (llvm#73574)
Browse files Browse the repository at this point in the history
The minimum GCC version was bumped from 7.1 to 7.4 so garbage collect
the 7.2 workarounds.

https://reviews.llvm.org/D156286
  • Loading branch information
brad0 authored Dec 4, 2023
1 parent b935f1a commit 74e59e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 34 deletions.
20 changes: 2 additions & 18 deletions flang/lib/Evaluate/variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,15 +567,7 @@ template <typename T> BaseObject Designator<T>::GetBaseObject() const {
common::visitors{
[](SymbolRef symbol) { return BaseObject{symbol}; },
[](const Substring &sstring) { return sstring.GetBaseObject(); },
[](const auto &x) {
#if !__clang__ && __GNUC__ == 7 && __GNUC_MINOR__ == 2
if constexpr (std::is_same_v<std::decay_t<decltype(x)>,
Substring>) {
return x.GetBaseObject();
} else
#endif
return BaseObject{x.GetFirstSymbol()};
},
[](const auto &x) { return BaseObject{x.GetFirstSymbol()}; },
},
u);
}
Expand All @@ -585,15 +577,7 @@ template <typename T> const Symbol *Designator<T>::GetLastSymbol() const {
common::visitors{
[](SymbolRef symbol) { return &*symbol; },
[](const Substring &sstring) { return sstring.GetLastSymbol(); },
[](const auto &x) {
#if !__clang__ && __GNUC__ == 7 && __GNUC_MINOR__ == 2
if constexpr (std::is_same_v<std::decay_t<decltype(x)>,
Substring>) {
return x.GetLastSymbol();
} else
#endif
return &x.GetLastSymbol();
},
[](const auto &x) { return &x.GetLastSymbol(); },
},
u);
}
Expand Down
20 changes: 4 additions & 16 deletions flang/lib/Semantics/symbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,22 +733,10 @@ bool GenericKind::IsOperator() const {

std::string GenericKind::ToString() const {
return common::visit(
common::visitors {
[](const OtherKind &x) { return std::string{EnumToString(x)}; },
[](const common::DefinedIo &x) { return AsFortran(x).ToString(); },
#if !__clang__ && __GNUC__ == 7 && __GNUC_MINOR__ == 2
[](const common::NumericOperator &x) {
return std::string{common::EnumToString(x)};
},
[](const common::LogicalOperator &x) {
return std::string{common::EnumToString(x)};
},
[](const common::RelationalOperator &x) {
return std::string{common::EnumToString(x)};
},
#else
[](const auto &x) { return std::string{common::EnumToString(x)}; },
#endif
common::visitors{
[](const OtherKind &x) { return std::string{EnumToString(x)}; },
[](const common::DefinedIo &x) { return AsFortran(x).ToString(); },
[](const auto &x) { return std::string{common::EnumToString(x)}; },
},
u);
}
Expand Down

0 comments on commit 74e59e7

Please sign in to comment.