[flang-commits] [flang] [flang] Remove GCC 7.2 workarounds (PR #73574)

via flang-commits flang-commits at lists.llvm.org
Mon Nov 27 14:15:26 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-semantics

Author: Brad Smith (brad0)

<details>
<summary>Changes</summary>

The minimum GCC version was bumped from 7.1 to 7.4 so garbage collect
the 7.2 workarounds.

https://reviews.llvm.org/D156286

---
Full diff: https://github.com/llvm/llvm-project/pull/73574.diff


2 Files Affected:

- (modified) flang/lib/Evaluate/variable.cpp (-12) 
- (modified) flang/lib/Semantics/symbol.cpp (-12) 


``````````diff
diff --git a/flang/lib/Evaluate/variable.cpp b/flang/lib/Evaluate/variable.cpp
index 29483b103054c83..b184240a7423246 100644
--- a/flang/lib/Evaluate/variable.cpp
+++ b/flang/lib/Evaluate/variable.cpp
@@ -568,12 +568,6 @@ template <typename T> BaseObject Designator<T>::GetBaseObject() const {
           [](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()};
           },
       },
@@ -586,12 +580,6 @@ template <typename T> const Symbol *Designator<T>::GetLastSymbol() const {
           [](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();
           },
       },
diff --git a/flang/lib/Semantics/symbol.cpp b/flang/lib/Semantics/symbol.cpp
index 2ce8e83e4771467..2eae96af0623d7b 100644
--- a/flang/lib/Semantics/symbol.cpp
+++ b/flang/lib/Semantics/symbol.cpp
@@ -736,19 +736,7 @@ std::string GenericKind::ToString() const {
       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
       },
       u);
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/73574


More information about the flang-commits mailing list