message: Fixed module verification when debug info is enabled
diff: @@ -162,6 +162,11 @@ Module::Module(const char *fn) {
  if (g->target_os == TargetOS::windows) {
  module->addModuleFlag(llvm::Module::Warning, "CodeView", 1);
  } else {
  + // When we link with CM, "Dwarf version" and "Debug info version" is already set
  + // so we don't need to do this here. Otherwise VerifyModule will be broken.
  +#ifdef ISPC_GENX_ENABLED
  + if (g->target->getISA() != Target::GENX)
  +#endif
  module->addModuleFlag(llvm::Module::Warning, "Dwarf Version", g->generateDWARFVersion);
  }
  diBuilder = new llvm::DIBuilder(*module);
  @@ -901,6 +906,11 @@ bool Module::writeOutput(OutputType outputType, OutputFlags flags, const char *o
  // "Debug Info Version" constant to the module. LLVM will ignore
  // our Debug Info metadata without it.
  if (g->generateDebuggingSymbols == true) {
  +// When we link with CM, "Dwarf version" and "Debug info version" is already set
  +// so we don't need to do this here. Otherwise VerifyModule will be broken.
  +#ifdef ISPC_GENX_ENABLED
  + if (g->target->getISA() != Target::GENX)
  +#endif
  module->addModuleFlag(llvm::Module::Warning, "Debug Info Version", llvm::DEBUG_METADATA_VERSION);
  }
  