Skip to content

Commit

Permalink
[flang][OpenMP] Make Symbol::OmpFlagToClauseName static (llvm#113586)
Browse files Browse the repository at this point in the history
It doesn't need the Symbol object for anything.
  • Loading branch information
kparzysz authored and NoumanAmir657 committed Nov 4, 2024
1 parent f167137 commit 0c838e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion flang/include/flang/Semantics/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ class Symbol {
void set_offset(std::size_t offset) { offset_ = offset; }
// Give the symbol a name with a different source location but same chars.
void ReplaceName(const SourceName &);
std::string OmpFlagToClauseName(Flag ompFlag);
static std::string OmpFlagToClauseName(Flag ompFlag);

// Does symbol have this type of details?
template <typename D> bool has() const {
Expand Down
7 changes: 3 additions & 4 deletions flang/lib/Semantics/resolve-directives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2320,7 +2320,7 @@ void OmpAttributeVisitor::ResolveOmpObject(
if (auto *symbol{ResolveOmp(*name, ompFlag, currScope())}) {
auto checkExclusivelists =
[&](const Symbol *symbol1, Symbol::Flag firstOmpFlag,
Symbol *symbol2, Symbol::Flag secondOmpFlag) {
const Symbol *symbol2, Symbol::Flag secondOmpFlag) {
if ((symbol1->test(firstOmpFlag) &&
symbol2->test(secondOmpFlag)) ||
(symbol1->test(secondOmpFlag) &&
Expand All @@ -2330,9 +2330,8 @@ void OmpAttributeVisitor::ResolveOmpObject(
"appear on both %s and %s "
"clauses on a %s construct"_err_en_US,
symbol2->name(),
const_cast<Symbol *>(symbol1)->OmpFlagToClauseName(
firstOmpFlag),
symbol2->OmpFlagToClauseName(secondOmpFlag),
Symbol::OmpFlagToClauseName(firstOmpFlag),
Symbol::OmpFlagToClauseName(secondOmpFlag),
parser::ToUpperCaseLetters(
llvm::omp::getOpenMPDirectiveName(
GetContext().directive)
Expand Down

0 comments on commit 0c838e0

Please sign in to comment.