[OPENMP] Fix crash on code emitting if errors are found.
authorAlexey Bataev <a.bataev@hotmail.com>
Wed, 18 Mar 2015 04:13:55 +0000 (04:13 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Wed, 18 Mar 2015 04:13:55 +0000 (04:13 +0000)
commit91797559acb50c46c77aa200253caefc6acdd11c
tree22dbda14214e64141e3ff1f658a192e053434bd1
parent4deaac780c9e84aeb46fa9d4ce75870d95f6e436
[OPENMP] Fix crash on code emitting if errors are found.

Codegen for threadprivate variables (and in some other cases) may cause crash of the compiler if some diagnostic is produced later. This happens because some of the autogenerated globals are not removed from InternalVars StringMap when llvm::Module is reset.
Differential Revision: http://reviews.llvm.org/D8360

llvm-svn: 232610
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/lib/CodeGen/CGOpenMPRuntime.h
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/OpenMP/threadprivate_messages.cpp