Fix a bunch of incorrect assert

This commit is contained in:
Alexey Prokhin
2011-02-25 22:29:34 +03:00
parent 28aa0e2bf3
commit 53fe662957
2 changed files with 6 additions and 6 deletions

View File

@@ -15,24 +15,24 @@ struct RemoveStructPadding : ABIRewrite {
// TODO: Only do this if there's padding, and/or only initialize padding.
DtoMemSetZero(lval, DtoConstSize_t(getTypePaddedSize(DtoType(dty))));
DtoPaddedStruct(dty, v->getRVal(), lval);
DtoPaddedStruct(dty->toBasetype(), v->getRVal(), lval);
return lval;
}
/// get a rewritten value back to its original form and store result in provided lvalue
/// this one is optional and defaults to calling the one above
virtual void getL(Type* dty, DValue* v, llvm::Value* lval) {
DtoPaddedStruct(dty, v->getRVal(), lval);
DtoPaddedStruct(dty->toBasetype(), v->getRVal(), lval);
}
/// put out rewritten value
virtual LLValue* put(Type* dty, DValue* v) {
return DtoUnpaddedStruct(dty, v->getRVal());
return DtoUnpaddedStruct(dty->toBasetype(), v->getRVal());
}
/// return the transformed type for this rewrite
virtual const LLType* type(Type* dty, const LLType* t) {
return DtoUnpaddedStructType(dty);
return DtoUnpaddedStructType(dty->toBasetype());
}
};

View File

@@ -652,8 +652,8 @@ bool X86_64TargetABI::passByVal(Type* t) {
// Structs passed or returned in registers are passed here
// to get their padding removed (if necessary).
void X86_64TargetABI::fixup_D(IrFuncTyArg& arg) {
assert(arg.type->ty == Tstruct);
LLType* abiTy = DtoUnpaddedStructType(arg.type);
assert(arg.type->toBasetype()->ty == Tstruct);
LLType* abiTy = DtoUnpaddedStructType(arg.type->toBasetype());
if (abiTy && abiTy != arg.ltype) {
arg.ltype = abiTy;