ping?<br><br>The reason of this change is that in LowerFormalArguments() we have:<br><br>if (Is64Bit && MF.getFunction()->hasStructRetAttr()) {<br> X86MachineFunctionInfo *FuncInfo = MF.getInfo<X86MachineFunctionInfo>();<br>
unsigned Reg = FuncInfo->getSRetReturnReg();<br> if (!Reg) {<br> Reg = MF.getRegInfo().createVirtualRegister(getRegClassFor(MVT::i64));<br> FuncInfo->setSRetReturnReg(Reg);<br> }<br> SDValue Copy = DAG.getCopyToReg(DAG.getEntryNode(), dl, Reg, InVals[0]);<br>
Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Copy, Chain);<br> }<br><br><div class="gmail_quote">On Fri, May 21, 2010 at 3:45 PM, Zhongxing Xu <span dir="ltr"><<a href="mailto:xuzhongxing@gmail.com">xuzhongxing@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Index: lib/Target/X86/X86ISelLowering.cpp<br>===================================================================<br>
--- lib/Target/X86/X86ISelLowering.cpp (版本 104313)<br>+++ lib/Target/X86/X86ISelLowering.cpp (工作副本)<br>
@@ -1256,10 +1256,8 @@<br> MachineFunction &MF = DAG.getMachineFunction();<br> X86MachineFunctionInfo *FuncInfo = MF.getInfo<X86MachineFunctionInfo>();<br> unsigned Reg = FuncInfo->getSRetReturnReg();<br>
- if (!Reg) {<br>- Reg = MRI.createVirtualRegister(getRegClassFor(MVT::i64));<br>- FuncInfo->setSRetReturnReg(Reg);<br>- }<br>+ assert(Reg && <br>+ "SRetReturnReg should have been set in LowerFormalArguments().");<br>
SDValue Val = DAG.getCopyFromReg(Chain, dl, Reg, getPointerTy());<br> <br> Chain = DAG.getCopyToReg(Chain, dl, X86::RAX, Val, Flag);<br><br>
</blockquote></div><br>