I may be crazy, but couldn't we make a method in `Type` called `nullAttributes` or similar which would null-initialize all fields and also set the `att` field like you're doing here? We could get rid of a lot of code duplication, for example the new functions would look like:

```C++
Type *Type::nullAttributes()
{
    unsigned sz = sizeTy[ty];
    Type *t = (Type *)mem.malloc(sz);
    memcpy(t, this, sz);
    t->mod = NULL;
    t->deco = NULL;
    t->arrayof = NULL;
    t->pto = NULL;
    t->rto = NULL;
    t->cto = NULL;
    t->ito = NULL;
    t->sto = NULL;
    t->scto = NULL;
    t->wto = NULL;
    t->swto = NULL;
    t->vtinfo = NULL;
    t->ctype = NULL;
    return t;
}
```

```C++
Type *Type::makeConst()
{
    if (cto) return cto;
    Type *t = this->nullAttributes();
    t->mod = MODconst;
}

Type *Type::makeInvariant()
{
    if (ito) return ito;
    Type *t = this->nullAttributes();
    t->mod = MODimmutable;
}
```
We might also rename `makeInvariant` into `makeImmutable`.