diff --git a/include/llvm/Instruction.def b/include/llvm/Instruction.def index 63af10bb498..08806b46bdd 100644 --- a/include/llvm/Instruction.def +++ b/include/llvm/Instruction.def @@ -128,13 +128,14 @@ HANDLE_OTHER_INST(29, Call , CallInst ) // Call a function 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 diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 904ca8f3784..53cfe6ae1d4 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -660,55 +660,12 @@ public: } }; - -//===----------------------------------------------------------------------===// -// 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(V) && classof(cast(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) diff --git a/include/llvm/Support/InstVisitor.h b/include/llvm/Support/InstVisitor.h index 38cd74ab878..a4b1f8b5ee7 100644 --- a/include/llvm/Support/InstVisitor.h +++ b/include/llvm/Support/InstVisitor.h @@ -174,7 +174,6 @@ public: 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 diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 99fd0bac8c8..b1ef3f1545b 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -268,7 +268,7 @@ public: /// LowerVAStart - This lowers the llvm.va_start intrinsic. If not /// implemented, this method prints a message and aborts. virtual std::pair - 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. @@ -278,13 +278,12 @@ public: /// value/chain pair. If not implemented, this defaults to returning the /// input operand. virtual std::pair - 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 - 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