Files
mercury/mdbcomp/mdbcomp.m
Zoltan Somogyi 0d1ac0f053 Prevent not just the deep profiler, but also the other programs in the
Estimated hours taken: 1
Branches: main

Prevent not just the deep profiler, but also the other programs in the
Mercury system from running out of stack in hlc grades.

mdbcomp/shared_utilities.m:
	A new module to contain the predicate that increases OS limits
	on stack usage as much as possible.

mdbcomp/mdbcomp.m:
	Include the new module in this package.

deep_profiler/startup.m:
	Remove the stack unlimit predicate that is now in
	mdbcomp/shared_utilities.m.

deep_profiler/Mmakefile:
slice/Mmakefile:
	Copy the new file over from mdbcomp, along with the rest of the files
	in the mdbcomp package.

compiler/mercury_compile.m:
slice/mcov.m:
slice/mdice.m:
slice/mslice.m:
slice/mtc_diff.m:
slice/mtc_union.m:
	Invoke the stack unlimit predicate.

mdbcomp/prim_data.m:
	Fix a missing divider.
2012-03-27 23:29:15 +00:00

57 lines
2.0 KiB
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
% Copyright (C) 2003, 2005-2006, 2010-2012 The University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%---------------------------------------------------------------------------%
%
% This is the top module of a library that contains information shared
% between the debugger and the compiler. This means mostly the definitions
% of data structures that the compiler generates for the debugger, and
% the predicates that operate on them.
%
% The compiler links in this library in all grades, but links in the browser
% library (module mdb and its submodules) only when debugging is enabled.
% Therefore the modules of the mdbcomp library should avoid importing any
% part of the mdb module.
:- module mdbcomp.
:- interface.
:- pred mdbcomp.version(string::out) is det.
% If you add any modules here, you should update the lists in
% deep_profiler/Mmakefile and slice/Mmakefile.
:- include_module feedback.
:- include_module goal_path.
:- include_module prim_data.
:- include_module program_representation.
:- include_module rtti_access.
:- include_module shared_utilities.
:- include_module slice_and_dice.
:- include_module trace_counts.
:- implementation.
% See library/library.m for why we implement this predicate this way.
:- pragma foreign_proc("C",
mdbcomp.version(Version::out),
[will_not_call_mercury, promise_pure, thread_safe],
"
MR_ConstString version_string;
version_string = MR_VERSION "", configured for "" MR_FULLARCH;
/*
** Cast away const needed here, because Mercury declares Version
** with type MR_String rather than MR_ConstString.
*/
Version = (MR_String) (MR_Word) version_string;
").
mdbcomp.version("unknown version").
%---------------------------------------------------------------------------%