llvm.org GIT mirror llvm / 9018e83
For now, abort when an ISD::VAARG is encountered on x86-64, rather than silently generate invalid code. llvm-gcc does not currently use VAArgInst; it lowers va_arg in the front-end. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50930 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 12 years ago
2 changed file(s) with 18 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
326326
327327 // VASTART needs to be custom lowered to use the VarArgsFrameIndex
328328 setOperationAction(ISD::VASTART , MVT::Other, Custom);
329 setOperationAction(ISD::VAARG , MVT::Other, Expand);
330329 setOperationAction(ISD::VAEND , MVT::Other, Expand);
331 if (Subtarget->is64Bit())
330 if (Subtarget->is64Bit()) {
331 setOperationAction(ISD::VAARG , MVT::Other, Custom);
332332 setOperationAction(ISD::VACOPY , MVT::Other, Custom);
333 else
333 } else {
334 setOperationAction(ISD::VAARG , MVT::Other, Expand);
334335 setOperationAction(ISD::VACOPY , MVT::Other, Expand);
336 }
335337
336338 setOperationAction(ISD::STACKSAVE, MVT::Other, Expand);
337339 setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
49734975 Store = DAG.getStore(Op.getOperand(0), RSFIN, FIN, SV, 0);
49744976 MemOps.push_back(Store);
49754977 return DAG.getNode(ISD::TokenFactor, MVT::Other, &MemOps[0], MemOps.size());
4978 }
4979
4980 SDOperand X86TargetLowering::LowerVAARG(SDOperand Op, SelectionDAG &DAG) {
4981 // X86-64 va_list is a struct { i32, i32, i8*, i8* }.
4982 assert(Subtarget->is64Bit() && "This code only handles 64-bit va_arg!");
4983 SDOperand Chain = Op.getOperand(0);
4984 SDOperand SrcPtr = Op.getOperand(1);
4985 SDOperand SrcSV = Op.getOperand(2);
4986
4987 assert(0 && "VAArgInst is not yet implemented for x86-64!");
4988 abort();
49764989 }
49774990
49784991 SDOperand X86TargetLowering::LowerVACOPY(SDOperand Op, SelectionDAG &DAG) {
55975610 case ISD::RET: return LowerRET(Op, DAG);
55985611 case ISD::FORMAL_ARGUMENTS: return LowerFORMAL_ARGUMENTS(Op, DAG);
55995612 case ISD::VASTART: return LowerVASTART(Op, DAG);
5613 case ISD::VAARG: return LowerVAARG(Op, DAG);
56005614 case ISD::VACOPY: return LowerVACOPY(Op, DAG);
56015615 case ISD::INTRINSIC_WO_CHAIN: return LowerINTRINSIC_WO_CHAIN(Op, DAG);
56025616 case ISD::RETURNADDR: return LowerRETURNADDR(Op, DAG);
516516 SDOperand LowerDYNAMIC_STACKALLOC(SDOperand Op, SelectionDAG &DAG);
517517 SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG);
518518 SDOperand LowerVASTART(SDOperand Op, SelectionDAG &DAG);
519 SDOperand LowerVAARG(SDOperand Op, SelectionDAG &DAG);
519520 SDOperand LowerVACOPY(SDOperand Op, SelectionDAG &DAG);
520521 SDOperand LowerINTRINSIC_WO_CHAIN(SDOperand Op, SelectionDAG &DAG);
521522 SDOperand LowerRETURNADDR(SDOperand Op, SelectionDAG &DAG);