mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-28 17:43:14 +01:00
[svn r178] Fixed codegen values for function arguments, the old approach was completely broken, amazing it even worked...
This commit is contained in:
10
gen/toir.cpp
10
gen/toir.cpp
@@ -253,6 +253,7 @@ DValue* VarExp::toElem(IRState* p)
|
||||
assert(sdecltype->ty == Tstruct);
|
||||
TypeStruct* ts = (TypeStruct*)sdecltype;
|
||||
assert(ts->sym);
|
||||
DtoForceConstInitDsymbol(ts->sym);
|
||||
assert(gIR->irDsymbol[ts->sym].irStruct->init);
|
||||
return new DVarValue(type, gIR->irDsymbol[ts->sym].irStruct->init, true);
|
||||
}
|
||||
@@ -2291,6 +2292,15 @@ DValue* IdentityExp::toElem(IRState* p)
|
||||
}
|
||||
eval = DtoDynArrayIs(op,l,r);
|
||||
}
|
||||
else if (t1->ty == Tdelegate) {
|
||||
if (v->isNull()) {
|
||||
r = NULL;
|
||||
}
|
||||
else {
|
||||
assert(l->getType() == r->getType());
|
||||
}
|
||||
eval = DtoDynArrayIs(op,l,r);
|
||||
}
|
||||
else if (t1->isfloating())
|
||||
{
|
||||
llvm::FCmpInst::Predicate pred = (op == TOKidentity) ? llvm::FCmpInst::FCMP_OEQ : llvm::FCmpInst::FCMP_ONE;
|
||||
|
||||
Reference in New Issue
Block a user