target constructs.
Prevent compilation of the classes with the virtual tables when
compiling for the device.
llvm-svn: 342741
// Do not mark as used if compiling for the device outside of the target
// region.
if (LangOpts.OpenMP && LangOpts.OpenMPIsDevice &&
- !isInOpenMPDeclareTargetContext() && !getCurFunctionDecl())
+ !isInOpenMPDeclareTargetContext() &&
+ !isInOpenMPTargetExecutionDirective())
return;
// Try to insert this class into the map.
template class Bake<int>;
#pragma omp end declare target
+struct BaseNonT {
+ virtual ~BaseNonT() {}
+};
+
+#pragma omp declare target
+struct BakeNonT {
+ virtual ~BakeNonT() {}
+};
+#pragma omp end declare target
+
// CHECK-DAG: declare extern_weak signext i32 @__create()
// CHECK-NOT: define {{.*}}{{baz1|baz4|maini1|Base}}