D90752 adds an extra enum entry for ompt_scope_endpoint_t, which makes the related switch statement incomplete.
Also adding cases for newly added barrier variants.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
openmp/tools/archer/ompt-tsan.cpp | ||
---|---|---|
670 | I don't get these changes. Don't we just silently ignore other endpoint values now? Does it make sense to make it explicit? |
openmp/tools/archer/ompt-tsan.cpp | ||
---|---|---|
558 | Keeping the switch here would look like: switch (endpoint) { case ompt_scope_begin: case ompt_scope_beginend: ... if (endpoint == ompt_scope_begin) break; [[fallthrough]] case ompt_scope_end: ... | |
670 | I can go back to the switch statement and list ompt_scope_beginend explicitly. For this callback, ompt_scope_beginend cannot be used according to the OpenMP spec. |
What do you think about adding assertions or warnings for the cases that "should not happen"?
openmp/tools/archer/ompt-tsan.cpp | ||
---|---|---|
670 | can we at least use an assert or warning or something? |
I acknowledge the advantage of switch statements, in that they will warn on missing cases in the future. So, I went back to the switch statements.
Regarding the assertions for the cases, which should not happen: I think, this should be covered by the OMPT tests. The OMPT tests fail, if such unexpected callback arguments are passed. Archer can just happily ignore these cases and I added comments for this.
Keeping the switch here would look like: