header file changes for varargs
authorAndrew Lenharth <andrewl@lenharth.org>
Sat, 18 Jun 2005 18:31:30 +0000 (18:31 +0000)
committerAndrew Lenharth <andrewl@lenharth.org>
Sat, 18 Jun 2005 18:31:30 +0000 (18:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22253 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Instruction.def
include/llvm/Instructions.h
include/llvm/Support/InstVisitor.h
include/llvm/Target/TargetLowering.h

index 63af10bb4987e5959581f908c147eb8b667cce25..08806b46bdd092cf982c87b46e0ecb9af60968a2 100644 (file)
@@ -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
index 904ca8f3784ef96f7782d0c0de05b828d32bdaf1..53cfe6ae1d439856a42447302fcebb63b4fa53fa 100644 (file)
@@ -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<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)
index 38cd74ab8785a1c6b9cad5fd56ae35c3ed4d739e..a4b1f8b5ee76b6e5445a4a3ae1af13b50b4b8bf3 100644 (file)
@@ -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
index 99fd0bac8c827b37ba76b4851515939e2d0274a3..b1ef3f1545b81515759c7e17afaff5eb2aa79cc6 100644 (file)
@@ -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<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.
@@ -278,13 +278,12 @@ public:
   /// 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