Files
mercury/compiler/backend_libs.m
Peter Wang 9979764072 Build string switch tries in the target string encoding.
The compiler should work in code units of the TARGET string encoding
when building tries for string switches.  Using its own string encoding
would be incorrect if it differs from the target encoding.  Currently
that would only occur if the compiler is built in a java/csharp grade
(uses UTF-16 internally) and invoked to target high-level C (uses UTF-8).

Another motivation for this change is to remove a place where the
compiler behaviour depends on the setting of `--cross-compiling'.
As of now, the `--cross-compiling' option has no effect.

compiler/backend_libs.m:
compiler/string_encoding.m:
	Add new module with helper predicates.

compiler/ml_string_switch.m:
	Convert strings to/from code units in the target string
	encoding.

compiler/ml_switch_gen.m:
	Remove restriction on compiling string switches using tries when
	`--cross-compiling' is enabled.

compiler/notes/compiler_design.html:
	Document the new module.
2015-03-23 14:16:20 +11:00

43 lines
1.4 KiB
Mathematica

%-----------------------------------------------------------------------------%
% vim: ft=mercury ts=4 sw=4 et
%-----------------------------------------------------------------------------%
% Copyright (C) 2002-2005 The University of Melbourne.
% This file may only be copied under the terms of the GNU General
% Public License - see the file COPYING in the Mercury distribution.
%-----------------------------------------------------------------------------%
%
% Back-end libraries.
%
% This package contains utility modules that are each used by
% several different back-ends.
%
:- module backend_libs.
:- interface.
% modules that provide functionality used by several different back-ends
:- include_module arg_pack.
:- include_module base_typeclass_info.
:- include_module builtin_ops.
:- include_module bytecode_data.
:- include_module c_util.
:- include_module compile_target_code.
:- include_module erlang_rtti.
:- include_module export.
:- include_module foreign.
:- include_module interval.
:- include_module matching.
:- include_module name_mangle.
:- include_module proc_label.
:- include_module pseudo_type_info.
:- include_module rtti.
:- include_module string_encoding.
:- include_module switch_util.
:- include_module type_ctor_info.
:- include_module type_class_info.
:- implementation.
:- end_module backend_libs.
%-----------------------------------------------------------------------------%