[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:
@@ -323,6 +323,8 @@ void CodeGenModule::checkAliases() {
|
||||
|
||||
void CodeGenModule::clear() {
|
||||
DeferredDeclsToEmit.clear();
|
||||
if (OpenMPRuntime)
|
||||
OpenMPRuntime->clear();
|
||||
}
|
||||
|
||||
void InstrProfStats::reportDiagnostics(DiagnosticsEngine &Diags,
|
||||
|
||||
Reference in New Issue
Block a user