From f898d1de4a256ad9f2702682bb28715d16503c7a Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 21 Sep 2018 14:55:26 +0000 Subject: [OPENMP] Disable emission of the class with vptr if they are not used in target constructs. Prevent compilation of the classes with the virtual tables when compiling for the device. llvm-svn: 342741 --- clang/lib/Sema/SemaDeclCXX.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Sema') diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index fd0f4874592..95ad45d4954 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -14918,7 +14918,8 @@ void Sema::MarkVTableUsed(SourceLocation Loc, CXXRecordDecl *Class, // 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. -- cgit v1.2.3