Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
a8bf3684
Commit
a8bf3684
authored
25 years ago
by
Julian Seward
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1999-12-16 16:42:56 by sewardj]
Add extended version of previous commit message as a comment.
parent
0c97d649
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/interpreter/interface.c
+62
-2
62 additions, 2 deletions
ghc/interpreter/interface.c
with
62 additions
and
2 deletions
ghc/interpreter/interface.c
+
62
−
2
View file @
a8bf3684
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
* Hugs version 1.4, December 1997
* Hugs version 1.4, December 1997
*
*
* $RCSfile: interface.c,v $
* $RCSfile: interface.c,v $
* $Revision: 1.1
1
$
* $Revision: 1.1
2
$
* $Date: 1999/12/16 16:
34:40
$
* $Date: 1999/12/16 16:
42:56
$
* ------------------------------------------------------------------------*/
* ------------------------------------------------------------------------*/
/* ToDo:
/* ToDo:
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
extern
void
print
(
Cell
,
Int
);
extern
void
print
(
Cell
,
Int
);
/* --------------------------------------------------------------------------
/* --------------------------------------------------------------------------
* (This comment is now out of date. JRS, 991216).
* The "addGHC*" functions act as "impedence matchers" between GHC
* The "addGHC*" functions act as "impedence matchers" between GHC
* interface files and Hugs. Their main job is to convert abstract
* interface files and Hugs. Their main job is to convert abstract
* syntax trees into Hugs' internal representations.
* syntax trees into Hugs' internal representations.
...
@@ -70,6 +71,65 @@ extern void print ( Cell, Int );
...
@@ -70,6 +71,65 @@ extern void print ( Cell, Int );
*
*
* ------------------------------------------------------------------------*/
* ------------------------------------------------------------------------*/
/*
New comment, 991216, explaining roughly how it all works.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interfaces can contain references to unboxed types, and these need to
be handled carefully. The following is a summary of how the interface
loader now works. It is applied to groups of interfaces simultaneously,
viz, the entire Prelude at once:
0. Parse interfaces, chasing imports until a complete
strongly-connected-component of ifaces has been parsed.
All interfaces in this scc are processed together, in
steps 1 .. 8 below.
1. Throw away any entity not mentioned in the export lists.
2. Delete type (not data or newtype) definitions which refer to
unknown types in their right hand sides. Because Hugs doesn't
know of any unboxed types, this has the side effect of removing
all type defns referring to unboxed types. Repeat step 2 until
a fixed point is reached.
3. Make abstract all data/newtype defns which refer to an unknown
type. eg, data Word = MkW Word# becomes data Word, because
Word# is unknown. Hugs is happy to know about abstract boxed
Words, but not about Word#s.
4. Step 2 could delete types referred to by values, instances and
classes. So filter all entities, and delete those referring to
unknown types _or_ classes. This could cause other entities
to become invalid, so iterate step 4 to a fixed point.
After step 4, the interfaces no longer contain anything
unpalatable to Hugs.
5. Steps 1-4 operate purely on the iface syntax trees. We now start
creating symbol table entries. First, create a module table
entry for each interface, and locate and read in the corresponding
object file. This is done by the startGHCModule function.
6. Traverse all interfaces. For each entity, create an entry in
the name, tycon, class or instance table, and fill in relevant
fields, but do not attempt to link tycon/class/instance/name uses
to their symbol table entries. This is done by the startGHC*
functions.
7. Revisit all symbol table entries created in step 6. We should
now be able to replace all references to tycons/classes/instances/
names with the relevant symbol table entries. This is done by
the finishGHC* functions.
8. Traverse all interfaces. For each iface, examine the export lists
and use it to build export lists in the module table. Do the
implicit 'import Prelude' thing if necessary. Finally, resolve
references in the object code for this module. This is done
by the finishGHCModule function.
*/
/* --------------------------------------------------------------------------
/* --------------------------------------------------------------------------
* local function prototypes:
* local function prototypes:
* ------------------------------------------------------------------------*/
* ------------------------------------------------------------------------*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment