* Hugs version 1.4, December 1997
*
* $RCSfile: interface.c,v $
- * $Revision: 1.28 $
- * $Date: 2000/02/08 15:32:30 $
+ * $Revision: 1.29 $
+ * $Date: 2000/02/08 17:50:46 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
t = enZcodeThenFindText(buf);
p = lookupOTabName ( name(n).mod, textToStr(t) );
-if (p) fprintf(stderr, "FOUND `%s'\n",textToStr(t));
if (p) return p;
if (name(n).arity == 0) {
textToStr( name(n).text ) );
t = enZcodeThenFindText(buf);
p = lookupOTabName ( name(n).mod, textToStr(t) );
-if (p) fprintf(stderr, "FOUND `%s'\n",textToStr(t));
if (p) return p;
}
void ifLinkConstrItbl ( Name n )
{
/* name(n) is either a constructor or a field name.
- If the latter, ignore it. Otherwise, find its info table
- in the object code.
+ If the latter, ignore it. If it is a non-nullary constructor,
+ find its info table in the object code. If it's nullary,
+ we can skip the info table, since all accesses will go via
+ the _closure label.
*/
- if (!islower(textToStr(name(n).text)[0]))
- name(n).itbl = ifFindItblFor(n);
+ if (islower(textToStr(name(n).text)[0])) return;
+ if (name(n).arity == 0) return;
+ name(n).itbl = ifFindItblFor(n);
}
if (isNull(nw)) internal("finishGHCClass");
line = cclass(nw).line;
- ctr = - length(cclass(nw).members);
+ ctr = -2;
assert (currentModule == cclass(nw).mod);
cclass(nw).level = 0;
Name n = findName(txt);
assert(nonNull(n));
name(n).text = txt;
-fprintf(stderr, "TEXT IS `%s'\n", textToStr(name(n).text));
name(n).line = cclass(nw).line;
name(n).type = ty;
- name(n).number = ctr++;
+ name(n).number = ctr--;
name(n).arity = arityInclDictParams(name(n).type);
name(n).parent = nw;
hd(mems) = n;
{
Name b = newName( /*inventText()*/ textOf(var),NIL);
-fprintf(stderr, "DICTIONARY NAME `%s'\n", textToStr(textOf(var)) );
name(b).line = line;
name(b).arity = length(spec); /* unused? */ /* and surely wrong */
name(b).number = DFUNNAME;
* included in the distribution.
*
* $RCSfile: storage.c,v $
- * $Revision: 1.41 $
- * $Date: 2000/02/08 15:32:30 $
+ * $Revision: 1.42 $
+ * $Date: 2000/02/08 17:50:46 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
if (isTycon(t)) return textToStr(tycon(t).text); else return "??";
}
+static String maybeClassStr ( Class c )
+{
+ if (isClass(c)) return textToStr(cclass(c).text); else return "??";
+}
+
static String maybeText ( Text t )
{
if (isNull(t)) return "(nil)";
printf ( "{\n" );
printf ( " text: %s\n", textToStr(tycon(t).text) );
printf ( " line: %d\n", tycon(t).line );
- printf ( " mod: %d %s\n", tycon(t).mod,
- maybeModuleStr(tycon(t).mod));
+ printf ( " mod: %s\n", maybeModuleStr(tycon(t).mod));
printf ( " tuple: %d\n", tycon(t).tuple);
printf ( " arity: %d\n", tycon(t).arity);
printf ( " kind: "); print100(tycon(t).kind);
printf ( "{\n" );
printf ( " text: %s\n", textToStr(name(n).text) );
printf ( " line: %d\n", name(n).line );
- printf ( " mod: %d %s\n", name(n).mod,
- maybeModuleStr(name(n).mod));
+ printf ( " mod: %s\n", maybeModuleStr(name(n).mod));
printf ( " syntax: %d\n", name(n).syntax );
printf ( " parent: %d\n", name(n).parent );
printf ( " arity: %d\n", name(n).arity );
printf ( "{\n" );
printf ( " text: %s\n", textToStr(cclass(c).text) );
printf ( " line: %d\n", cclass(c).line );
- printf ( " mod: %d %s\n", cclass(c).mod,
- maybeModuleStr(cclass(c).mod));
+ printf ( " mod: %s\n", maybeModuleStr(cclass(c).mod));
printf ( " arity: %d\n", cclass(c).arity );
printf ( " level: %d\n", cclass(c).level );
printf ( " kinds: "); print100( cclass(c).kinds );
return;
}
printf ( "{\n" );
-// printf ( " text: %s\n", textToStr(cclass(c)).text) );
+ printf ( " class: %s\n", maybeClassStr(inst(i).c) );
+ printf ( " line: %d\n", inst(i).line );
+ printf ( " mod: %s\n", maybeModuleStr(inst(i).mod));
+ printf ( " kinds: "); print100( inst(i).kinds );
+ printf ( " head: "); print100( inst(i).head );
+ printf ( " specs: "); print100( inst(i).specifics );
+ printf ( " #specs: %d\n", inst(i).numSpecifics );
+ printf ( " impls: "); print100( inst(i).implements );
+ printf ( " builder: %s\n", maybeNameStr( inst(i).builder ) );
printf ( "}\n" );
}