Refactoring: Introduce getIrType()

As *the* way to access the IrType associated with a Type via its `ctype`
field. Most importantly, it makes sure all access is redirected to the
*unqualified* type's `ctype`, which allows to get rid of the 'multiple
types' workaround for aggregates in DtoType(). Those were e.g. hit for
`shared struct SpinLock`, where the struct's type includes the `shared`
modifier...
This commit is contained in:
Martin Kinkelin 2020-09-27 22:16:57 +02:00
parent ab2ae5e0a2
commit 3f716ff75e
15 changed files with 117 additions and 115 deletions

View file

@ -761,9 +761,8 @@ DISubroutineType DIBuilder::CreateFunctionType(Type *type) {
// The calling convention has to be recorded to distinguish
// extern(D) functions from extern(C++) ones.
DtoType(t);
assert(t->ctype);
unsigned CC = t->ctype->getIrFuncTy().reverseParams ? DW_CC_D_dmd : 0;
unsigned CC =
getIrType(t, true)->getIrFuncTy().reverseParams ? DW_CC_D_dmd : 0;
return DBuilder.createSubroutineType(paramsArray, DIFlags::FlagZero, CC);
}