[flang] Support <name>=<integer> syntax in compiler directives

Accept name=value as part of a !DIR$ compiler directive.  These
are currently ignored in semantics, but we should recognize
more directive forms to facilitate testing.  In due course,
these placeholding directive parsers will be replaced.

Reviewed By: sscalpone

Differential Revision: https://reviews.llvm.org/D84077
This commit is contained in:
peter klausler
2020-07-17 16:36:59 -07:00
parent 0dfa4a83fa
commit 8e2b4e50f2
4 changed files with 16 additions and 3 deletions

View File

@@ -1761,7 +1761,9 @@ public:
Word("!DIR$ IGNORE_TKR"); // emitted even if tkr list is empty
Walk(" ", tkr, ", ");
},
[&](const std::list<Name> &names) { Walk("!DIR$ ", names, " "); },
[&](const std::list<CompilerDirective::NameValue> &names) {
Walk("!DIR$ ", names, " ");
},
},
x.u);
Put('\n');
@@ -1777,6 +1779,10 @@ public:
}
Walk(std::get<Name>(x.t));
}
void Unparse(const CompilerDirective::NameValue &x) {
Walk(std::get<Name>(x.t));
Walk("=", std::get<std::optional<std::uint64_t>>(x.t));
}
// OpenACC Directives & Clauses
void Unparse(const AccAtomicCapture &x) {