Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flang] Remove GCC 7.2 workarounds #73574

Merged
merged 1 commit into from
Dec 4, 2023
Merged

Conversation

brad0
Copy link
Contributor

@brad0 brad0 commented Nov 27, 2023

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

https://reviews.llvm.org/D156286

@llvmbot llvmbot added flang Flang issues not falling into any other category flang:semantics labels Nov 27, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Nov 27, 2023

@llvm/pr-subscribers-flang-semantics

Author: Brad Smith (brad0)

Changes

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 --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);
 }

Copy link

github-actions bot commented Nov 27, 2023

✅ With the latest revision this PR passed the C/C++ code formatter.

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

https://reviews.llvm.org/D156286
@brad0
Copy link
Contributor Author

brad0 commented Dec 2, 2023

Ping.

@brad0 brad0 merged commit 74e59e7 into llvm:main Dec 4, 2023
3 checks passed
@brad0 brad0 deleted the flang_gcc_7.2_workaround branch December 4, 2023 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:semantics flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants