[m-rev.] for review: separate different kinds of sections

Julien Fischer jfischer at opturion.com
Fri Jul 31 16:36:06 AEST 2015


Hi Zoltan,

On Thu, 30 Jul 2015, Zoltan Somogyi wrote:

> For review by anyone, but since this builds on previous diffs
> that Julien reviewed, he would be the most familiar with the
> relevant code.

...

> Separate the different kinds of sections in aug_comp_units.
> 
> When we create augmented compilation units, the item blocks in that
> augmented unit come from five sources:
> 
> - the original raw compilation unit, contain the source code of a module;

"containing" or "which contains".

> - the interface files of the modules directly imported by that module;
> - the interface files of the modules indirectly imported by that module;
> - the optimization files needed by that module; and
> - the interface files needed by those optimization files.
> 
> Change the representation of augmented compilation units so that instead of
> containing one list of item blocks, each of which had a general section type,
> it now has five lists of item blocks, one for each category above, with
> a section type specialized to the category.
> 
> After this change, the compiler can process just the item blocks it wants
> to process, instead of having to process all the item blocks, all the while
> filtering out the irrelevant blocks. This filtering used to be order dependent,
> with the ams_transitively_imported section marker, which derived from the old
> md_transitively_imported module_defn, marking the dividing line between
> the first and second categories on the one hand and the third and fourth
> categories on the other hand. That marker is now gone, and the item blocks
> in each category have no need to be in a specific order.

...

>  %---------------------------------------------------------------------------%
> diff --git a/compiler/file_kind.m b/compiler/file_kind.m
> index e69de29..d211e0c 100644
> --- a/compiler/file_kind.m
> +++ b/compiler/file_kind.m
> @@ -0,0 +1,98 @@
> +%-----------------------------------------------------------------------------%
> +% vim: ft=mercury ts=4 sw=4 et
> +%-----------------------------------------------------------------------------%
> +% Copyright (C) 2015-2011 The Mercury team.
> +% This file may only be copied under the terms of the GNU General
> +% Public License - see the file COPYING in the Mercury distribution.
> +%-----------------------------------------------------------------------------%
> +%
> +% File: file_kind.m.
> +% Main author: zs.
> +%
> +%-----------------------------------------------------------------------------%
> +
> +:- module parse_tree.file_kind.
> +:- interface.
> +
> +%-----------------------------------------------------------------------------%
> +%
> +% The different kinds of files the Mercury compiler deals with:
> +%
> +% - source files,
> +% - automatically generated interface files, and
> +% - automatically generated optimization files.
> +%

To be accurate, they are the three kinds of file that the frontend of the
Mercury compiler deals with; the compiler as a whole deals with many other
types of file.

The diff look fine otherwise.

Cheers,
Julien.



More information about the reviews mailing list