Commit Graph

18 Commits

Author SHA1 Message Date
Zoltan Somogyi
7c9c341e01 Use explicit streams in profiler/*.m.
profiler/call_graph.m:
profiler/generate_output.m:
profiler/mercury_profile.m:
profiler/options.m:
profiler/output.m:
profiler/process_file.m:
profiler/read.m:
profiler/snapshots.m:
    Replace implicit streams with explicit streams.

profiler/PROF_FLAGS.in:
    Specify --warn-implicit-stream-calls for all modules in this directory.
2021-03-06 21:46:37 +11:00
Zoltan Somogyi
646b23fcf7 Convert (C->T;E) to (if C then T else E). 2015-11-30 10:39:53 +11:00
Julien Fischer
3d848cfc50 Documentation fixes.
browser/*.m:
deep_profiler/*.m:
profiler/*.m:
library/backjump.m:
library/injection.m:
library/stm_builtin.m:
library/thread.barrier.m:
     Fix spelling errors.

     Replace tabs with spaces in a couple of spots.

     Delete trailing whitespace.
2015-08-22 22:30:36 +10:00
Mark Brown
0dfb9c4874 New module for directed graphs. This is essentially the relation
Estimated hours taken: 12
Branches: main

library/digraph.m:
	New module for directed graphs.  This is essentially the relation
	module but with more consistent terminology, and with argument
	ordering that suits state variables.  Other differences with the
	relation module:

	- The digraph_key type has a phantom type parameter, which helps to
	  ensure that keys from one digraph are not used with another digraph.

	- Exports a version of digraph.reduced which also returns the mapping
	  between the original digraph keys and the new ones.

	- The implementation of compose/3 doesn't try to use the "domain" and
	  "range" of the graphs (which is meaningless in the relation module
	  anyway).

	- New, more efficient algorithm for is_dag/1.  Correctness proof is
	  documented.

	- components/2 uses a more efficient data representation, and avoids
	  some intermediate data structures.

	- reduced/{2,3} avoids some intermediate data structures.

	- tc/2 avoids some intermediate data structures.

library/library.m:
	Add the new module.

library/relation.m:
	Document that this module is deprecated in favour of digraph.

	Flag relation.init/{0,1} as obsolete (it would be better to flag
	the entire module, or the relation/1 type as obsolete, but Mercury
	does not support this).

NEWS:
	Mention that the new module supersedes relation.m and svrelation.m.

compiler/*.m:
profiler/*.m:
	Use the digraph module rather than the relation module.
2007-09-07 15:08:21 +00:00
Julien Fischer
b4c3bb1387 Clean up in unused module imports in the Mercury system detected
Estimated hours taken: 3
Branches: main

Clean up in unused module imports in the Mercury system detected
by --warn-unused-imports.

analysis/*.m:
browser/*.m:
deep_profiler/*.m:
compiler/*.m:
library/*.m:
mdbcomp/*.m:
profiler/*.m:
slice/*.m:
	Remove unused module imports.

	Fix some minor departures from our coding standards.

analysis/Mercury.options:
browser/Mercury.options:
deep_profiler/Mercury.options:
compiler/Mercury.options:
library/Mercury.options:
mdbcomp/Mercury.options:
profiler/Mercury.options:
slice/Mercury.options:
	Set --no-warn-unused-imports for those modules that are used as
	packages or otherwise break --warn-unused-imports, e.g. because they
	contain predicates with both foreign and Mercury clauses and some of
	the imports only depend on the latter.
2006-12-01 15:04:40 +00:00
Zoltan Somogyi
ff386022ae Fix a bunch of deviations from our coding standards.
Estimated hours taken: 1
Branches: main

profiler/*.m:
	Fix a bunch of deviations from our coding standards.

	Rename some predicates to make them better reflect the predicates'
	semantics.
2006-11-10 03:26:28 +00:00
Julien Fischer
459847a064 Move the univ, maybe, pair and unit types from std_util into their own
Estimated hours taken: 18
Branches: main

Move the univ, maybe, pair and unit types from std_util into their own
modules.  std_util still contains the general purpose higher-order programming
constructs.

library/std_util.m:
	Move univ, maybe, pair and unit (plus any other related types
	and procedures) into their own modules.

library/maybe.m:
	New module.  This contains the maybe and maybe_error types and
	the associated procedures.

library/pair.m:
	New module.  This contains the pair type and associated procedures.

library/unit.m:
	New module. This contains the types unit/0 and unit/1.

library/univ.m:
	New module. This contains the univ type and associated procedures.

library/library.m:
	Add the new modules.

library/private_builtin.m:
	Update the declaration of the type_ctor_info struct for univ.

runtime/mercury.h:
	Update the declaration for the type_ctor_info struct for univ.

runtime/mercury_mcpp.h:
runtime/mercury_hlc_types.h:
	Update the definition of MR_Univ.

runtime/mercury_init.h:
	Fix a comment: ML_type_name is now exported from type_desc.m.

compiler/mlds_to_il.m:
	Update the the name of the module that defines univs (which are
	handled specially by the il code generator.)

library/*.m:
compiler/*.m:
browser/*.m:
mdbcomp/*.m:
profiler/*.m:
deep_profiler/*.m:
	Conform to the above changes.  Import the new modules where they
	are needed; don't import std_util where it isn't needed.

	Fix formatting in lots of modules.  Delete duplicate module
	imports.

tests/*:
	Update the test suite to confrom to the above changes.
2006-03-29 08:09:58 +00:00
Zoltan Somogyi
a9a2825ace Replace __ with . as the module qualifier everywhere in all the modules
Estimated hours taken: 0.5
Branches: main

profiler/*.m:
deep_profiler/*.m:
compiler/*.m:
	Replace __ with . as the module qualifier everywhere in all the modules
	of the profiler and deep profiler and in some modules of the compiler.
2006-03-09 04:56:47 +00:00
Zoltan Somogyi
69d84ff1bb Import only one module per line. Misc other updates to bring these
Estimated hours taken: 1
Branches: main

profiler/*.m:
deep_profiler/*.m:
	Import only one module per line. Misc other updates to bring these
	modules closer to being up to date with our current style guidelines.
2005-03-24 01:10:34 +00:00
Julien Fischer
9126f1b06a Clean up most of the profiler and bring it into line
Estimates hours taken: 5
Branches: main

Clean up most of the profiler and bring it into line
with out current coding standards.  There are no changes
to any algorithms.

This reduce the size of the code and also (hopefully)
makes things a little easier to maintain.

XXX The profiler is currently broken on those machines
that compile with intermodule optimization, e.g jupiter.

XXX I haven't cleaned up the demangler much yet either.

profiler/call_graph.m:
profiler/generate_output.m:
profiler/globals.m:
profiler/output.m:
profiler/mercury_profile.m:
profiler/process_file.m:
profiler/output_prof_info.m:
profiler/prof_debug.m:
profiler/prof_info.m:
profiler/propagate.m:
profiler/read.m:
	Bring these modules in line with our current
  	coding standards.

	Replace existing code with code that uses
	higher-order predicates, state variables and
	functions where appropriate.

profiler/demangler.m:
	Replace `is' with `='.
2004-12-02 08:01:11 +00:00
Fergus Henderson
bf979cf38f Fix some "missing interface import" bugs detected by the
Estimated hours taken: 0.5

profiler/call_graph.m:
profiler/read.m:
extras/trailed_update/var.m:
	Fix some "missing interface import" bugs detected by the
	latest version of the compiler.
1998-03-04 19:59:56 +00:00
Fergus Henderson
04b720630b Update the copyright messages so that (a) they contain the correct years
and (b) they say "Copyright (C) ... _The_ University of Melbourne".
1997-07-27 15:09:59 +00:00
Andrew Bromage
804852adab Design change to relation.m to fix a MAJOR shortcoming.
Estimated hours taken: 5

Design change to relation.m to fix a MAJOR shortcoming.  Relations
now require the domain to be entered explicitly
fixes a known bug where performing a topological sort in certain
situations resulted in not all elements appearing in the sort.

compiler/call_graph.m:
compiler/process_file.m:
compiler/propagate.m:
	Minor changes to use the new relation.m.
1996-10-21 02:01:41 +00:00
Fergus Henderson
f1ad13b7c4 Undo dylan's changes in the names of some library entities,
Estimated hours taken: 1.5

Undo dylan's changes in the names of some library entities,
by applying the following sed script

	s/term_atom/term__atom/g
	s/term_string/term__string/g
	s/term_integer/term__integer/g
	s/term_float/term__float/g
	s/term_context/term__context/g
	s/term_functor/term__functor/g
	s/term_variable/term__variable/g
	s/_term__/_term_/g
	s/std_util__bool_/bool__/g

to all the `.m' and `.pp' files in the compiler and library directories.
The reason for undoing these changes was to minimize incompatibilities
with 0.4 (and besides, the changes were not a really good idea in the first
place).

I also moved `bool' from std_util.m to a separate module.
The main reason for that change is to ensure that the `__' prefix is
only used when it genuinely represents a module qualifier.
(That's what dylan's changes were trying to acheive, but `term__'
does genuinely represent a module qualifier.)

profiler/*.m:
	Where appropriate, add `bool' to the list of imported modules.
1996-02-03 18:06:19 +00:00
Fergus Henderson
cb26aa8b52 Work-around problem with the "0 1" line in Prof.Counts.
mercury_profile.m:
	Work-around problem with the "0 1" line in Prof.Counts.
	Use library__version/1 to get the version number.

call_graph.m:
	Fix bug where `io__seen' was called when it should not have been.
	Improve error message if `io__see' fails.

process_file.m:
	Handle errors gracefully: write a message to stderr, don't
	call error/1.

Mmake:
	Pass EXTRA_MLFLAGS to ml.
	This is because ml now strips the executable by default,
	so you need to pass --no-strip if you want to debug it.
1995-09-11 06:17:43 +00:00
Fergus Henderson
378a37bae8 Fix the mis-use of apostrophes everywhere.
profiler/*.m:
	Fix the mis-use of apostrophes everywhere.
	Tidy up the output of `mprof --help' a little.
1995-08-24 10:22:48 +00:00
Peter Ross
2c2d199f83 Very basic description of how to enable profiling and view the
README:
	Very basic description of how to enable profiling and view the
	results.  Please send comment's on the bits you don't understand
	and the I should explain better and expand on.

*.m:
	Now also generate's the flat profile.  Which tells you how much time
	you spend in each predicate as a percentage of total time.

	Also print's out an alphabetic list of all the predicate's and there
	ID numbers.
1995-08-15 03:16:35 +00:00
Peter Ross
34e35b1a11 added new options to.
options.m:
	added new options to.

*.m:
	code reorginization, a lot of the code was moved into new modules.
	PS passes boot check now.
1995-07-20 14:44:40 +00:00