Skip to content

Commit e2e7d56

Browse files
authored
[flang][OpenMP] Make Symbol::OmpFlagToClauseName static (#113586)
It doesn't need the Symbol object for anything.
1 parent 5d07162 commit e2e7d56

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

flang/include/flang/Semantics/symbol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ class Symbol {
778778
void set_offset(std::size_t offset) { offset_ = offset; }
779779
// Give the symbol a name with a different source location but same chars.
780780
void ReplaceName(const SourceName &);
781-
std::string OmpFlagToClauseName(Flag ompFlag);
781+
static std::string OmpFlagToClauseName(Flag ompFlag);
782782

783783
// Does symbol have this type of details?
784784
template <typename D> bool has() const {

flang/lib/Semantics/resolve-directives.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,7 +2320,7 @@ void OmpAttributeVisitor::ResolveOmpObject(
23202320
if (auto *symbol{ResolveOmp(*name, ompFlag, currScope())}) {
23212321
auto checkExclusivelists =
23222322
[&](const Symbol *symbol1, Symbol::Flag firstOmpFlag,
2323-
Symbol *symbol2, Symbol::Flag secondOmpFlag) {
2323+
const Symbol *symbol2, Symbol::Flag secondOmpFlag) {
23242324
if ((symbol1->test(firstOmpFlag) &&
23252325
symbol2->test(secondOmpFlag)) ||
23262326
(symbol1->test(secondOmpFlag) &&
@@ -2330,9 +2330,8 @@ void OmpAttributeVisitor::ResolveOmpObject(
23302330
"appear on both %s and %s "
23312331
"clauses on a %s construct"_err_en_US,
23322332
symbol2->name(),
2333-
const_cast<Symbol *>(symbol1)->OmpFlagToClauseName(
2334-
firstOmpFlag),
2335-
symbol2->OmpFlagToClauseName(secondOmpFlag),
2333+
Symbol::OmpFlagToClauseName(firstOmpFlag),
2334+
Symbol::OmpFlagToClauseName(secondOmpFlag),
23362335
parser::ToUpperCaseLetters(
23372336
llvm::omp::getOpenMPDirectiveName(
23382337
GetContext().directive)

0 commit comments

Comments
 (0)