Exemplo n.º 1
0
Arquivo: gengas.c Projeto: 8l/mc
static void gentype(FILE *fd, Type *ty)
{
	Blob *b;

	ty = tydedup(ty);
	if (ty->type == Tyvar || ty->isemitted)
		return;

	ty->isemitted = 1;
	b = tydescblob(ty);
	b->iscomdat = 1;
	writeblob(fd, b);
	blobfree(b);
}
Exemplo n.º 2
0
static void gentype(FILE *fd, Type *ty)
{
	Blob *b;
	char lbl[1024];

	if (ty->type == Tyvar)
		return;
	b = tydescblob(ty);
	if (!b)
		return;
	if (b->isglobl) {
		fprintf(fd, "GLOBL %s%s+0(SB),$%zd\n", Symprefix, b->lbl, blobsz(b));
		bprintf(lbl, sizeof lbl, "%s%s", Symprefix, b->lbl);
	} else {
		fprintf(fd, "GLOBL %s%s<>+0(SB),$%zd\n", Symprefix, b->lbl, blobsz(b));
		bprintf(lbl, sizeof lbl, "%s%s<>", Symprefix, b->lbl);
	}
	writeblob(fd, b, 0, lbl);
}