message: Add module flags for enabling CodeView debug info on Windows and defining DWARF version on Unix.
diff: @@ -406,6 +406,15 @@ Module::Module(const char *fn) {
  module->setDataLayout(g->target->getDataLayout()->getStringRepresentation());
  if (g->generateDebuggingSymbols) {
  +#if ISPC_LLVM_VERSION >= ISPC_LLVM_3_8
  + module->addModuleFlag(llvm::Module::Warning, "Dwarf Version",
  + g->generateDWARFVersion);
  +#ifdef ISPC_IS_WINDOWS
  + // To enable debug information on Windows, we have to let llvm know, that
  + // debug information should be emitted in CodeView format.
  + module->addModuleFlag(llvm::Module::Warning, "CodeView", 1);
  +#endif
  +#endif
  diBuilder = new llvm::DIBuilder(*module);
  // Let the DIBuilder know that we're starting a new compilation
  