HANDLE_OTHER_INST(30, Shl , ShiftInst ) // Shift operations
HANDLE_OTHER_INST(31, Shr , ShiftInst )
-HANDLE_OTHER_INST(32, VANext , VANextInst ) // vanext instruction
-HANDLE_OTHER_INST(33, VAArg , VAArgInst ) // vaarg instruction
+ //HANDLE_OTHER_INST(32, VANext , VANextInst ) // vanext instruction
+ //HANDLE_OTHER_INST(33, VAArg , VAArgInst ) // vaarg instruction
HANDLE_OTHER_INST(34, Select , SelectInst ) // select instruction
HANDLE_OTHER_INST(35, UserOp1, Instruction) // May be used internally in a pass
HANDLE_OTHER_INST(36, UserOp2, Instruction)
- LAST_OTHER_INST(36)
+HANDLE_OTHER_INST(37, VAArg , VAArgInst ) // vaarg instruction
+ LAST_OTHER_INST(37)
#undef FIRST_TERM_INST
#undef HANDLE_TERM_INST
}
};
-
-//===----------------------------------------------------------------------===//
-// VANextInst Class
-//===----------------------------------------------------------------------===//
-
-/// VANextInst - This class represents the va_next llvm instruction, which
-/// advances a vararg list passed an argument of the specified type, returning
-/// the resultant list.
-///
-class VANextInst : public UnaryInstruction {
- PATypeHolder ArgTy;
- VANextInst(const VANextInst &VAN)
- : UnaryInstruction(VAN.getType(), VANext, VAN.getOperand(0)),
- ArgTy(VAN.getArgType()) {
- }
-
-public:
- VANextInst(Value *List, const Type *Ty, const std::string &Name = "",
- Instruction *InsertBefore = 0)
- : UnaryInstruction(List->getType(), VANext, List, Name, InsertBefore),
- ArgTy(Ty) {
- }
- VANextInst(Value *List, const Type *Ty, const std::string &Name,
- BasicBlock *InsertAtEnd)
- : UnaryInstruction(List->getType(), VANext, List, Name, InsertAtEnd),
- ArgTy(Ty) {
- }
-
- const Type *getArgType() const { return ArgTy; }
-
- virtual VANextInst *clone() const;
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const VANextInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == VANext;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-
//===----------------------------------------------------------------------===//
// VAArgInst Class
//===----------------------------------------------------------------------===//
/// VAArgInst - This class represents the va_arg llvm instruction, which returns
-/// an argument of the specified type given a va_list.
+/// an argument of the specified type given a va_list and increments that list
///
class VAArgInst : public UnaryInstruction {
VAArgInst(const VAArgInst &VAA)
RetTy visitSelectInst(SelectInst &I) { DELEGATE(Instruction); }
RetTy visitCallInst(CallInst &I) { DELEGATE(Instruction); }
RetTy visitShiftInst(ShiftInst &I) { DELEGATE(Instruction); }
- RetTy visitVANextInst(VANextInst &I) { DELEGATE(Instruction); }
RetTy visitVAArgInst(VAArgInst &I) { DELEGATE(Instruction); }
// Next level propagators... if the user does not overload a specific
/// LowerVAStart - This lowers the llvm.va_start intrinsic. If not
/// implemented, this method prints a message and aborts.
virtual std::pair<SDOperand, SDOperand>
- LowerVAStart(SDOperand Chain, SelectionDAG &DAG);
+ LowerVAStart(SDOperand Chain, SelectionDAG &DAG, SDOperand Dest);
/// LowerVAEnd - This lowers llvm.va_end and returns the resultant chain. If
/// not implemented, this defaults to a noop.
/// value/chain pair. If not implemented, this defaults to returning the
/// input operand.
virtual std::pair<SDOperand,SDOperand>
- LowerVACopy(SDOperand Chain, SDOperand L, SelectionDAG &DAG);
+ LowerVACopy(SDOperand Chain, SDOperand Src, SDOperand Dest, SelectionDAG &DAG);
- /// LowerVAArgNext - This lowers the vaarg and vanext instructions (depending
- /// on whether the first argument is true). If not implemented, this prints a
- /// message and aborts.
+ /// LowerVAArgNext - This lowers the instruction
+ /// If not implemented, this prints a message and aborts.
virtual std::pair<SDOperand,SDOperand>
- LowerVAArgNext(bool isVANext, SDOperand Chain, SDOperand VAList,
+ LowerVAArgNext(SDOperand Chain, SDOperand VAList,
const Type *ArgTy, SelectionDAG &DAG);
/// LowerFrameReturnAddress - This hook lowers a call to llvm.returnaddress or