[LLVMdev] LowerCALL (TargetLowering)
Nikhil Patil
npatil at ece.utexas.edu
Wed Nov 15 14:01:20 PST 2006
Aah, I figured this out now. I had misunderstood the semantics of the
getNode operator. The following code snippet now works.
Sorry for the noise! :)
Nikhil
Tys.push_back(MVT::Other);
Ops.push_back(Chain);
for (unsigned i = 0; i != NumOps; ++i) {
SDOperand Arg = Op.getOperand(5+2*i);
Tys.push_back(Arg.getValueType());
Ops.push_back(Arg);
}
Chain = DAG.getNode(opcode, RetVT, &Ops[0], Ops.size());
assert(RetVT == MVT::Other);
return Chain;
(as opposed to the earlier:)
> > > for (unsigned i = 0; i != NumOps; ++i) {
> > > SDOperand Arg = Op.getOperand(5+2*i);
> > > Tys.push_back(Arg.getValueType());
> > > Ops.push_back(Arg);
> > > }
> > > Tys.push_back(MVT::Other);
> > > Ops.push_back(Chain);
> > >
> > > Chain = DAG.getNode(opcode, Tys, &Ops[0], Ops.size());
> > >
> > > assert(RetVT == MVT::Other);
> > > return Chain;
More information about the llvm-dev
mailing list