[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
This commit is contained in:
Alexey Bataev
2015-03-18 04:13:55 +00:00
parent 4deaac780c
commit 91797559ac
4 changed files with 8 additions and 1 deletions

View File

@@ -323,6 +323,8 @@ void CodeGenModule::checkAliases() {
void CodeGenModule::clear() {
DeferredDeclsToEmit.clear();
if (OpenMPRuntime)
OpenMPRuntime->clear();
}
void InstrProfStats::reportDiagnostics(DiagnosticsEngine &Diags,