mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-23 05:13:48 +00:00
Estimated hours taken: 3
Prefix everything defined in runtime/mercury_{stacks,tags}.h MR_.
In the process, get rid of the grade component MR_DEBUG_NONDET_STACK,
since this makes the update to mercury_stacks.h simpler and its use is
long obsolete.
runtime/mercury_tags.h:
Put MR_ prefixes in front of everything defined here.
runtime/mercury_stacks.h:
Put MR_ prefixes in front of everything defined here.
Remove support for MR_DEBUG_NONDET_STACK. Replace most of the
lost functionality by calling an updated mkframe_msg.
Remove the definitions of push() and pop(). Their use conflicts with
the idea that everything on the det stack is part of a frame, which
the RTTI stuff depends on.
runtime/mercury_bootstrap.h:
Add backward compatibility macros for the old names in the above two
files.
Remove some old entries in this file which are no longer needed.
runtime/mercury_wrapper.c:
Remove the only uses of push() and pop().
Put MR_ in front of some things that need them.
runtime/mercury_engine.c:
Put MR_ in front of some things that need them.
runtime/mercury_misc.[ch]:
Make mkframe_msg get the name of the procedure that owns the stack
frame from an explicitly passed argument, rather than the prednm slot
(which no longer exists). This actually improves low-level debugging
support without MR_DEBUG_NONDET_STACK.
Remove unnecessary return statements.
runtime/mercury_debug.h:
Pass on the new arg of mkframe_msg.
Fix long lines.
runtime/mercury_conf_param.h:
Remove the documentation of MR_DEBUG_NONDET_STACK.
runtime/mercury_grade.h:
Remove the grade component of MR_DEBUG_NONDET_STACK.
doc/reference_manual.texi:
Document the MR_ prefixed versions of list_empty, list_cons etc.
library/io.m:
library/std_util.m:
library/string.m:
Add prefixes to some references to the runtime.
84 lines
2.7 KiB
C
84 lines
2.7 KiB
C
/*
|
|
** Copyright (C) 1995-1999 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.
|
|
*/
|
|
|
|
/*
|
|
** mercury_misc.h - debugging messages,
|
|
** MR_warning(),
|
|
** fatal_error(),
|
|
** checked_malloc(),
|
|
** MR_memcpy
|
|
** MR_fd_zero
|
|
*/
|
|
|
|
#ifndef MERCURY_MISC_H
|
|
#define MERCURY_MISC_H
|
|
|
|
#include "mercury_types.h" /* for `Code *' */
|
|
#include <stdlib.h> /* for `size_t' */
|
|
|
|
#ifdef MR_LOWLEVEL_DEBUG
|
|
extern void mkframe_msg(const char *);
|
|
extern void succeed_msg(void);
|
|
extern void succeeddiscard_msg(void);
|
|
extern void fail_msg(void);
|
|
extern void redo_msg(void);
|
|
extern void call_msg(/* const */ Code *proc, /* const */ Code *succcont);
|
|
extern void tailcall_msg(/* const */ Code *proc);
|
|
extern void proceed_msg(void);
|
|
extern void cr1_msg(Word val0, const Word *addr);
|
|
extern void cr2_msg(Word val0, Word val1, const Word *addr);
|
|
extern void incr_hp_debug_msg(Word val, const Word *addr);
|
|
extern void incr_sp_msg(Word val, const Word *addr);
|
|
extern void decr_sp_msg(Word val, const Word *addr);
|
|
extern void push_msg(Word val, const Word *addr);
|
|
extern void pop_msg(Word val, const Word *addr);
|
|
#endif
|
|
|
|
#ifdef MR_DEBUG_GOTOS
|
|
extern void goto_msg(/* const */ Code *addr);
|
|
extern void reg_msg(void);
|
|
#endif
|
|
|
|
#ifdef MR_LOWLEVEL_DEBUG
|
|
extern void printint(Word n);
|
|
extern void printstring(const char *s);
|
|
extern void printheap(const Word *h);
|
|
extern void dumpframe(/* const */ Word *);
|
|
extern void dumpnondstack(void);
|
|
extern void printlist(Word p);
|
|
extern void printframe(const char *);
|
|
extern void printregs(const char *msg);
|
|
#endif
|
|
|
|
extern void printdetstack(const Word *s);
|
|
extern void MR_printdetstackptr(const Word *s);
|
|
extern void MR_print_detstackptr(FILE *fp, const Word *s);
|
|
extern void printnondstack(const Word *s);
|
|
extern void MR_printnondstackptr(const Word *s);
|
|
extern void MR_print_nondstackptr(FILE *fp, const Word *s);
|
|
extern void printlabel(/* const */ Code *w);
|
|
|
|
#if __GNUC__
|
|
#define NO_RETURN __attribute__((noreturn))
|
|
#else
|
|
#define NO_RETURN
|
|
#endif
|
|
extern void MR_warning(const char *msg, ...);
|
|
extern void fatal_error(const char *msg, ...) NO_RETURN;
|
|
|
|
/*
|
|
** We use our own version of memcpy because gcc recognises calls to the
|
|
** standard memcpy (even in things that do not mention memcpy by name, e.g.
|
|
** structure assignments) and generates inline code for them. Unfortunately
|
|
** this causes gcc to abort because it tries to use a register that we have
|
|
** already reserved.
|
|
** XXX We should fix this eventually by using -fno-builtin since pragma
|
|
** c_code may call the builtin functions.
|
|
*/
|
|
extern void MR_memcpy(void *dest, const void *src, size_t nbytes);
|
|
|
|
#endif /* not MERCURY_MISC_H */
|