-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[flang][OpenMP] Implement OmpDirectiveName, use in OmpDirectiveSpecif… #130121
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -253,6 +253,21 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const Name &x) { | |
| return os << x.ToString(); | ||
| } | ||
|
|
||
| OmpDirectiveName::OmpDirectiveName(const Verbatim &name) { | ||
| std::string_view nameView{name.source.begin(), name.source.size()}; | ||
| std::string nameLower{ToLowerCaseLetters(nameView)}; | ||
| // If the name was actually "unknown" then accept it, otherwise flag | ||
|
||
| // OMPD_unknown (the default return value from getOpenMPDirectiveKind) | ||
| // as an error. | ||
| if (nameLower != "unknown") { | ||
| v = llvm::omp::getOpenMPDirectiveKind(nameLower); | ||
| assert(v != llvm::omp::Directive::OMPD_unknown && "Unrecognized directive"); | ||
| } else { | ||
| v = llvm::omp::Directive::OMPD_unknown; | ||
| } | ||
| source = name.source; | ||
| } | ||
|
|
||
| OmpDependenceType::Value OmpDoacross::GetDepType() const { | ||
| return common::visit( // | ||
| common::visitors{ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my understanding, this is basically just a way to get to the .v (Directive) of the outer directive struct, becuse we used to directly store the id and without the wrapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's the
.vpart, but in a form of a parser, so that it is composable with other parsers.