[Openmp-commits] [PATCH] D62431: Fix OMP_TARGET_OFFLOAD parsing
Hansang Bae via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Fri May 24 15:34:56 PDT 2019
hbae created this revision.
hbae added reviewers: tlwilmar, jlpeyton, AndreyChurbanov.
hbae added a project: OpenMP.
Herald added a subscriber: jdoerfert.
Current parsing allows trailing string after the permitted value `MANDATORY|DISABLED|DEFAULT` -- e.g., `mandatorynot` is also recognized as `MANDATORY`.
Such cases should be recognized as incorrect/unknown value.
Repository:
rOMP OpenMP
https://reviews.llvm.org/D62431
Files:
runtime/src/kmp_settings.cpp
Index: runtime/src/kmp_settings.cpp
===================================================================
--- runtime/src/kmp_settings.cpp
+++ runtime/src/kmp_settings.cpp
@@ -1250,11 +1250,11 @@
if (*next == '\0')
return;
scan = next;
- if (__kmp_match_str("MANDATORY", scan, &next)) {
+ if (!__kmp_strcasecmp_with_sentinel("mandatory", scan, 0)) {
__kmp_target_offload = tgt_mandatory;
- } else if (__kmp_match_str("DISABLED", scan, &next)) {
+ } else if (!__kmp_strcasecmp_with_sentinel("disabled", scan, 0)) {
__kmp_target_offload = tgt_disabled;
- } else if (__kmp_match_str("DEFAULT", scan, &next)) {
+ } else if (!__kmp_strcasecmp_with_sentinel("default", scan, 0)) {
__kmp_target_offload = tgt_default;
} else {
KMP_WARNING(SyntaxErrorUsing, name, "DEFAULT");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62431.201351.patch
Type: text/x-patch
Size: 806 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190524/c785ab49/attachment.bin>
More information about the Openmp-commits
mailing list