From 9772000a2250e81654b97f8e54904a96a20c4a86 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 11 Nov 2014 04:05:39 +0000 Subject: [OPENMP] Codegen for threadprivate variables For all threadprivate variables which have constructor/destructor emit call to void __kmpc_threadprivate_register(ident_t * , void *, kmpc_ctor , kmpc_cctor NULL, kmpc_dtor ); In expressions all references to such variables are replaced by calls to void *__kmpc_threadprivate_cached(ident_t *, kmp_int32 , void *, size_t , void ***); Test test/OpenMP/threadprivate_codegen.cpp checks that codegen is correct. Also it checks that codegen is correct after serialization/deserialization and one of passes verifies debug info. Differential Revision: http://reviews.llvm.org/D4002 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit llvm-svn: 221663 --- clang/lib/AST/ASTContext.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/AST/ASTContext.cpp') diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index dd67c9f73d3..ae72c5853ce 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -7904,7 +7904,9 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) { // We never need to emit an uninstantiated function template. if (FD->getTemplatedKind() == FunctionDecl::TK_FunctionTemplate) return false; - } else + } else if (isa(D)) + return true; + else return false; // If this is a member of a class template, we do not need to emit it. -- cgit v1.2.3