[m-rev.] diff: fix bug #463

Julien Fischer jfischer at opturion.com
Fri Jul 20 16:43:39 AEST 2018


Fix bug #463.

The compiler has a sanity check that we do not attempt to use a MS C#
compiler in a POSIX (but not Cygwin) environment.  As the MS C# compiler
does now run in POSIX environments this sanity check is out-of-date:
this diff deletes it.

compiler/compile_target_code.m:
     Delete the out-of-date sanity check.

Julien.

diff --git a/compiler/compile_target_code.m b/compiler/compile_target_code.m
index d25c7c6..ea2e243 100644
--- a/compiler/compile_target_code.m
+++ b/compiler/compile_target_code.m
@@ -2968,14 +2968,13 @@ create_csharp_exe_or_lib(Globals, ErrorStream, LinkTargetType, MainModuleName,

      % Converts the given filename into a format acceptable to the C# compiler.
      %
-    % This is because the MS C# compiler only allows \ as the path separator,
-    % so we convert all / into \ when using the MC C# compiler.
+    % Older MS C# compilers only allowed \ as the path separator, so we convert
+    % all / into \ when using an MS C# compiler on Windows.
      %
  :- func csharp_file_name(env_type, csharp_compiler_type, file_name)
      = file_name.

-csharp_file_name(env_type_posix, csharp_microsoft, _FileName) =
-    unexpected($module, $pred, "microsoft c# compiler in posix env").
+csharp_file_name(env_type_posix, csharp_microsoft, FileName) = FileName.
  csharp_file_name(env_type_posix, csharp_mono, Filename) = Filename.
  csharp_file_name(env_type_posix, csharp_unknown, Filename) = Filename.

diff --git a/compiler/handle_options.m b/compiler/handle_options.m
index 4a2a566..82622f8 100644
--- a/compiler/handle_options.m
+++ b/compiler/handle_options.m
@@ -618,19 +618,6 @@ check_option_values(!OptionTable, Target, GC_Method, TagsMethod,
          add_error(phase_options, TargetEnvTypeSpec, !Specs)
      ),

-    ( if
-        HostEnvType = env_type_posix,
-        CSharp_CompilerType = csharp_microsoft
-    then
-        PosixCSMSpec =
-            [words_quote("--host-env-type posix"),
-            words("is incompatible with"),
-            words_quote("--csharp-compiler-type microsoft"), suffix("."), nl],
-        add_error(phase_options, PosixCSMSpec, !Specs)
-    else
-        true
-    ),
-
      raw_lookup_accumulating_option(!.OptionTable, limit_error_contexts,
          LimitErrorContextsOptionStrs),
      convert_limit_error_contexts(LimitErrorContextsOptionStrs,


More information about the reviews mailing list