[clang] 0fe0d11 - Revert "[OpenMP] Introduce the `disable_selector_propagation` variant selector trait"
Johannes Doerfert via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 11 21:48:55 PST 2021
Author: Johannes Doerfert
Date: 2021-03-11T23:48:35-06:00
New Revision: 0fe0d114e41c5e3448d88f4353b4047351f26be0
URL: https://github.com/llvm/llvm-project/commit/0fe0d114e41c5e3448d88f4353b4047351f26be0
DIFF: https://github.com/llvm/llvm-project/commit/0fe0d114e41c5e3448d88f4353b4047351f26be0.diff
LOG: Revert "[OpenMP] Introduce the `disable_selector_propagation` variant selector trait"
Need to revert ad9e98b8efa0138559eb640023695dab54967a8d which this
commit depends on.
This reverts commit f771ef7b5f0ed260d00931cd50e6fe462edbacaf.
Added:
Modified:
clang/include/clang/Basic/AttrDocs.td
clang/lib/Parse/ParseOpenMP.cpp
clang/test/OpenMP/begin_declare_variant_nested_propagation.c
clang/test/OpenMP/declare_variant_messages.c
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td
index f5be90e54fb4..b1a80752b650 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -4007,9 +4007,8 @@ Clang provides the following context selector extensions, used via
match_all
match_any
match_none
- allow_templates
disable_implicit_base
- disable_selector_propagation
+ allow_templates
The match extensions change when the *entire* context selector is considered a
match for an OpenMP context. The default is ``all``, with ``none`` no trait in the
@@ -4026,8 +4025,7 @@ The allow extensions change when the ``begin declare variant`` effect is
applied to a definition. If ``allow_templates`` is given, template function
definitions are considered as specializations of existing or assumed template
declarations with the same name. The template parameters for the base functions
-are used to instantiate the specialization. If ``disable_selector_propagation``
-is given, the context selector is not propagated to nested ones.
+are used to instantiate the specialization.
}];
}
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 7f4c1ba8c3ac..dd98e89313df 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -948,10 +948,6 @@ static bool checkExtensionProperty(Parser &P, SourceLocation Loc,
TraitProperty::implementation_extension_disable_implicit_base)
return true;
- if (TIProperty.Kind ==
- TraitProperty::implementation_extension_disable_selector_propagation)
- return true;
-
if (TIProperty.Kind ==
TraitProperty::implementation_extension_allow_templates)
return true;
@@ -1464,11 +1460,7 @@ bool Parser::parseOMPDeclareVariantMatchClause(SourceLocation Loc,
return false;
// Merge the parent/outer trait info into the one we just parsed and diagnose
- // problems. Can be disabled by the disable_selector_propagation extension.
- if (ParentTI->isExtensionActive(
- llvm::omp::TraitProperty::
- implementation_extension_disable_selector_propagation))
- return false;
+ // problems.
// TODO: Keep some source location in the TI to provide better diagnostics.
// TODO: Perform some kind of equivalence check on the condition and score
// expressions.
diff --git a/clang/test/OpenMP/begin_declare_variant_nested_propagation.c b/clang/test/OpenMP/begin_declare_variant_nested_propagation.c
index efb5b507644a..e0dee1110922 100644
--- a/clang/test/OpenMP/begin_declare_variant_nested_propagation.c
+++ b/clang/test/OpenMP/begin_declare_variant_nested_propagation.c
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -triple=x86_64-pc-win32 -verify -fopenmp -x c -std=c99 -fms-extensions -Wno-pragma-pack %s
+// expected-no-diagnostics
#pragma omp begin declare variant match(user={condition(1)}, device={kind(cpu)}, implementation={extension(match_any)})
#pragma omp begin declare variant match(device = {kind(cpu, fpga)})
@@ -11,18 +12,3 @@
this is never reached
#pragma omp end declare variant
#pragma omp end declare variant
-
-#pragma omp begin declare variant match(implementation={extension(disable_implicit_base, disable_selector_propagation)})
-
- void without_implicit_base() {}
-
-#pragma omp begin declare variant match(implementation = {vendor(llvm)})
- void with_implicit_base() {}
-#pragma omp end declare variant
-
-#pragma omp end declare variant
-
- void test() {
- without_implicit_base(); // expected-warning{{implicit declaration of function 'without_implicit_base' is invalid in C99}}
- with_implicit_base();
- }
diff --git a/clang/test/OpenMP/declare_variant_messages.c b/clang/test/OpenMP/declare_variant_messages.c
index e48b2ec3f368..1fad74b12d1e 100644
--- a/clang/test/OpenMP/declare_variant_messages.c
+++ b/clang/test/OpenMP/declare_variant_messages.c
@@ -170,14 +170,6 @@ void caller() {
int conflicting_nested_score(void);
#pragma omp end declare variant
-#pragma omp begin declare variant match(implementation = {vendor(score(1) \
- : llvm),extension(disable_selector_propagation)})
-#pragma omp declare variant(foo) match(implementation = {vendor(score(2) \
- : llvm)})
-int conflicting_nested_score_no_prop(void);
-#pragma omp end declare variant
-
-
// FIXME: We should build the conjuction of
diff erent conditions, see also the score fixme above.
#pragma omp begin declare variant match(user = {condition(1)})
#pragma omp declare variant(foo) match(user = {condition(1)}) // expected-error {{nested user conditions in OpenMP context selector not supported (yet)}}
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
index 5c1b01556314..75d360bf4237 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
@@ -1057,7 +1057,6 @@ __OMP_TRAIT_PROPERTY(implementation, extension, match_any)
__OMP_TRAIT_PROPERTY(implementation, extension, match_none)
__OMP_TRAIT_PROPERTY(implementation, extension, disable_implicit_base)
__OMP_TRAIT_PROPERTY(implementation, extension, allow_templates)
-__OMP_TRAIT_PROPERTY(implementation, extension, disable_selector_propagation)
__OMP_TRAIT_SET(user)
More information about the cfe-commits
mailing list