mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-16 22:35:41 +00:00
Estimated hours taken: 0.5
Branches: main
The java and il backends don't have a typedef mechanism so all types
must have all the equivalence types in them expanded fully, thus the
type_ctor_info and special preds for equivalence types are not needed.
compiler/make_hlds.m:
Don't output the special predicates for types defined as
equivalence types on the il and java backends.
compiler/type_ctor_info.m:
Don't output the type_ctor_infos for types defined as equivalence
types on the il and java backends.
compiler/hlds_code_util.m:
Add the predicate are_equivalence_types_expanded.
39 lines
1.3 KiB
Mathematica
39 lines
1.3 KiB
Mathematica
%-----------------------------------------------------------------------------%
|
|
% Copyright (C) 2002 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.
|
|
%-----------------------------------------------------------------------------%
|
|
%-----------------------------------------------------------------------------%
|
|
%
|
|
% file: hlds_code_util.m.
|
|
%
|
|
% various utilities routines for use during hlds generation.
|
|
%
|
|
%-----------------------------------------------------------------------------%
|
|
%-----------------------------------------------------------------------------%
|
|
:- module hlds__hlds_code_util.
|
|
:- interface.
|
|
|
|
:- import_module hlds__hlds_module.
|
|
|
|
% XXX some of the stuff from code_util.m should be moved here.
|
|
|
|
:- type hlds_code_util ---> suppress_warning_about_nothing_exported.
|
|
|
|
% Are equivalence types fully expanded on this backend?
|
|
:- pred are_equivalence_types_expanded(module_info::in) is semidet.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module libs__globals, libs__options.
|
|
:- import_module bool.
|
|
|
|
are_equivalence_types_expanded(ModuleInfo) :-
|
|
module_info_globals(ModuleInfo, Globals),
|
|
globals__lookup_bool_option(Globals, highlevel_data, HighLevelData),
|
|
HighLevelData = yes,
|
|
globals__get_target(Globals, Target),
|
|
( Target = il ; Target = java).
|
|
|
|
|