[m-rev.] for review: remov --split-c-files
Zoltan Somogyi
zs at cs.mu.OZ.AU
Fri Nov 25 17:34:09 AEDT 2005
Remove support for the --split-c-files option, since it hasn't worked in a
while, we haven't wanted to use it in a while, and the tradeoff of greatly
increased compilation time for a ~10% space gain is an increasingly bad one.
compiler/options.m:
doc/user_guide.texi:
Remove the option.
compiler/modules.m:
Remove the references to .split executables and archives from the
generated .d files.
compiler/*.m:
Delete the code for handling --split-c-files=yes, and make whatever
simplifications this makes possible.
scripts/Mmake.*:
Remove the references to .split executables and archives.
scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
Remove the references to the --split-c-files option.
tests/hard_coded/split_c_files.{m,split.exp}:
tests/hard_coded/mapped_module.split.exp:
Delete the test cases testing the deleted functionality.
tests/hard_coded/Mmakefile:
Don't test split C files.
Zoltan.
cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/compile_target_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/compile_target_code.m,v
retrieving revision 1.76
diff -u -b -r1.76 compile_target_code.m
--- compiler/compile_target_code.m 20 Nov 2005 23:08:09 -0000 1.76
+++ compiler/compile_target_code.m 22 Nov 2005 05:57:32 -0000
@@ -119,38 +119,6 @@
is det.
%-----------------------------------------------------------------------------%
-%
-% Code to deal with `--split-c-files'
-%
-
- % split_c_to_obj(ErrorStream, ModuleName, NumChunks, Succeeded):
- %
- % Compile the `.c' files produced for a module with `--split-c-files'.
- %
-:- pred split_c_to_obj(io__output_stream::in, module_name::in,
- int::in, bool::out, io::di, io::uo) is det.
-
- % Write the number of `.c' files written by this compilation
- % with `--split-c-files'.
- %
-:- pred write_num_split_c_files(module_name::in, int::in, bool::out,
- io::di, io::uo) is det.
-
- % Find the number of `.c' files written by a previous compilation
- % with `--split-c-files'.
- %
-:- pred read_num_split_c_files(module_name::in, maybe_error(int)::out,
- io::di, io::uo) is det.
-
- % remove_split_c_output_files(ModuleName, NumChunks):
- %
- % Remove the `.c' and `.o' files written by a previous compilation
- % with `--split-c-files'.
- %
-:- pred remove_split_c_output_files(module_name::in, int::in,
- io::di, io::uo) is det.
-
-%-----------------------------------------------------------------------------%
% make_all_module_command(CommandName, MainModule, AllModuleNames,
% CommandString):
@@ -359,34 +327,6 @@
%-----------------------------------------------------------------------------%
-split_c_to_obj(ErrorStream, ModuleName, NumChunks, Succeeded, !IO) :-
- split_c_to_obj(ErrorStream, ModuleName, 0, NumChunks, Succeeded, !IO).
-
- % Compile each of the C files in `<module>.dir'.
- %
-:- pred split_c_to_obj(io__output_stream::in, module_name::in,
- int::in, int::in, bool::out, io::di, io::uo) is det.
-
-split_c_to_obj(ErrorStream, ModuleName, Chunk, NumChunks, Succeeded, !IO) :-
- ( Chunk > NumChunks ->
- Succeeded = yes
- ;
- % XXX should this use maybe_pic_object_file_extension?
- globals__io_lookup_string_option(object_file_extension, Obj, !IO),
- module_name_to_split_c_file_name(ModuleName, Chunk, ".c", C_File, !IO),
- module_name_to_split_c_file_name(ModuleName, Chunk, Obj, O_File, !IO),
- compile_c_file(ErrorStream, non_pic, C_File, O_File, Succeeded0, !IO),
- (
- Succeeded0 = no,
- Succeeded = no
- ;
- Succeeded0 = yes,
- Chunk1 = Chunk + 1,
- split_c_to_obj(ErrorStream, ModuleName, Chunk1, NumChunks,
- Succeeded, !IO)
- )
- ).
-
% WARNING: The code here duplicates the functionality of scripts/mgnuc.in.
% Any changes there may also require changes here, and vice versa.
@@ -414,32 +354,21 @@
join_string_list(C_Flags_List, "", "", " ", CFLAGS),
globals__io_lookup_bool_option(use_subdirs, UseSubdirs, !IO),
- globals__io_lookup_bool_option(split_c_files, SplitCFiles, !IO),
(
- ( UseSubdirs = yes
- ; SplitCFiles = yes
- )
- ->
+ UseSubdirs = yes,
% The source file (foo.c) will be compiled in a subdirectory
% (either Mercury/cs, foo.dir, or Mercury/dirs/foo.dir, depending
% on which of these two options is set) so we need to add `-I.'
% so it can include header files in the source directory.
SubDirInclOpt = "-I. "
;
+ UseSubdirs = no,
SubDirInclOpt = ""
),
globals__io_lookup_accumulating_option(c_include_directory,
C_Incl_Dirs, !IO),
InclOpt = string__append_list(list__condense(list__map(
(func(C_INCL) = ["-I", quote_arg(C_INCL), " "] ), C_Incl_Dirs))),
- globals__io_lookup_bool_option(split_c_files, Split_C_Files, !IO),
- (
- Split_C_Files = yes,
- SplitOpt = "-DMR_SPLIT_C_FILES "
- ;
- Split_C_Files = no,
- SplitOpt = ""
- ),
globals__io_lookup_bool_option(highlevel_code, HighLevelCode, !IO),
(
HighLevelCode = yes,
@@ -771,7 +700,6 @@
string__append_list([
CC, " ",
SubDirInclOpt, InclOpt,
- SplitOpt, " ",
OptimizeOpt, " ",
HighLevelCodeOpt,
NestedFunctionsOpt,
@@ -996,7 +924,6 @@
maybe_pic_object_file_extension(PIC, Obj, !IO),
globals__io_get_target(Target, !IO),
- globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
io__output_stream(OutputStream, !IO),
( Target = asm ->
% For --target asm, we generate everything into a single object file.
@@ -1006,26 +933,10 @@
;
Modules = [],
unexpected(this_file, "link_module_list: no modules")
- ),
- MakeLibCmdOK = yes
- ; SplitFiles = yes ->
- globals__io_lookup_string_option(library_extension, LibExt, !IO),
- module_name_to_file_name(MainModuleName, LibExt, yes, SplitLibFileName,
- !IO),
- string__append(".dir/*", Obj, DirObj),
- join_module_list(Modules, DirObj, ObjectList, !IO),
- create_archive(OutputStream, SplitLibFileName, no, ObjectList,
- MakeLibCmdOK, !IO),
- ObjectsList = [SplitLibFileName]
+ )
;
- MakeLibCmdOK = yes,
join_module_list(Modules, Obj, ObjectsList, !IO)
),
- (
- MakeLibCmdOK = no,
- Succeeded = no
- ;
- MakeLibCmdOK = yes,
( TargetType = executable ->
list__map(
(pred(ModuleStr::in, ModuleName::out) is det :-
@@ -1055,7 +966,6 @@
;
InitObjResult = no,
Succeeded = no
- )
).
make_init_obj_file(ErrorStream, ModuleName, ModuleNames, Result, !IO) :-
@@ -1875,82 +1785,6 @@
%-----------------------------------------------------------------------------%
-write_num_split_c_files(ModuleName, NumChunks, Succeeded, !IO) :-
- module_name_to_file_name(ModuleName, ".num_split", yes, NumChunksFileName,
- !IO),
- io__open_output(NumChunksFileName, Res, !IO),
- ( Res = ok(OutputStream) ->
- io__write_int(OutputStream, NumChunks, !IO),
- io__nl(OutputStream, !IO),
- io__close_output(OutputStream, !IO),
- Succeeded = yes
- ;
- Succeeded = no,
- io__progname_base("mercury_compile", ProgName, !IO),
- io__write_string(ProgName, !IO),
- io__write_string(": can't open `", !IO),
- io__write_string(NumChunksFileName, !IO),
- io__write_string("' for output\n", !IO)
- ).
-
-read_num_split_c_files(ModuleName, MaybeNumChunks, !IO) :-
- module_name_to_file_name(ModuleName, ".num_split", no, NumChunksFileName,
- !IO),
- io__open_input(NumChunksFileName, Res, !IO),
- (
- Res = ok(FileStream),
- io__read_word(FileStream, MaybeNumChunksString, !IO),
- io__close_input(FileStream, !IO),
- (
- MaybeNumChunksString = ok(NumChunksString),
- (
- string__to_int(string__from_char_list(NumChunksString),
- NumChunks)
- ->
- MaybeNumChunks = ok(NumChunks)
- ;
- MaybeNumChunks = error("Software error: error in `"
- ++ NumChunksFileName
- ++ "': expected single int.\n")
- )
- ;
- MaybeNumChunksString = eof,
- MaybeNumChunks = error("Software error: error in `"
- ++ NumChunksFileName
- ++ "': expected single int.\n")
- ;
- MaybeNumChunksString = error(_),
- MaybeNumChunks = error("Software error: error in `"
- ++ NumChunksFileName
- ++ "': expected single int.\n")
- )
- ;
- Res = error(Error),
- MaybeNumChunks = error(io__error_message(Error))
- ).
-
-remove_split_c_output_files(ModuleName, NumChunks, !IO) :-
- remove_split_c_output_files(ModuleName, 0, NumChunks, !IO).
-
-:- pred remove_split_c_output_files(module_name::in, int::in, int::in,
- io::di, io::uo) is det.
-
-remove_split_c_output_files(ModuleName, ThisChunk, NumChunks, !IO) :-
- ( ThisChunk =< NumChunks ->
- globals__io_lookup_string_option(object_file_extension, Obj, !IO),
- module_name_to_split_c_file_name(ModuleName, ThisChunk, ".c",
- CFileName, !IO),
- module_name_to_split_c_file_name(ModuleName, ThisChunk, Obj,
- ObjFileName, !IO),
- io__remove_file(CFileName, _, !IO),
- io__remove_file(ObjFileName, _, !IO),
- remove_split_c_output_files(ModuleName, ThisChunk, NumChunks, !IO)
- ;
- true
- ).
-
-%-----------------------------------------------------------------------------%
-
make_all_module_command(Command0, MainModule, AllModules, Command, !IO) :-
% Pass the main module first.
list__map_foldl(
Index: compiler/export.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/export.m,v
retrieving revision 1.93
diff -u -b -r1.93 export.m
--- compiler/export.m 17 Nov 2005 15:57:10 -0000 1.93
+++ compiler/export.m 18 Nov 2005 03:34:31 -0000
@@ -339,7 +339,7 @@
module_info::in, string::out, string::out, string::out, string::out,
string::out, assoc_list(arg_info, mer_type)::out) is det.
-get_export_info(Preds, PredId, ProcId, Globals, ModuleInfo, HowToDeclareLabel,
+get_export_info(Preds, PredId, ProcId, _Globals, ModuleInfo, HowToDeclareLabel,
C_RetType, MaybeDeclareRetval, MaybeFail, MaybeSucceed,
ArgInfoTypes) :-
map__lookup(Preds, PredId, PredInfo),
@@ -349,10 +349,6 @@
procedure_is_exported(ModuleInfo, PredInfo, ProcId)
;
status_defined_in_this_module(Status, no)
- ;
- % for --split-c-files, we need to treat
- % all procedures as if they were exported
- globals__lookup_bool_option(Globals, split_c_files, yes)
)
->
HowToDeclareLabel = "MR_declare_entry"
Index: compiler/handle_options.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/handle_options.m,v
retrieving revision 1.244
diff -u -b -r1.244 handle_options.m
--- compiler/handle_options.m 17 Nov 2005 15:57:14 -0000 1.244
+++ compiler/handle_options.m 18 Nov 2005 03:34:31 -0000
@@ -858,12 +858,6 @@
option_implies(prop_mode_constraints, mode_constraints, bool(yes),
!Globals),
- % --split-c-files is not supported by the high-level C code generator.
- option_implies(highlevel_code, split_c_files, bool(no), !Globals),
-
- % --split-c-files implies --procs-per-c-function 1
- option_implies(split_c_files, procs_per_c_function, int(1), !Globals),
-
% Minimal model tabling is not compatible with high level code
% or with trailing; see the comments in runtime/mercury_grade.h.
Index: compiler/layout_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/layout_out.m,v
retrieving revision 1.56
diff -u -b -r1.56 layout_out.m
--- compiler/layout_out.m 28 Oct 2005 02:10:12 -0000 1.56
+++ compiler/layout_out.m 10 Nov 2005 13:51:38 -0000
@@ -547,13 +547,7 @@
output_rval_decls(VarNums0, !DeclSet, !IO),
output_rval_decls(TypeParams0, !DeclSet, !IO),
LabelVars = label_has_var_info,
- globals__io_lookup_bool_option(split_c_files, Split, !IO),
(
- % With --split-c-files, the names of common cells can't be of the
- % form mercury_common_<n> (they have to be module qualified), which
- % contradicts the assumptions of the CCC and CC0 variants of the
- % MR_DEF_LL macro.
- Split = no,
LocnsTypes0 = const(data_addr_const(LTDataAddr, no)),
LTDataAddr = data_addr(_, common(LTCellNum, _)),
VarNums0 = const(data_addr_const(VNDataAddr, no)),
Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.266
diff -u -b -r1.266 llds_out.m
--- compiler/llds_out.m 17 Nov 2005 15:57:20 -0000 1.266
+++ compiler/llds_out.m 18 Nov 2005 03:34:32 -0000
@@ -26,8 +26,6 @@
:- import_module ll_backend.llds.
:- import_module parse_tree.prog_data.
-:- import_module mdbcomp.prim_data.
-
:- import_module bool.
:- import_module io.
:- import_module list.
@@ -37,10 +35,8 @@
%-----------------------------------------------------------------------------%
% Given a 'c_file' structure, output the LLDS code inside it
- % into one or more .c files, depending on the setting of the
- % --split-c-files option. The second argument gives the set of
- % labels that have layout structures. The third gives the Aditi-RL
- % code for the module.
+ % into a .c file. The second argument gives the set of labels that have
+ % layout structures. The third gives the Aditi-RL code for the module.
%
:- pred output_llds(c_file::in, list(complexity_proc_info)::in,
map(label, data_addr)::in, maybe(rl_file)::in, io::di, io::uo) is det.
@@ -81,12 +77,12 @@
:- pred output_data_addr(data_addr::in, io::di, io::uo) is det.
- % c_data_linkage_string(Globals, DefaultLinkage, StaticEvenIfSplit,
- % BeingDefined):
+ % c_data_linkage_string(DefaultLinkage, BeingDefined):
+ %
% Return a C string that gives the storage class appropriate for the
% definition of a global variable with the specified properties.
%
-:- func c_data_linkage_string(globals, linkage, bool, bool) = string.
+:- func c_data_linkage_string(linkage, bool) = string.
% Given a boolean that states whether a data item includes code
% addresses or not, return a C string that gives its "const-ness".
@@ -138,7 +134,7 @@
% to put these in a new module (maybe llds_out_util).
:- type decl_id
- ---> common_type(module_name, int)
+ ---> common_type(int)
; float_label(string)
; code_addr(code_addr)
; data_addr(data_addr)
@@ -182,8 +178,8 @@
:- implementation.
-:- import_module backend_libs.compile_target_code.
:- import_module backend_libs.c_util.
+:- import_module backend_libs.compile_target_code.
:- import_module backend_libs.export.
:- import_module backend_libs.foreign.
:- import_module backend_libs.name_mangle.
@@ -200,6 +196,7 @@
:- import_module ll_backend.layout_out.
:- import_module ll_backend.pragma_c_gen.
:- import_module ll_backend.rtti_out.
+:- import_module mdbcomp.prim_data.
:- import_module parse_tree.mercury_to_mercury.
:- import_module parse_tree.modules.
:- import_module parse_tree.prog_foreign.
@@ -237,150 +234,15 @@
%-----------------------------------------------------------------------------%
-output_llds(C_File, ComplexityProcs, StackLayoutLabels, MaybeRLFile, !IO) :-
- C_File = c_file(ModuleName, C_HeaderInfo, UserForeignCodes, Exports, Vars,
- Datas, Modules, UserInitPredCNames, UserFinalPredCNames),
- globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
- (
- SplitFiles = yes,
- module_name_to_file_name(ModuleName, ".dir", yes, ObjDirName, !IO),
- dir__make_directory(ObjDirName, _, !IO),
-
- output_split_c_file_init(ModuleName, Modules, Datas, Vars,
- ComplexityProcs, StackLayoutLabels, MaybeRLFile,
- UserInitPredCNames, UserFinalPredCNames, !IO),
- output_split_user_foreign_codes(UserForeignCodes, ModuleName,
- C_HeaderInfo, ComplexityProcs, StackLayoutLabels, 1, Num1, !IO),
- output_split_c_exports(Exports, ModuleName,
- C_HeaderInfo, ComplexityProcs, StackLayoutLabels, Num1, Num2, !IO),
- output_split_comp_gen_c_vars(Vars, ModuleName,
- C_HeaderInfo, ComplexityProcs, StackLayoutLabels, Num2, Num3, !IO),
- output_split_comp_gen_c_datas(Datas, ModuleName,
- C_HeaderInfo, ComplexityProcs, StackLayoutLabels, Num3, Num4, !IO),
- output_split_comp_gen_c_modules(Modules, ModuleName,
- C_HeaderInfo, ComplexityProcs, StackLayoutLabels, Num4, Num, !IO),
-
- compile_target_code__write_num_split_c_files(ModuleName, Num,
- Succeeded, !IO),
- (
- Succeeded = no,
- compile_target_code__remove_split_c_output_files(ModuleName, Num,
- !IO)
- ;
- Succeeded = yes
- )
- ;
- SplitFiles = no,
- output_single_c_file(C_File, no, ComplexityProcs,
- StackLayoutLabels, MaybeRLFile, !IO)
- ).
-
-:- pred output_split_user_foreign_codes(list(user_foreign_code)::in,
- module_name::in, list(foreign_decl_code)::in,
- list(complexity_proc_info)::in, map(label, data_addr)::in,
- int::in, int::out, io::di, io::uo) is det.
-
-output_split_user_foreign_codes([], _, _, _, _, !Num, !IO).
-output_split_user_foreign_codes([UserForeignCode | UserForeignCodes],
- ModuleName, C_HeaderLines, ComplexityProcs, StackLayoutLabels,
- !Num, !IO) :-
- CFile = c_file(ModuleName, C_HeaderLines, [UserForeignCode],
- [], [], [], [], [], []),
- output_single_c_file(CFile, yes(!.Num), ComplexityProcs,
- StackLayoutLabels, no, !IO),
- !:Num = !.Num + 1,
- output_split_user_foreign_codes(UserForeignCodes, ModuleName,
- C_HeaderLines, ComplexityProcs, StackLayoutLabels, !Num, !IO).
-
-:- pred output_split_c_exports(list(foreign_export)::in, module_name::in,
- list(foreign_decl_code)::in, list(complexity_proc_info)::in,
- map(label, data_addr)::in, int::in, int::out, io::di, io::uo) is det.
-
-output_split_c_exports([], _, _, _, _, !Num, !IO).
-output_split_c_exports([Export | Exports], ModuleName, C_HeaderLines,
- ComplexityProcs, StackLayoutLabels, !Num, !IO) :-
- CFile = c_file(ModuleName, C_HeaderLines, [], [Export],
- [], [], [], [], []),
- output_single_c_file(CFile, yes(!.Num), ComplexityProcs,
- StackLayoutLabels, no, !IO),
- !:Num = !.Num + 1,
- output_split_c_exports(Exports, ModuleName, C_HeaderLines,
- ComplexityProcs, StackLayoutLabels, !Num, !IO).
-
-:- pred output_split_comp_gen_c_vars(list(comp_gen_c_var)::in,
- module_name::in, list(foreign_decl_code)::in,
- list(complexity_proc_info)::in, map(label, data_addr)::in,
- int::in, int::out, io::di, io::uo) is det.
-
-output_split_comp_gen_c_vars([], _, _, _, _, !Num, !IO).
-output_split_comp_gen_c_vars([Var | Vars], ModuleName, C_HeaderLines,
- ComplexityProcs, StackLayoutLabels, !Num, !IO) :-
- CFile = c_file(ModuleName, C_HeaderLines, [], [], [Var], [], [], [], []),
- output_single_c_file(CFile, yes(!.Num), ComplexityProcs,
- StackLayoutLabels, no, !IO),
- !:Num = !.Num + 1,
- output_split_comp_gen_c_vars(Vars, ModuleName, C_HeaderLines,
- ComplexityProcs, StackLayoutLabels, !Num, !IO).
-
-:- pred output_split_comp_gen_c_datas(list(comp_gen_c_data)::in,
- module_name::in, list(foreign_decl_code)::in,
- list(complexity_proc_info)::in, map(label, data_addr)::in,
- int::in, int::out, io::di, io::uo) is det.
-
-output_split_comp_gen_c_datas([], _, _, _, _, !Num, !IO).
-output_split_comp_gen_c_datas([Data | Datas], ModuleName, C_HeaderLines,
- ComplexityProcs, StackLayoutLabels, !Num, !IO) :-
- CFile = c_file(ModuleName, C_HeaderLines, [], [], [], [Data], [], [], []),
- output_single_c_file(CFile, yes(!.Num), ComplexityProcs,
- StackLayoutLabels, no, !IO),
- !:Num = !.Num + 1,
- output_split_comp_gen_c_datas(Datas, ModuleName, C_HeaderLines,
- ComplexityProcs, StackLayoutLabels, !Num, !IO).
-
-:- pred output_split_comp_gen_c_modules(list(comp_gen_c_module)::in,
- module_name::in, list(foreign_decl_code)::in,
- list(complexity_proc_info)::in, map(label, data_addr)::in,
- int::in, int::out, io::di, io::uo) is det.
-
-output_split_comp_gen_c_modules([], _, _, _, _, !Num, !IO).
-output_split_comp_gen_c_modules([Module | Modules], ModuleName, C_HeaderLines,
- ComplexityProcs, StackLayoutLabels, !Num, !IO) :-
- CFile = c_file(ModuleName, C_HeaderLines, [], [], [], [], [Module],
- [], []),
- output_single_c_file(CFile, yes(!.Num), ComplexityProcs,
- StackLayoutLabels, no, !IO),
- !:Num = !.Num + 1,
- output_split_comp_gen_c_modules(Modules, ModuleName, C_HeaderLines,
- ComplexityProcs, StackLayoutLabels, !Num, !IO).
-
-:- pred output_split_c_file_init(module_name::in, list(comp_gen_c_module)::in,
- list(comp_gen_c_data)::in, list(comp_gen_c_var)::in,
- list(complexity_proc_info)::in, map(label, data_addr)::in,
- maybe(rl_file)::in, list(string)::in, list(string)::in,
- io::di, io::uo) is det.
-
-output_split_c_file_init(ModuleName, Modules, Datas, Vars, ComplexityProcs,
- StackLayoutLabels, MaybeRLFile, UserInitPredCNames,
- UserFinalPredCNames, !IO) :-
- module_name_to_file_name(ModuleName, ".m", no, SourceFileName, !IO),
- module_name_to_split_c_file_name(ModuleName, 0, ".c", FileName, !IO),
-
+output_llds(CFile, ComplexityProcs, StackLayoutLabels, MaybeRLFile, !IO) :-
+ CFile = c_file(ModuleName, _, _, _, _, _, _, _, _),
+ module_name_to_file_name(ModuleName, ".c", yes, FileName, !IO),
io__open_output(FileName, Result, !IO),
(
Result = ok(FileStream),
- library__version(Version),
- io__set_output_stream(FileStream, OutputStream, !IO),
- output_c_file_intro_and_grade(SourceFileName, Version, !IO),
- output_init_comment(ModuleName, UserInitPredCNames,
- UserFinalPredCNames, !IO),
- output_c_file_mercury_headers(!IO),
- io__write_string("\n", !IO),
decl_set_init(DeclSet0),
- output_c_module_init_list(ModuleName, Modules, Datas, Vars,
- ComplexityProcs, StackLayoutLabels,
- DeclSet0, _DeclSet, !IO),
- c_util__output_rl_file(ModuleName, MaybeRLFile, !IO),
- io__set_output_stream(OutputStream, _, !IO),
+ output_single_c_file(CFile, ComplexityProcs, StackLayoutLabels,
+ MaybeRLFile, FileStream, DeclSet0, _, !IO),
io__close_output(FileStream, !IO)
;
Result = error(Error),
@@ -420,46 +282,11 @@
GenBytecode = no
).
-:- pred output_single_c_file(c_file::in, maybe(int)::in,
- list(complexity_proc_info)::in, map(label, data_addr)::in,
- maybe(rl_file)::in, io::di, io::uo) is det.
-
-output_single_c_file(CFile, SplitFiles, ComplexityProcs, StackLayoutLabels,
- MaybeRLFile, !IO) :-
- CFile = c_file(ModuleName, _, _, _, _, _, _, _, _),
- (
- SplitFiles = yes(Num),
- module_name_to_split_c_file_name(ModuleName, Num, ".c", FileName, !IO)
- ;
- SplitFiles = no,
- module_name_to_file_name(ModuleName, ".c", yes, FileName, !IO)
- ),
- io__open_output(FileName, Result, !IO),
- (
- Result = ok(FileStream),
- decl_set_init(DeclSet0),
- do_output_single_c_file(CFile, SplitFiles, ComplexityProcs,
- StackLayoutLabels, MaybeRLFile, FileStream, DeclSet0, _, !IO),
- io__close_output(FileStream, !IO)
- ;
- Result = error(Error),
- io__progname_base("llds.m", ProgName, !IO),
- io__write_string("\n", !IO),
- io__write_string(ProgName, !IO),
- io__write_string(": can't open `", !IO),
- io__write_string(FileName, !IO),
- io__write_string("' for output:\n", !IO),
- io__write_string(io__error_message(Error), !IO),
- io__write_string("\n", !IO),
- io__set_exit_status(1, !IO)
- ).
-
-:- pred do_output_single_c_file(c_file::in, maybe(int)::in,
- list(complexity_proc_info)::in, map(label, data_addr)::in,
- maybe(rl_file)::in, io__output_stream::in,
+:- pred output_single_c_file(c_file::in, list(complexity_proc_info)::in,
+ map(label, data_addr)::in, maybe(rl_file)::in, io__output_stream::in,
decl_set::in, decl_set::out, io::di, io::uo) is det.
-do_output_single_c_file(CFile, SplitFiles, ComplexityProcs, StackLayoutLabels,
+output_single_c_file(CFile, ComplexityProcs, StackLayoutLabels,
MaybeRLFile, FileStream, !DeclSet, !IO) :-
CFile = c_file(ModuleName, C_HeaderLines, UserForeignCode, Exports,
Vars, Datas, Modules, UserInitPredCNames, UserFinalPredCNames),
@@ -467,13 +294,8 @@
io__set_output_stream(FileStream, OutputStream, !IO),
module_name_to_file_name(ModuleName, ".m", no, SourceFileName, !IO),
output_c_file_intro_and_grade(SourceFileName, Version, !IO),
- (
- SplitFiles = yes(_)
- ;
- SplitFiles = no,
output_init_comment(ModuleName, UserInitPredCNames,
- UserFinalPredCNames, !IO)
- ),
+ UserFinalPredCNames, !IO),
output_c_file_mercury_headers(!IO),
output_foreign_header_include_lines(C_HeaderLines, !IO),
@@ -497,15 +319,9 @@
!DeclSet, !IO),
list__foldl(output_user_foreign_code, UserForeignCode, !IO),
list__foldl(io__write_string, Exports, !IO),
-
- (
- SplitFiles = yes(_)
- ;
- SplitFiles = no,
io__write_string("\n", !IO),
output_c_module_init_list(ModuleName, Modules, Datas, Vars,
- ComplexityProcs, StackLayoutLabels, !DeclSet, !IO)
- ),
+ ComplexityProcs, StackLayoutLabels, !DeclSet, !IO),
c_util__output_rl_file(ModuleName, MaybeRLFile, !IO),
io__set_output_stream(OutputStream, _, !IO).
@@ -550,17 +366,16 @@
list__filter(MustInit, Modules, AlwaysInitModules, MaybeInitModules),
list__chunk(AlwaysInitModules, 40, AlwaysInitModuleBunches),
list__chunk(MaybeInitModules, 40, MaybeInitModuleBunches),
- globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
output_init_bunch_defs(AlwaysInitModuleBunches, ModuleName,
- "always", 0, SplitFiles, !IO),
+ "always", 0, !IO),
(
MaybeInitModuleBunches = []
;
MaybeInitModuleBunches = [_ | _],
output_init_bunch_defs(MaybeInitModuleBunches, ModuleName,
- "maybe", 0, SplitFiles, !IO)
+ "maybe", 0, !IO)
),
io__write_string("/* suppress gcc -Wmissing-decls warnings */\n", !IO),
@@ -621,10 +436,9 @@
),
output_c_data_init_list(Datas, !IO),
- % The call to the debugger initialization function
- % is for bootstrapping; once the debugger has been modified
- % to call do_init_modules_debugger() and all debuggable
- % object files created before this change have been
+ % The call to the debugger initialization function is for bootstrapping;
+ % once the debugger has been modified to call do_init_modules_debugger()
+ % and all debuggable object files created before this change have been
% overwritten, it can be deleted.
io__write_string("\t", !IO),
output_init_name(ModuleName, !IO),
@@ -640,7 +454,7 @@
io__write_string("\t\treturn;\n", !IO),
io__write_string("\t}\n", !IO),
io__write_string("\tdone = MR_TRUE;\n", !IO),
- output_type_tables_init_list(Datas, SplitFiles, !IO),
+ output_type_tables_init_list(Datas, !IO),
io__write_string("}\n\n", !IO),
output_debugger_init_list_decls(Datas, !DeclSet, !IO),
@@ -708,47 +522,32 @@
map__search(StackLayoutLabels, Label, _).
:- pred output_init_bunch_defs(list(list(comp_gen_c_module))::in,
- module_name::in, string::in, int::in, bool::in,
- io::di, io::uo) is det.
+ module_name::in, string::in, int::in, io::di, io::uo) is det.
-output_init_bunch_defs([], _, _, _, _, !IO).
-output_init_bunch_defs([Bunch | Bunches], ModuleName, InitStatus, Seq,
- SplitFiles, !IO) :-
+output_init_bunch_defs([], _, _, _, !IO).
+output_init_bunch_defs([Bunch | Bunches], ModuleName, InitStatus, Seq, !IO) :-
io__write_string("static void ", !IO),
output_bunch_name(ModuleName, InitStatus, Seq, !IO),
io__write_string("(void)\n", !IO),
io__write_string("{\n", !IO),
- output_init_bunch_def(Bunch, ModuleName, SplitFiles, !IO),
+ output_init_bunch_def(Bunch, ModuleName, !IO),
io__write_string("}\n\n", !IO),
NextSeq = Seq + 1,
- output_init_bunch_defs(Bunches, ModuleName, InitStatus, NextSeq,
- SplitFiles, !IO).
+ output_init_bunch_defs(Bunches, ModuleName, InitStatus, NextSeq, !IO).
:- pred output_init_bunch_def(list(comp_gen_c_module)::in, module_name::in,
- bool::in, io::di, io::uo) is det.
+ io::di, io::uo) is det.
-output_init_bunch_def([], _, _, !IO).
-output_init_bunch_def([Module | Modules], ModuleName, SplitFiles, !IO) :-
+output_init_bunch_def([], _, !IO).
+output_init_bunch_def([Module | Modules], ModuleName, !IO) :-
Module = comp_gen_c_module(C_ModuleName, _),
- (
- SplitFiles = yes,
- io__write_string("\t{ extern MR_ModuleFunc ", !IO),
- io__write_string(C_ModuleName, !IO),
- io__write_string(";\n", !IO),
- io__write_string("\t ", !IO),
- io__write_string(C_ModuleName, !IO),
- io__write_string("(); }\n", !IO)
- ;
- SplitFiles = no,
io__write_string("\t", !IO),
io__write_string(C_ModuleName, !IO),
- io__write_string("();\n", !IO)
- ),
- output_init_bunch_def(Modules, ModuleName, SplitFiles, !IO).
+ io__write_string("();\n", !IO),
+ output_init_bunch_def(Modules, ModuleName, !IO).
:- pred output_init_bunch_calls(list(list(comp_gen_c_module))::in,
- module_name::in, string::in, int::in, io::di, io::uo)
- is det.
+ module_name::in, string::in, int::in, io::di, io::uo) is det.
output_init_bunch_calls([], _, _, _, !IO).
output_init_bunch_calls([_ | Bunches], ModuleName, InitStatus, Seq, !IO) :-
@@ -776,16 +575,16 @@
% Output code to register each type_ctor_info defined in this module.
:- pred output_type_tables_init_list(list(comp_gen_c_data)::in,
- bool::in, io::di, io::uo) is det.
+ io::di, io::uo) is det.
-output_type_tables_init_list([], _, !IO).
-output_type_tables_init_list([Data | Datas], SplitFiles, !IO) :-
+output_type_tables_init_list([], !IO).
+output_type_tables_init_list([Data | Datas], !IO) :-
( Data = rtti_data(RttiData) ->
- rtti_out__register_rtti_data_if_nec(RttiData, SplitFiles, !IO)
+ rtti_out__register_rtti_data_if_nec(RttiData, !IO)
;
true
),
- output_type_tables_init_list(Datas, SplitFiles, !IO).
+ output_type_tables_init_list(Datas, !IO).
% Output declarations for each module layout defined in this module
% (there should only be one, of course).
@@ -1038,43 +837,27 @@
output_common_decl_group(TypeNum - CommonDatas, !DeclSet, !IO) :-
io__write_string("\n", !IO),
- globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
- ExportedFromFile = SplitFiles,
(
CommonDatas = [CommonData | _],
- CommonData = common_data(ModuleName, _, TypeAndValue)
+ CommonData = common_data(_, _, TypeAndValue)
;
CommonDatas = [],
unexpected(this_file, "output_common_decl_chunk: empty list")
),
- TypeDeclId = common_type(ModuleName, TypeNum),
+ TypeDeclId = common_type(TypeNum),
( decl_set_is_member(TypeDeclId, !.DeclSet) ->
true
;
- output_const_term_type(TypeAndValue, ModuleName, "", "", 0, _, !IO),
+ output_const_term_type(TypeAndValue, "", "", 0, _, !IO),
io__write_string("\n", !IO),
decl_set_insert(TypeDeclId, !DeclSet)
),
- (
- ExportedFromFile = no,
% There should be a macro MR_DEF_COMMON<n> for every n up to
% ChunkSize.
ChunkSize = 10,
list__chunk(list__reverse(CommonDatas), ChunkSize, CommonDataChunks),
list__foldl2(output_common_decl_shorthand_chunk(TypeNum),
- CommonDataChunks, !DeclSet, !IO)
- ;
- ExportedFromFile = yes,
- % ChunkSize should be as large as possible to reduce the size
- % of the file being generated, but small enough not to overload
- % the fixed limits of our target C compilers.
- ChunkSize = 20,
- % The process of creating the multi_map reverses the order of
- % CommonDatas, we now undo this reversal.
- list__chunk(list__reverse(CommonDatas), ChunkSize, CommonDataChunks),
- list__foldl2(output_common_decl_chunk(ModuleName, TypeNum),
- CommonDataChunks, !DeclSet, !IO)
- ).
+ CommonDataChunks, !DeclSet, !IO).
:- pred output_common_decl_shorthand_chunk(int::in, list(common_data)::in,
decl_set::in, decl_set::out, io::di, io::uo) is det.
@@ -1110,13 +893,12 @@
CommonDatas = []
).
-:- pred output_common_decl_chunk(module_name::in, int::in,
- list(common_data)::in, decl_set::in, decl_set::out, io::di, io::uo)
- is det.
+:- pred output_common_decl_chunk(int::in, list(common_data)::in,
+ decl_set::in, decl_set::out, io::di, io::uo) is det.
-output_common_decl_chunk(ModuleName, TypeNum, CommonDatas, !DeclSet, !IO) :-
+output_common_decl_chunk(TypeNum, CommonDatas, !DeclSet, !IO) :-
io__write_string("const struct ", !IO),
- output_common_cell_type_name(ModuleName, TypeNum, !IO),
+ output_common_cell_type_name(TypeNum, !IO),
io__nl(!IO),
output_common_decl_chunk_entries(CommonDatas, !DeclSet, !IO).
@@ -1167,22 +949,19 @@
% only within the C file generated for that module. However, if we generate
% multiple C files, the code in each C file must be visible to the other
% C files for that Mercury module.
- globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
- ExportedFromFile = SplitFiles,
TypeNum = common_cell_get_type_num(TypeAndValue),
- TypeDeclId = common_type(ModuleName, TypeNum),
+ TypeDeclId = common_type(TypeNum),
( decl_set_is_member(TypeDeclId, !.DeclSet) ->
true
;
- output_const_term_type(TypeAndValue, ModuleName,
- "", "", 0, _, !IO),
+ output_const_term_type(TypeAndValue, "", "", 0, _, !IO),
io__write_string("\n", !IO),
decl_set_insert(TypeDeclId, !DeclSet)
),
VarName = common(CellNum, TypeNum),
VarDeclId = data_addr(data_addr(ModuleName, VarName)),
output_const_term_decl_or_defn(TypeAndValue, ModuleName, CellNum,
- ExportedFromFile, no, "", "", 0, _, !IO),
+ no, no, "", "", 0, _, !IO),
decl_set_insert(VarDeclId, !DeclSet).
:- pred output_comp_gen_c_module(map(label, data_addr)::in,
@@ -1238,18 +1017,11 @@
Args = common_cell_get_rvals(TypeAndValue),
output_rvals_decls(Args, !DeclSet, !IO),
- % The code for data local to a Mercury module should normally be visible
- % only within the C file generated for that module. However, if we generate
- % multiple C files, the code in each C file must be visible to the other
- % C files for that Mercury module.
- globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
- ExportedFromFile = SplitFiles,
-
TypeNum = common_cell_get_type_num(TypeAndValue),
VarName = common(CellNum, TypeNum),
VarDeclId = data_addr(data_addr(ModuleName, VarName)),
output_const_term_decl_or_defn(TypeAndValue, ModuleName, CellNum,
- ExportedFromFile, yes, "", "", 0, _, !IO),
+ no, yes, "", "", 0, _, !IO),
decl_set_insert(VarDeclId, !DeclSet).
:- pred output_user_foreign_code(user_foreign_code::in, io::di, io::uo) is det.
@@ -1478,18 +1250,8 @@
DeclMacro = "MR_def_extern_entry("
;
Label = entry(local, _),
- % The code for procedures local to a Mercury module
- % should normally be visible only within the C file
- % generated for that module. However, if we generate
- % multiple C files, the code in each C file must be
- % visible to the other C files for that Mercury module.
- globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
- ( SplitFiles = no ->
DeclMacro = "MR_decl_static("
;
- DeclMacro = "MR_def_extern_entry("
- )
- ;
Label = entry(c_local, _),
DeclMacro = "MR_decl_local("
;
@@ -3059,22 +2821,20 @@
%
% Unless the term contains code addresses, and we don't have
% static code addresses available, in which case we'll have
- % to initialize them dynamically, so we must omit both `const's
- % above.
+ % to initialize them dynamically, so we must omit both `const's above.
%
% output_const_term_type outputs the first part above. The second
% and third parts are output by output_const_term_decl_or_defn.
%
-:- pred output_const_term_type(common_cell_type_and_value::in, module_name::in,
+:- pred output_const_term_type(common_cell_type_and_value::in,
string::in, string::in, int::in, int::out, io::di, io::uo) is det.
-output_const_term_type(TypeAndValue, ModuleName, FirstIndent, LaterIndent,
- !N, !IO) :-
+output_const_term_type(TypeAndValue, FirstIndent, LaterIndent, !N, !IO) :-
output_indent(FirstIndent, LaterIndent, !.N, !IO),
!:N = !.N + 1,
io__write_string("struct ", !IO),
TypeNum = common_cell_get_type_num(TypeAndValue),
- output_common_cell_type_name(ModuleName, TypeNum, !IO),
+ output_common_cell_type_name(TypeNum, !IO),
io__write_string(" {\n", !IO),
(
TypeAndValue = plain_type_and_value(_, ArgsTypes),
@@ -3102,7 +2862,7 @@
io__write_string("static const struct ", !IO)
),
TypeNum = common_cell_get_type_num(TypeAndValue),
- output_common_cell_type_name(ModuleName, TypeNum, !IO),
+ output_common_cell_type_name(TypeNum, !IO),
io__write_string(" ", !IO),
VarDeclId = data_addr(ModuleName, common(CellNum, TypeNum)),
output_decl_id(data_addr(VarDeclId), !IO),
@@ -3148,8 +2908,8 @@
:- pred output_decl_id(decl_id::in, io::di, io::uo) is det.
-output_decl_id(common_type(ModuleName, TypeNum), !IO) :-
- output_common_cell_type_name(ModuleName, TypeNum, !IO).
+output_decl_id(common_type(TypeNum), !IO) :-
+ output_common_cell_type_name(TypeNum, !IO).
output_decl_id(data_addr(DataAddr), !IO) :-
output_data_addr(DataAddr, !IO).
output_decl_id(code_addr(_CodeAddress), !IO) :-
@@ -3590,16 +3350,7 @@
io__write_string("MR_decl_entry(", !IO),
output_label(entry(exported, ProcLabel), no, !IO),
io__write_string(");\n", !IO).
-output_label_as_code_addr_decls(entry(local, ProcLabel), !IO) :-
- globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
- (
- SplitFiles = no
- ;
- SplitFiles = yes,
- io__write_string("MR_decl_entry(", !IO),
- output_label(entry(local, ProcLabel), no, !IO),
- io__write_string(");\n", !IO)
- ).
+output_label_as_code_addr_decls(entry(local, _ProcLabel), !IO).
output_label_as_code_addr_decls(entry(c_local, _), !IO).
output_label_as_code_addr_decls(internal(_, _), !IO).
@@ -3644,17 +3395,8 @@
output_data_addrs_decls(DataAddrs, FirstIndent, LaterIndent, !N,
!DeclSet, !IO).
-c_data_linkage_string(Globals, DefaultLinkage, StaticEvenIfSplit, BeingDefined)
- = LinkageStr :-
- globals__lookup_bool_option(Globals, split_c_files, SplitFiles),
- (
- (
- DefaultLinkage = extern
- ;
- SplitFiles = yes,
- StaticEvenIfSplit = no
- )
- ->
+c_data_linkage_string(DefaultLinkage, BeingDefined) = LinkageStr :-
+ ( DefaultLinkage = extern ->
(
BeingDefined = yes,
LinkageStr = ""
@@ -3692,11 +3434,11 @@
output_data_addr_storage_type_name(ModuleName, DataVarName, BeingDefined,
LaterIndent, !IO) :-
data_name_linkage(DataVarName, Linkage),
- globals__io_get_globals(Globals, !IO),
- LinkageStr = c_data_linkage_string(Globals, Linkage, no, BeingDefined),
+ LinkageStr = c_data_linkage_string(Linkage, BeingDefined),
io__write_string(LinkageStr, !IO),
InclCodeAddr = data_name_may_include_non_static_code_address(DataVarName),
+ globals__io_get_globals(Globals, !IO),
io__write_string(c_data_const_string(Globals, InclCodeAddr), !IO),
io__write_string("struct ", !IO),
@@ -4165,51 +3907,35 @@
:- pred output_data_addr(module_name::in, data_name::in, io::di, io::uo)
is det.
-output_data_addr(ModuleName, VarName, !IO) :-
+output_data_addr(_ModuleName, VarName, !IO) :-
(
VarName = common(CellNum, _TypeNum),
- output_common_prefix(ModuleName, common_prefix_var, !IO),
+ output_common_prefix(common_prefix_var, !IO),
io__write_int(CellNum, !IO)
;
VarName = tabling_pointer(ProcLabel),
output_tabling_pointer_var_name(ProcLabel, !IO)
).
-:- pred output_common_cell_type_name(module_name::in, int::in, io::di, io::uo)
- is det.
+:- pred output_common_cell_type_name(int::in, io::di, io::uo) is det.
-output_common_cell_type_name(ModuleName, TypeNum, !IO) :-
- output_common_prefix(ModuleName, common_prefix_type, !IO),
+output_common_cell_type_name(TypeNum, !IO) :-
+ output_common_prefix(common_prefix_type, !IO),
io__write_int(TypeNum, !IO).
:- type common_prefix
---> common_prefix_var
; common_prefix_type.
-:- pred output_common_prefix(module_name::in, common_prefix::in,
- io::di, io::uo) is det.
+:- pred output_common_prefix(common_prefix::in, io::di, io::uo) is det.
-output_common_prefix(ModuleName, Prefix, !IO) :-
+output_common_prefix(Prefix, !IO) :-
(
Prefix = common_prefix_var,
io__write_string(mercury_common_prefix, !IO)
;
Prefix = common_prefix_type,
io__write_string(mercury_common_type_prefix, !IO)
- ),
- globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
- (
- SplitFiles = no
- % In the absence of split_c_files, common cells are always
- % local to a C file, so we don't have to module qualify them,
- % or the names of their types, and omitting the module
- % qualification makes the generated C file significantly
- % smaller in debugging grades.
- ;
- SplitFiles = yes,
- MangledModuleName = sym_name_mangle(ModuleName),
- io__write_string(MangledModuleName, !IO),
- io__write_string("__", !IO)
).
:- pred output_label_as_code_addr(label::in, io::di, io::uo) is det.
@@ -4264,23 +3990,9 @@
output_label(entry(exported, ProcLabel), !IO),
io__write_string(");\n", !IO).
output_label_defn(entry(local, ProcLabel), !IO) :-
- % The code for procedures local to a Mercury module
- % should normally be visible only within the C file
- % generated for that module. However, if we generate
- % multiple C files, the code in each C file must be
- % visible to the other C files for that Mercury module.
- globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
- (
- SplitFiles = no,
io__write_string("MR_def_static(", !IO),
output_proc_label(ProcLabel, no, !IO),
- io__write_string(")\n", !IO)
- ;
- SplitFiles = yes,
- io__write_string("MR_def_entry(", !IO),
- output_proc_label(ProcLabel, no, !IO),
- io__write_string(")\n", !IO)
- ).
+ io__write_string(")\n", !IO).
output_label_defn(entry(c_local, ProcLabel), !IO) :-
io__write_string("MR_def_local(", !IO),
output_proc_label(ProcLabel, no, !IO),
@@ -4749,9 +4461,7 @@
io__write_string(")", !IO)
).
output_rval(mkword(Tag, Exprn), !IO) :-
- globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
(
- SplitFiles = no,
Exprn = const(data_addr_const(DataAddr, no)),
DataAddr = data_addr(_, DataName),
DataName = common(CellNum, _TypeNum)
@@ -4876,9 +4586,7 @@
% reduces the size of the generated C source file, which has
% a considerably longer lifetime. In debugging grades, the
% file size difference can be very substantial.
- globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
(
- SplitFiles = no,
DataAddr = data_addr(_, DataName),
DataName = common(CellNum, _TypeNum)
->
Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.363
diff -u -b -r1.363 mercury_compile.m
--- compiler/mercury_compile.m 23 Nov 2005 04:44:05 -0000 1.363
+++ compiler/mercury_compile.m 24 Nov 2005 04:15:41 -0000
@@ -1296,29 +1296,13 @@
find_smart_recompilation_target_files(TopLevelModuleName,
Globals, FindTargetFiles) :-
globals__get_target(Globals, CompilationTarget),
- (
- CompilationTarget = c,
- globals__lookup_bool_option(Globals, split_c_files, yes)
- ->
- FindTargetFiles = split_c_find_target_files
- ;
( CompilationTarget = c, TargetSuffix = ".c"
; CompilationTarget = il, TargetSuffix = ".il"
; CompilationTarget = java, TargetSuffix = ".java"
; CompilationTarget = asm, TargetSuffix = ".s"
),
FindTargetFiles = usual_find_target_files(CompilationTarget,
- TargetSuffix, TopLevelModuleName)
- ).
-
-:- pred split_c_find_target_files(module_name::in, list(file_name)::out,
- io::di, io::uo) is det.
-
-split_c_find_target_files(ModuleName, [FileName], !IO) :-
- globals__io_lookup_string_option(object_file_extension, Obj, !IO),
- % We don't know how many chunks there should be, so just check
- % the first.
- module_name_to_split_c_file_name(ModuleName, 0, Obj, FileName, !IO).
+ TargetSuffix, TopLevelModuleName).
:- pred usual_find_target_files(compilation_target::in, string::in,
module_name::in, module_name::in, list(file_name)::out,
@@ -1331,9 +1315,8 @@
CompilationTarget = asm,
ModuleName \= TopLevelModuleName
->
- % With `--target asm' all the nested
- % sub-modules are placed in the `.s' file
- % of the top-level module.
+ % With `--target asm' all the nested sub-modules are placed
+ % in the `.s' file of the top-level module.
TargetFiles = []
;
module_name_to_file_name(ModuleName, TargetSuffix, yes, FileName, !IO),
@@ -4105,7 +4088,7 @@
list__condense([StaticCells, ClosureLayouts, StackLayouts,
TypeCtorTables, TypeClassInfos, AditiProcInfos], AllData),
construct_c_file(HLDS, C_InterfaceInfo, Procs, GlobalVars, AllData, CFile,
- NumChunks, !IO),
+ !IO),
module_info_get_complexity_proc_infos(HLDS, ComplexityProcs),
output_llds(ModuleName, CFile, ComplexityProcs, LayoutLabels, MaybeRLFile,
Verbose, Stats, !IO),
@@ -4120,7 +4103,7 @@
(
TargetCodeOnly = no,
io__output_stream(OutputStream, !IO),
- c_to_obj(OutputStream, ModuleName, NumChunks, CompileOK, !IO),
+ c_to_obj(OutputStream, ModuleName, CompileOK, !IO),
module_get_fact_table_files(HLDS, FactTableBaseFiles),
list__map2_foldl(compile_fact_table_file(OutputStream),
FactTableBaseFiles, FactTableObjFiles, FactTableCompileOKs, !IO),
@@ -4137,10 +4120,10 @@
:- pred construct_c_file(module_info::in, foreign_interface_info::in,
list(c_procedure)::in, list(comp_gen_c_var)::in, list(comp_gen_c_data)::in,
- c_file::out, int::out, io::di, io::uo) is det.
+ c_file::out, io::di, io::uo) is det.
construct_c_file(ModuleInfo, C_InterfaceInfo, Procedures, GlobalVars, AllData,
- CFile, ComponentCount, !IO) :-
+ CFile, !IO) :-
C_InterfaceInfo = foreign_interface_info(ModuleSymName, C_HeaderCode0,
C_Includes, C_BodyCode0, _C_ExportDecls, C_ExportDefns),
MangledModuleName = sym_name_mangle(ModuleSymName),
@@ -4174,14 +4157,7 @@
CFile = c_file(ModuleSymName, C_HeaderCode, C_BodyCode, C_ExportDefns,
GlobalVars, AllData, ChunkedModules, UserInitPredCNames,
- UserFinalPredCNames),
- list__length(C_BodyCode, UserCCodeCount),
- list__length(C_ExportDefns, ExportCount),
- list__length(GlobalVars, CompGenVarCount),
- list__length(AllData, CompGenDataCount),
- list__length(ChunkedModules, CompGenCodeCount),
- ComponentCount = UserCCodeCount + ExportCount + CompGenVarCount +
- CompGenDataCount + CompGenCodeCount.
+ UserFinalPredCNames).
:- pred foreign_decl_code_is_local(foreign_decl_code::in) is semidet.
@@ -4272,25 +4248,17 @@
maybe_flush_output(Verbose, !IO),
maybe_report_stats(Stats, !IO).
-:- pred c_to_obj(io__output_stream::in, module_name::in,
- int::in, bool::out, io::di, io::uo) is det.
+:- pred c_to_obj(io__output_stream::in, module_name::in, bool::out,
+ io::di, io::uo) is det.
-c_to_obj(ErrorStream, ModuleName, NumChunks, Succeeded, !IO) :-
- globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
- (
- SplitFiles = yes,
- compile_target_code__split_c_to_obj(ErrorStream, ModuleName,
- NumChunks, Succeeded, !IO)
- ;
- SplitFiles = no,
+c_to_obj(ErrorStream, ModuleName, Succeeded, !IO) :-
get_linked_target_type(LinkedTargetType, !IO),
get_object_code_type(LinkedTargetType, PIC, !IO),
maybe_pic_object_file_extension(PIC, Obj, !IO),
module_name_to_file_name(ModuleName, ".c", no, C_File, !IO),
module_name_to_file_name(ModuleName, Obj, yes, O_File, !IO),
compile_target_code__compile_c_file(ErrorStream, PIC, C_File, O_File,
- Succeeded, !IO)
- ).
+ Succeeded, !IO).
:- pred compile_fact_table_file(io__output_stream::in, string::in,
string::out, bool::out, io::di, io::uo) is det.
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.365
diff -u -b -r1.365 modules.m
--- compiler/modules.m 23 Nov 2005 04:44:06 -0000 1.365
+++ compiler/modules.m 24 Nov 2005 04:15:42 -0000
@@ -107,27 +107,6 @@
:- pred module_name_to_lib_file_name(string::in, module_name::in, string::in,
bool::in, file_name::out, io::di, io::uo) is det.
- % module_name_to_split_c_file_name(Module, Num, Extension, FileName):
- %
- % Like module_name_to_file_name, but also allows a sequence number.
- % The files produced by this predicate will all be in a subdirectory
- % DirName, which be obtained by calling
- % `module_name_to_file_name(Module, ".dir", DirName)'.
- % This predicate does not create that directory.
- %
- % This predicate is used for the names of .c and .$O files for
- % --split-c-files.
- %
-:- pred module_name_to_split_c_file_name(module_name::in, int::in, string::in,
- file_name::out, io::di, io::uo) is det.
-
- % module_name_to_split_c_file_pattern(Module, Extension, FileName):
- % Like module_name_to_split_c_file_name, but generates a wildcard pattern
- % to match all such files with the given extension for the given module.
- %
-:- pred module_name_to_split_c_file_pattern(module_name::in, string::in,
- file_name::out, io::di, io::uo) is det.
-
% fact_table_file_name(Module, FactTableFileName, Ext, MkDir, FileName):
% Returns the filename to use when compiling fact table files.
% If 'MkDir' is yes, then create any directories needed.
@@ -923,8 +902,6 @@
% executable files
( Ext = ""
; Ext = ".exe"
- ; Ext = ".split"
- ; Ext = ".split.exe"
; Ext = ".dll"
% library files
; Ext = ".a"
@@ -933,11 +910,6 @@
; Ext = ".dylib"
; Ext = ".$(EXT_FOR_SHARED_LIB)"
; Ext = ".jar"
- ; Ext = ".split.a"
- ; Ext = ".split.$A"
- ; Ext = ".split.so"
- ; Ext = ".split.dylib"
- ; Ext = ".split.$(EXT_FOR_SHARED_LIB)"
; Ext = ".init"
% mercury_update_interface
% requires the `.init.tmp' files to
@@ -1071,19 +1043,6 @@
make_file_name(SubDirName, Search, MkDir, BaseName, Ext, FileName, !IO)
).
-module_name_to_split_c_file_name(ModuleName, Num, Ext, FileName, !IO) :-
- module_name_to_file_name(ModuleName, ".dir", no, DirName, !IO),
- unqualify_name(ModuleName, BaseFileName),
- dir__directory_separator(Slash),
- string__format("%s%c%s_%03d%s",
- [s(DirName), c(Slash), s(BaseFileName), i(Num), s(Ext)],
- FileName).
-
-module_name_to_split_c_file_pattern(ModuleName, Ext, Pattern, !IO) :-
- module_name_to_file_name(ModuleName, ".dir", no, DirName, !IO),
- dir__directory_separator(Slash),
- string__format("%s%c*%s", [s(DirName), c(Slash), s(Ext)], Pattern).
-
file_name_to_module_name(FileName, ModuleName) :-
string_to_sym_name(FileName, ".", ModuleName).
@@ -1225,9 +1184,7 @@
).
file_is_arch_or_grade_dependent(Globals, Ext) :-
globals__lookup_string_option(Globals, library_extension, LibExt),
- ( Ext = LibExt
- ; Ext = ".split" ++ LibExt
- ).
+ Ext = LibExt.
file_is_arch_or_grade_dependent(Globals, Ext) :-
globals__lookup_string_option(Globals, shared_library_extension, Ext).
@@ -1254,13 +1211,9 @@
file_is_arch_or_grade_dependent_2(".java_date").
file_is_arch_or_grade_dependent_2(".class").
file_is_arch_or_grade_dependent_2(".dir").
-file_is_arch_or_grade_dependent_2(".num_split").
file_is_arch_or_grade_dependent_2(".dll").
file_is_arch_or_grade_dependent_2(".$A").
file_is_arch_or_grade_dependent_2(".a").
-file_is_arch_or_grade_dependent_2(".split.$A").
-file_is_arch_or_grade_dependent_2(".split.a").
-file_is_arch_or_grade_dependent_2(".split").
file_is_arch_or_grade_dependent_2("_init.c").
file_is_arch_or_grade_dependent_2("_init.$O").
@@ -3093,8 +3046,6 @@
module_name_to_file_name(ModuleName, ".pic_o", no, PicObjFileName,
!IO),
module_name_to_file_name(ModuleName, ".int0", no, Int0FileName, !IO),
- module_name_to_split_c_file_pattern(ModuleName, ".$O",
- SplitObjPattern, !IO),
io__write_strings(DepStream, ["\n\n",
OptDateFileName, " ",
TransOptDateFileName, " ",
@@ -3102,7 +3053,6 @@
CDateFileName, " ",
AsmDateFileName, " ",
PicAsmDateFileName, " ",
- SplitObjPattern, " ",
RLOFileName, " ",
ILDateFileName, " ",
JavaDateFileName
@@ -3183,7 +3133,6 @@
CDateFileName, " ",
AsmDateFileName, " ",
PicAsmDateFileName, " ",
- SplitObjPattern, " ",
RLOFileName, " ",
ILDateFileName, " ",
JavaDateFileName, " : "
@@ -3219,7 +3168,6 @@
CDateFileName, " ",
AsmDateFileName, " ",
PicAsmDateFileName, " ",
- SplitObjPattern, " ",
RLOFileName, " ",
ILDateFileName, " ",
JavaDateFileName, " : "
@@ -3245,37 +3193,30 @@
HighLevelCode = yes,
CompilationTarget = c
->
- %
- % For --high-level-code with --target c,
- % we need to make sure that we
- % generate the header files for imported modules
- % before compiling the C files, since the generated C
- % files #include those header files.
- %
+ % For --high-level-code with --target c, we need to make sure that
+ % we generate the header files for imported modules before
+ % compiling the C files, since the generated C files
+ % #include those header files.
+
io__write_strings(DepStream, [
"\n\n",
PicObjFileName, " ",
- ObjFileName, " ",
- SplitObjPattern, " :"
+ ObjFileName, " :"
], !IO),
write_dependencies_list(AllDeps, ".mih", DepStream, !IO)
;
true
),
- %
- % We need to tell make how to make the header
- % files. The header files are actually built by
- % the same command that creates the .c or .s file,
- % so we just make them depend on the .c or .s files.
- % This is needed for the --high-level-code rule above,
- % and for the rules introduced for
- % `:- pragma foreign_import_module' declarations.
- % In some grades the header file won't actually be built
- % (e.g. LLDS grades for modules not containing
- % `:- pragma export' declarations), but this
- % rule won't do any harm.
- %
+ % We need to tell make how to make the header files. The header files
+ % are actually built by the same command that creates the .c or .s
+ % file, so we just make them depend on the .c or .s files.
+ % This is needed for the --high-level-code rule above, and for
+ % the rules introduced for `:- pragma foreign_import_module'
+ % declarations. In some grades the header file won't actually be built
+ % (e.g. LLDS grades for modules not containing `:- pragma export'
+ % declarations), but this rule won't do any harm.
+
module_name_to_file_name(ModuleName, ".c", no, CFileName, !IO),
module_name_to_file_name(ModuleName, ".s", no, AsmFileName, !IO),
module_name_to_file_name(ModuleName, ".mh", no, HeaderFileName, !IO),
@@ -3283,11 +3224,9 @@
io__write_strings(DepStream, [
"\n\n",
"ifeq ($(TARGET_ASM),yes)\n",
- HeaderFileName, " ", HeaderFileName2,
- " : ", AsmFileName, "\n",
+ HeaderFileName, " ", HeaderFileName2, " : ", AsmFileName, "\n",
"else\n",
- HeaderFileName, " ", HeaderFileName2,
- " : ", CFileName, "\n",
+ HeaderFileName, " ", HeaderFileName2, " : ", CFileName, "\n",
"endif"
], !IO),
@@ -3347,6 +3286,7 @@
io__write_strings(DepStream, [" : ", SourceFileName], !IO),
write_dependencies_list(LongDeps, ".int3", DepStream, !IO),
write_dependencies_list(ShortDeps, ".int3", DepStream, !IO),
+ io__write_string(DepStream, "\n\n", !IO),
%
% If we can pass the module name rather than the
@@ -3363,34 +3303,6 @@
ModuleArg = SourceFileName
),
- %
- % XXX The rule below will cause an undefined make
- % variable warning for $(MCFLAGS-module) when run,
- % but there's no easy way to avoid that without using
- % features only available in recent versions of make.
- % The special case handling of $(MCFLAGS-module) in
- % this rule is necessary because it's difficult to extract
- % the module name from $@ (e.g. module.dir/module_000.o) in
- % the code for TARGET_MCFLAGS in Mmake.vars.in using make's
- % text handling functions ($(patsubst ...) only works for a
- % single occurrence of the pattern).
- %
- % With recent versions of make (3.78 or later) it would be
- % possible to avoid the warning using
- % $(if $(findstring undefined,$(origin MCFLAGS-module)),,\
- % $(MCFLAGS-module))
- %
- module_name_to_file_name(ModuleName, ".dir", no, DirFileName, !IO),
- io__write_strings(DepStream, [
- "\n\n",
- SplitObjPattern, " : ",
- SourceFileName, "\n",
- "\trm -rf ", DirFileName, "\n",
- "\t$(MCS) $(ALL_GRADEFLAGS) $(ALL_MCSFLAGS) ",
- "$(MCFLAGS-", MakeVarName, ") ",
- ModuleArg, "\n\n"
- ], !IO),
-
globals__io_get_target(Target, !IO),
globals__io_lookup_bool_option(sign_assembly, SignAssembly, !IO),
globals__io_get_globals(Globals, !IO),
@@ -4861,12 +4773,6 @@
io__write_string(DepStream, "\n", !IO),
io__write_string(DepStream, MakeVarName, !IO),
- io__write_string(DepStream, ".num_splits = ", !IO),
- write_compact_dependencies_list(Modules, "$(num_splits_subdir)",
- ".num_split", Basis, DepStream, !IO),
- io__write_string(DepStream, "\n", !IO),
-
- io__write_string(DepStream, MakeVarName, !IO),
io__write_string(DepStream, ".dir_os = ", !IO),
write_compact_dependencies_list(Modules, "$(dirs_subdir)", ".dir/*.$O",
Basis, DepStream, !IO),
@@ -5194,28 +5100,6 @@
),
io__write_strings(DepStream, Rules, !IO),
- module_name_to_file_name(ModuleName, ".split", yes, SplitExeFileName, !IO),
- module_name_to_file_name(ModuleName, ".split.$A", yes, SplitLibFileName,
- !IO),
- io__write_strings(DepStream, [
- SplitExeFileName, " : ", SplitLibFileName, " ", InitObjFileName, " ",
- All_MLObjsString, " ", All_MLLibsDepString, "\n",
- "\t$(ML) $(ALL_GRADEFLAGS) $(ALL_MLFLAGS) -- $(ALL_LDFLAGS) ",
- "-o ", SplitExeFileName, " ", InitObjFileName, " \\\n",
- "\t\t", SplitLibFileName, " ", All_MLObjsString, " $(ALL_MLLIBS)\n\n"
- ], !IO),
-
- io__write_strings(DepStream, [
- SplitLibFileName, " : $(", MakeVarName, ".dir_os) ",
- All_MLObjsString, "\n",
- "\trm -f ", SplitLibFileName, "\n",
- "\t$(AR) $(ALL_ARFLAGS) $(AR_LIBFILE_OPT) ",
- SplitLibFileName, " ", All_MLObjsString, "\n",
- "\tfind $(", MakeVarName, ".dirs) -name ""*.$O"" -print | \\\n",
- "\t\txargs $(AR) q ", SplitLibFileName, "\n",
- "\t$(RANLIB) $(ALL_RANLIBFLAGS) ", SplitLibFileName, "\n\n"
- ], !IO),
-
globals__io_lookup_bool_option(intermodule_optimization, Intermod, !IO),
(
Intermod = yes,
@@ -5615,7 +5499,6 @@
".PHONY : ", CleanTargetName, "\n",
CleanTargetName, " :\n",
"\t-echo $(", MakeVarName, ".dirs) | xargs rm -rf \n",
- "\t-echo $(", MakeVarName, ".num_splits) | xargs rm -rf \n",
"\t-echo $(", MakeVarName, ".cs) ", InitCFileName,
" | xargs rm -f\n",
"\t-echo $(", MakeVarName, ".mihs) | xargs rm -f\n",
@@ -5675,8 +5558,6 @@
io__write_strings(DepStream, [
"\t-rm -f ",
ExeFileName, "$(EXT_FOR_EXE) ",
- SplitExeFileName, " ",
- SplitLibFileName, " ",
InitFileName, " ",
LibFileName, " ",
SharedLibFileName, " ",
Index: compiler/options.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/options.m,v
retrieving revision 1.478
diff -u -b -r1.478 options.m
--- compiler/options.m 20 Nov 2005 23:08:10 -0000 1.478
+++ compiler/options.m 22 Nov 2005 02:06:09 -0000
@@ -457,7 +457,6 @@
; use_opt_files
; use_trans_opt_files
; transitive_optimization
- ; split_c_files
% - HLDS
; allow_inlining
@@ -1137,7 +1136,6 @@
termination_norm - string("total"),
termination_error_limit - int(3),
termination_path_limit - int(256),
- split_c_files - bool(no),
termination2 - bool(no),
termination2_norm - string("total"),
check_termination2 - bool(no),
@@ -2037,8 +2035,6 @@
long_option("procs-per-C-function", procs_per_c_function).
long_option("everything-in-one-c-function", everything_in_one_c_function).
long_option("everything-in-one-C-function", everything_in_one_c_function).
-long_option("split-c-files", split_c_files).
-long_option("split-C-files", split_c_files).
long_option("inline-alloc", inline_alloc).
% Target code compilation options
@@ -3811,18 +3807,7 @@
"--intermodule-analysis",
"\tPerform analyses such as termination analysis and",
"\tunused argument elimination across module boundaries.",
- "\tThis option is not yet fully implemented.",
- "--split-c-files",
- "\tGenerate each C function in its own C file,",
- "\tso that the linker will optimize away unused code.",
- "\tThis option significantly increases compilation time,",
- "\tlink time, and intermediate disk space requirements,",
- "\tbut in return reduces the size of the final",
- "\texecutable, typically by about 10-20%.",
- "\tThis option is only useful with `--procs-per-c-function 1',",
- "\tso this option automatically sets `--procs-per-c-function 1'.",
- "\tThe `--high-level-code' back-end does not support",
- "\t`--split-c-files'."
+ "\tThis option is not yet fully implemented."
]).
:- pred options_help_hlds_hlds_optimization(io::di, io::uo) is det.
Index: compiler/rtti_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rtti_out.m,v
retrieving revision 1.57
diff -u -b -r1.57 rtti_out.m
--- compiler/rtti_out.m 28 Oct 2005 02:10:35 -0000 1.57
+++ compiler/rtti_out.m 10 Nov 2005 13:52:03 -0000
@@ -71,8 +71,8 @@
% --split-c-files option; it governs whether the rtti_data is declared
% in the generated code or not.
%
-:- pred rtti_out__register_rtti_data_if_nec(rtti_data::in, bool::in,
- io::di, io::uo) is det.
+:- pred rtti_out__register_rtti_data_if_nec(rtti_data::in, io::di, io::uo)
+ is det.
% Output the C name of the rtti_data specified by the given rtti_id.
%
@@ -1312,7 +1312,7 @@
io__nl(!IO),
output_rtti_type_decl(RttiId, !DeclSet, !IO),
globals__io_get_globals(Globals, !IO),
- LinkageStr = c_data_linkage_string(Globals, Linkage, yes, no),
+ LinkageStr = c_data_linkage_string(Linkage, no),
InclCodeAddr = rtti_id_would_include_code_addr(RttiId),
io__write_string(LinkageStr, !IO),
@@ -1388,7 +1388,7 @@
output_rtti_type_decl(RttiId, !DeclSet, !IO),
rtti_id_linkage(RttiId, Linkage),
globals__io_get_globals(Globals, !IO),
- LinkageStr = c_data_linkage_string(Globals, Linkage, yes, BeingDefined),
+ LinkageStr = c_data_linkage_string(Linkage, BeingDefined),
io__write_string(LinkageStr, !IO),
InclCodeAddr = rtti_id_would_include_code_addr(RttiId),
@@ -1545,18 +1545,11 @@
true
).
-rtti_out__register_rtti_data_if_nec(Data, SplitFiles, !IO) :-
+rtti_out__register_rtti_data_if_nec(Data, !IO) :-
( Data = type_ctor_info(TypeCtorData) ->
RttiTypeCtor = tcd_get_rtti_type_ctor(TypeCtorData),
RttiId = ctor_rtti_id(RttiTypeCtor, type_ctor_info),
io__write_string("\t{\n\t", !IO),
- (
- SplitFiles = yes,
- output_rtti_id_storage_type_name_no_decl(RttiId, no, !IO),
- io__write_string(";\n", !IO)
- ;
- SplitFiles = no
- ),
io__write_string("\tMR_register_type_ctor_info(\n\t\t&", !IO),
output_rtti_id(RttiId, !IO),
io__write_string(");\n\t}\n", !IO)
@@ -1565,14 +1558,6 @@
TCId = tc_id(TCName, _, _),
RttiId = tc_rtti_id(TCName, type_class_decl),
io__write_string("\t{\n\t", !IO),
- (
- SplitFiles = yes,
- output_rtti_id_storage_type_name_no_decl(RttiId, no,
- !IO),
- io__write_string(";\n", !IO)
- ;
- SplitFiles = no
- ),
io__write_string("\tMR_register_type_class_decl(\n\t\t&", !IO),
output_rtti_id(RttiId, !IO),
io__write_string(");\n\t}\n", !IO)
@@ -1580,16 +1565,7 @@
TCInstance = tc_instance(TCName, TCTypes, _, _, _),
RttiId = tc_rtti_id(TCName, type_class_instance(TCTypes)),
io__write_string("\t{\n\t", !IO),
- (
- SplitFiles = yes,
- output_rtti_id_storage_type_name_no_decl(RttiId, no,
- !IO),
- io__write_string(";\n", !IO)
- ;
- SplitFiles = no
- ),
- io__write_string("\tMR_register_type_class_instance(\n\t\t&",
- !IO),
+ io__write_string("\tMR_register_type_class_instance(\n\t\t&", !IO),
output_rtti_id(RttiId, !IO),
io__write_string(");\n\t}\n", !IO)
;
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.459
diff -u -b -r1.459 user_guide.texi
--- doc/user_guide.texi 12 Nov 2005 10:16:53 -0000 1.459
+++ doc/user_guide.texi 13 Nov 2005 23:45:25 -0000
@@ -534,12 +534,6 @@
Compiles and links @var{main-module} using the Mercury compiler.
Error messages are placed in @file{.err} files.
- at item @var{main-module}.split
-Compiles and links @var{main-module} using the Mercury compiler,
-with the Mercury compiler's @samp{--split-c-files} option enabled.
-For more information about @samp{--split-c-files}, see
- at ref{Output-level (LLDS -> C) optimization options}.
-
@item @var{main-module}.javas
Compiles @var{main-module} to Java source files (@file{*.java}).
@@ -606,10 +600,8 @@
and also the various possible executables, libraries and dependency files
for the program as a whole ---
@samp{@var{main-module}},
- at samp{@var{main-module}.split},
@samp{lib at var{main-module}.a},
@samp{lib at var{main-module}.so},
- at samp{@var{main-module}.split.a},
@samp{@var{main-module}.init},
@samp{@var{main-module}.dep}
and
@@ -6884,34 +6876,6 @@
unused argument elimination across module boundaries.
This option is not yet fully implemented.
- at sp 1
- at item --split-c-files
- at findex --split-c-files
- at findex --optimize-dead-procs
- at cindex Optimizing code size
- at cindex Optimizing space
-Generate each C function in its own C file,
-so that the linker will optimize away unused code.
-This has the same effect as @samp{--optimize-dead-procs},
-except that it works globally at link time, rather than
-over a single module, so it does a much better job of
-eliminating unused procedures.
-This option significantly increases compilation time,
-link time, and intermediate disk space requirements,
-but in return reduces the size of the final
-executable, typically by about 10--20%.
-This option is only useful with @samp{--procs-per-c-function 1},
-so this option automatically sets @samp{--procs-per-c-function 1}.
-
- at findex --high-level-code
-The @samp{--high-level-code} back-end does not support
- at samp{--split-c-files}.
-
-N.B. When using @samp{mmake}, the @samp{--split-c-files} option should
-not be placed in the @samp{MCFLAGS} variable. Instead, use the
- at samp{@var{MODULE}.split} target, i.e.@: type @samp{mmake foo.split}
-rather than @samp{mmake foo}.
-
@end table
@node High-level (HLDS -> HLDS) optimization options
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing mdbcomp
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
Index: scripts/Mmake.rules
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/Mmake.rules,v
retrieving revision 1.148
diff -u -b -r1.148 Mmake.rules
--- scripts/Mmake.rules 20 May 2005 06:15:20 -0000 1.148
+++ scripts/Mmake.rules 10 Nov 2005 14:07:17 -0000
@@ -483,12 +483,6 @@
lib%.install_library
$(MMAKE) lib$*.install_grades || { mercury_cleanup_install && exit 1; }
-.PHONY: lib%.install_split
-lib%.install_split: lib%.install_ints lib%.install_init \
- lib%.install_split_library
- $(MMAKE) lib$*.install_split_grades || \
- { mercury_cleanup_install && exit 1; }
-
.PHONY: lib%.install_init
lib%.install_init: %.init install_lib_dirs
$(INSTALL) `vpath_find $*.init` $(INSTALL_MODULE_DIR)
@@ -501,10 +495,6 @@
$(INSTALL_MERC_LIB_DIR)
$(RANLIB) $(INSTALL_MERC_LIB_DIR)/lib$*.$A
-lib%.install_split_library: %.split.$A install_grade_dirs
- $(INSTALL) `vpath_find $*.split.$A` $(INSTALL_MERC_LIB_DIR)/lib$*.$A
- $(RANLIB) $(INSTALL_MERC_LIB_DIR)/lib$*.$A
-
# XXX grade_files only contains the files for the default grade, not the
# current grade in each iteration of the loop over ALL_LIBGRADES below.
lib%.install_grades:
@@ -543,27 +533,6 @@
{ mv -f tmp_dir/*.dep tmp_dir/*.dv $(deps_subdir).; \
mv -f tmp_dir/* .; rmdir tmp_dir; true; }
-lib%.install_split_grades:
- rm -rf tmp_dir && \
- mkdir tmp_dir && \
- { mv -f $(deps_subdir)$*.dep $(deps_subdir)$*.dv $($*.mihs) \
- $($*.dirs) *.a *.so tmp_dir || true; } && \
- for grade in $(ALL_LIBGRADES); do \
- if [ "$$grade" != "$(GRADE)" ]; then \
- $(MMAKE) GRADE=$$grade $*.depend || \
- exit 1; \
- $(MMAKE) GRADE=$$grade lib$*.install_split_library || \
- exit 1; \
- rm -rf $(deps_subdir)$*.dep $(deps_subdir)$*.dv \
- $($*.mihs) $($*.dirs) *.a *.so; \
- fi; \
- done && \
- { mv tmp_dir/*.dir $(dirs_subdir). ; \
- mv tmp_dir/*.dep $(deps_subdir). ; \
- mv tmp_dir/*.dv $(deps_subdir). ; \
- mv tmp_dir/* . ; rmdir tmp_dir ; true; }
-
-
.PHONY: install_lib_dirs
install_lib_dirs:
-[ -d $(INSTALL_INT_DIR) ] || $(INSTALL_MKDIR) $(INSTALL_INT_DIR)
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.98
diff -u -b -r1.98 Mmake.vars.in
--- scripts/Mmake.vars.in 12 Nov 2005 10:16:55 -0000 1.98
+++ scripts/Mmake.vars.in 13 Nov 2005 23:45:30 -0000
@@ -144,7 +144,6 @@
MC_MAKE_FLAGS =
EXTRA_MC_MAKE_FLAGS =
-MCS = $(MC) --split-c-files --compile-only
MCG = $(MC) --compile-to-c
MCE = $(MC) --errorcheck-only
MCD = $(MC) --generate-dependencies
@@ -613,7 +612,6 @@
ils_subdir=$(SUBDIR)ils/
javas_subdir=$(SUBDIR)javas/
dirs_subdir=$(SUBDIR)dirs/
-num_splits_subdir=$(SUBDIR)num_splits/
c_dates_subdir=$(SUBDIR)c_dates/
s_dates_subdir=$(SUBDIR)s_dates/
pic_s_dates_subdir=$(SUBDIR)pic_s_dates/
@@ -653,7 +651,6 @@
ils_subdir=
javas_subdir=
dirs_subdir=
-num_splits_subdir=
c_dates_subdir=
s_dates_subdir=
pic_s_dates_subdir=
Index: scripts/mgnuc.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mgnuc.in,v
retrieving revision 1.112
diff -u -b -r1.112 mgnuc.in
--- scripts/mgnuc.in 25 Oct 2005 10:17:28 -0000 1.112
+++ scripts/mgnuc.in 25 Nov 2005 03:13:09 -0000
@@ -117,9 +117,6 @@
Disable optimization by the C compiler.
--inline-alloc
Inline calls to the memory allocator.
- --split-c-files
- This option must be specified if the argument C files were generated
- by the Mercury compiler with --split-c-files.
--mercury-standard-library-directory <directory>
--mercury-stdlib-dir <directory>
The directory containing the installed Mercury standard library.
Index: scripts/mgnuc_file_opts.sh-subr
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mgnuc_file_opts.sh-subr,v
retrieving revision 1.1
diff -u -b -r1.1 mgnuc_file_opts.sh-subr
--- scripts/mgnuc_file_opts.sh-subr 19 Sep 2005 08:07:09 -0000 1.1
+++ scripts/mgnuc_file_opts.sh-subr 25 Nov 2005 03:13:13 -0000
@@ -37,11 +37,6 @@
--no-check)
CHECK_OPTS= ;;
- --split-c-files)
- SPLIT_OPTS=-DMR_SPLIT_C_FILES ;;
- --no-split-c-files)
- SPLIT_OPTS= ;;
-
--inline-alloc)
INLINE_ALLOC_OPTS="-DMR_INLINE_ALLOC -DSILENT" ;;
--no-inline-alloc)
cvs diff: Diffing slice
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
Index: tests/hard_coded/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/hard_coded/Mmakefile,v
retrieving revision 1.275
diff -u -b -r1.275 Mmakefile
--- tests/hard_coded/Mmakefile 19 Nov 2005 07:43:49 -0000 1.275
+++ tests/hard_coded/Mmakefile 22 Nov 2005 02:06:18 -0000
@@ -503,32 +503,9 @@
$(DOTNET_PROGS) $(JAVA_PROGS) $(TRAILED_PROGS)
endif
-# --split-c-files does not work in the hl* grades (e.g. hlc.gc),
-# because it hasn't yet been implemented yet.
-# The same is true for deep profiling grades and `mmc --make'.
-#
-# --split-c-files also doesn't work on MacOS X.
-#
-#ifneq "$(findstring apple-darwin,$(FULLARCH))" "apple-darwin"
-# ifeq "$(findstring yes,$(MMAKE_USE_MMC_MAKE))$(filter hl% il% java%,$(GRADE))$(findstring profdeep,$(GRADE))" ""
-# SPLIT_PROGS = mapped_module split_c_files
-# else
-# SPLIT_PROGS =
-# endif
-#else
-# SPLIT_PROGS =
-#endif
-
-# We don't currently test any programs that use '--split-c-files' because that
-# option has been incompatible with the version of mkinit used since about
-# rotd-2005-10-19.
-#
-SPLIT_PROGS =
-
-
#-----------------------------------------------------------------------------#
-TESTS = $(PROGS) $(SPLIT_PROGS:%=%.split)
+TESTS = $(PROGS)
SUBDIRS = typeclasses sub-modules exceptions purity
TESTS_DIR=..
include $(TESTS_DIR)/Mmake.common
@@ -539,9 +516,6 @@
%.runtest: %.res ;
-$(SPLIT_PROGS:%=%.split.depend): %.split.depend: %.depend ;
-$(SPLIT_PROGS:%=%.split.realclean): %.split.realclean: %.realclean ;
-
mapped_module.depend: Mercury.modules
#-----------------------------------------------------------------------------#
Index: tests/hard_coded/mapped_module.split.exp
===================================================================
RCS file: tests/hard_coded/mapped_module.split.exp
diff -N tests/hard_coded/mapped_module.split.exp
--- tests/hard_coded/mapped_module.split.exp 25 Jun 2002 15:12:30 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1 +0,0 @@
-OK
Index: tests/hard_coded/split_c_files.m
===================================================================
RCS file: tests/hard_coded/split_c_files.m
diff -N tests/hard_coded/split_c_files.m
--- tests/hard_coded/split_c_files.m 25 Sep 2001 09:37:12 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,31 +0,0 @@
-%% This is a regression test: mmc versions 0.8 and 0.9 generated incorrect
-%% C code for this test case, when compiled with --split-c-files --debug.
-
-:- module split_c_files.
-
-:- interface.
-
-:- import_module list, io.
-
-
-:- pred main(state::di, state::uo) is det.
-
-:- pred app(list(T),list(T),list(T)).
-:- mode app(out,in,in) is nondet.
-
-:- implementation.
-:- import_module std_util.
-
-main -->
- { solutions((pred(X::out) is nondet :- app(X, [4], [1,2,3,4])),
- L) },
- write_list(L, "\n", print),
- nl.
-
-split_c_files:(app(Z76,Ys,A77)) :-
- =(Z76,[]),
- =(A77,Ys).
-split_c_files:(app(Z76,A77,B77)) :-
- =(B77,[X|Zs]),
- split_c_files:(app(Xs,A77,Zs)),
- =(Z76,[X|Xs]).
Index: tests/hard_coded/split_c_files.split.exp
===================================================================
RCS file: tests/hard_coded/split_c_files.split.exp
diff -N tests/hard_coded/split_c_files.split.exp
--- tests/hard_coded/split_c_files.split.exp 21 Mar 2000 04:54:39 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1 +0,0 @@
-[1, 2, 3]
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list