[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelPattern.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Jul 5 12:59:06 PDT 2005
Changes in directory llvm/lib/Target/X86:
X86ISelPattern.cpp updated: 1.143 -> 1.144
---
Log message:
Make several cleanups to Andrews varargs change:
1. Pass Value*'s into lowering methods so that the proper pointers can be
added to load/stores from the valist
2. Intrinsics that return void should only return a token chain, not a token
chain/retval pair.
3. Rename LowerVAArgNext -> LowerVAArg, because VANext is long gone.
4. Now that we have Value*'s available in the lowering methods, pass them
into any load/stores from the valist that are emitted
---
Diffs of the changes: (+19 -18)
X86ISelPattern.cpp | 37 +++++++++++++++++++------------------
1 files changed, 19 insertions(+), 18 deletions(-)
Index: llvm/lib/Target/X86/X86ISelPattern.cpp
diff -u llvm/lib/Target/X86/X86ISelPattern.cpp:1.143 llvm/lib/Target/X86/X86ISelPattern.cpp:1.144
--- llvm/lib/Target/X86/X86ISelPattern.cpp:1.143 Tue Jul 5 12:50:16 2005
+++ llvm/lib/Target/X86/X86ISelPattern.cpp Tue Jul 5 14:58:54 2005
@@ -175,13 +175,12 @@
bool isTailCall, SDOperand Callee, ArgListTy &Args,
SelectionDAG &DAG);
- virtual std::pair<SDOperand, SDOperand>
- LowerVAStart(SDOperand Chain, SelectionDAG &DAG, SDOperand Dest);
-
+ virtual SDOperand LowerVAStart(SDOperand Chain, SDOperand VAListP,
+ Value *VAListV, SelectionDAG &DAG);
virtual std::pair<SDOperand,SDOperand>
- LowerVAArgNext(SDOperand Chain, SDOperand VAList,
- const Type *ArgTy, SelectionDAG &DAG);
-
+ LowerVAArg(SDOperand Chain, SDOperand VAListP, Value *VAListV,
+ const Type *ArgTy, SelectionDAG &DAG);
+
virtual std::pair<SDOperand, SDOperand>
LowerFrameReturnAddress(bool isFrameAddr, SDOperand Chain, unsigned Depth,
SelectionDAG &DAG);
@@ -442,22 +441,24 @@
return std::make_pair(ResultVal, Chain);
}
-std::pair<SDOperand,SDOperand>
-X86TargetLowering::LowerVAStart(SDOperand Chain, SelectionDAG &DAG,
- SDOperand Dest) {
+SDOperand
+X86TargetLowering::LowerVAStart(SDOperand Chain, SDOperand VAListP,
+ Value *VAListV, SelectionDAG &DAG) {
// vastart just stores the address of the VarArgsFrameIndex slot.
SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, MVT::i32);
- SDOperand Result = DAG.getNode(ISD::STORE, MVT::Other, Chain, FR, Dest,
- DAG.getSrcValue(NULL));
- return std::make_pair(Result, Result);
+ return DAG.getNode(ISD::STORE, MVT::Other, Chain, FR, VAListP,
+ DAG.getSrcValue(VAListV));
}
-std::pair<SDOperand,SDOperand>
-X86TargetLowering::LowerVAArgNext(SDOperand Chain, SDOperand VAList,
- const Type *ArgTy, SelectionDAG &DAG) {
+
+std::pair<SDOperand,SDOperand>
+X86TargetLowering::LowerVAArg(SDOperand Chain, SDOperand VAListP,
+ Value *VAListV, const Type *ArgTy,
+ SelectionDAG &DAG) {
MVT::ValueType ArgVT = getValueType(ArgTy);
- SDOperand Val = DAG.getLoad(MVT::i32, Chain, VAList, DAG.getSrcValue(NULL));
- SDOperand Result = DAG.getLoad(ArgVT, Val.getValue(1), Val,
+ SDOperand Val = DAG.getLoad(MVT::i32, Chain,
+ VAListP, DAG.getSrcValue(VAListV));
+ SDOperand Result = DAG.getLoad(ArgVT, Chain, Val,
DAG.getSrcValue(NULL));
unsigned Amt;
if (ArgVT == MVT::i32)
@@ -470,7 +471,7 @@
Val = DAG.getNode(ISD::ADD, Val.getValueType(), Val,
DAG.getConstant(Amt, Val.getValueType()));
Chain = DAG.getNode(ISD::STORE, MVT::Other, Chain,
- Val, VAList, DAG.getSrcValue(NULL));
+ Val, VAListP, DAG.getSrcValue(VAListV));
return std::make_pair(Result, Chain);
}
More information about the llvm-commits
mailing list