'Set the module flags metadata'

def _set_module_flags(self):

    module = self.module
    mflags = module.get_or_insert_named_metadata('llvm.module.flags')
    require_warning_behavior = self._const_int(2)
    if (self.DWARF_VERSION is not None):
        dwarf_version = module.add_metadata([require_warning_behavior, 'Dwarf    Version', self._const_int(self.DWARF_VERSION)])
        if (dwarf_version not in mflags.operands):
            mflags.add(dwarf_version)
    debuginfo_version = module.add_metadata([require_warning_behavior, 'Debug    Info    Version', self._const_int(self.DEBUG_INFO_VERSION)])
    if (debuginfo_version not in mflags.operands):
        mflags.add(debuginfo_version)
