<div class="gmail_quote">I am working the AVR backend. It is still in the early stage. I got the following error:<div><div>[ 86%] Building CXX object lib/Target/AVR/CMakeFiles/LLVMAVRCodeGen.dir/AVRISelDAGToDAG.cpp.obj</div>
<div>AVRISelDAGToDAG.cpp</div>
<div>C:\llvm-build\lib\Target\AVR\AVRGenDAGISel.inc(596) : error C2664: 'llvm::SDNode *llvm::SelectionDAG::SelectNodeTo(llvm::SDNode *,unsigned int,llvm::MVT,llvm::MVT,llvm::MVT,const llvm::SDValue *,unsigned int)' : cannot convert parameter 6 from 'llvm::SDValue' to 'const llvm::SDValue *'</div>

<div>        No user-defined-conversion operator available that can perform this conv</div><div>ersion, or the operator cannot be called</div><div><br></div>I checked the generated the code:</div><div><div>SDNode *Emit_2(const SDValue &N, unsigned Opc0, MVT VT0) DISABLE_INLINE {</div>

<div>  SDValue N0 = N.getOperand(0);</div><div>  SDValue N1 = N.getOperand(1);</div><div>  SDNode *ResNode = CurDAG->SelectNodeTo(N.getNode(), Opc0, VT0, MVT::i8, MVT::Flag, N0, N1); <==== error here.</div><div>  SDValue InFlag(ResNode, 2);</div>

<div>  ReplaceUses(SDValue(N.getNode(), 1), InFlag);</div><div>  return ResNode;</div><div>}</div><div>SDNode *Select_ISD_ADDC_i8(const SDValue &N) {</div><div>  SDNode *Result = Emit_2(N, AVR::ADC, MVT::i8);</div><div>

  return Result;</div><div>}</div><div><br></div><div>the related defines are:</div><div>def ADC<span style="white-space:pre">    </span>: RR<7, "adc $dst, $src2", addc>;</div><div><div>
class RR<bits<6> opcode, string asmstr, SDNode OpNode></div><div>     : AVRInstr<(outs GR8:$dst), (ins GR8:$src1, GR8:$src2), asmstr, </div><div>       [(set GR8:$dst, (OpNode GR8:$src1, GR8:$src2)), (implicit SREG)]> {</div>

<div>   let Inst{15-10} = opcode;</div><div>}</div></div><div><br></div><div><div>class AVRInstr<dag outs, dag ins, string asmstr, list<dag> pattern></div><div>        : Instruction {</div><div>  field bits<16> Inst;</div>

<div><br></div><div>  let Namespace = "AVR";</div><div>  </div><div>  dag OutOperandList = outs;</div><div>  dag InOperandList  = ins;</div><div><br></div><div>  let AsmString   = asmstr;</div><div>  let Pattern = pattern;</div>

<div>}</div><div><br></div><div>What I did in the wrong way?</div><div><br></div></div>-- <br>-Howard<br>
</div>
</div><br>