Remove unncessary ReturnInst constructors.
authorDevang Patel <dpatel@apple.com>
Tue, 26 Feb 2008 22:12:58 +0000 (22:12 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 26 Feb 2008 22:12:58 +0000 (22:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47633 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Instructions.h
lib/AsmParser/llvmAsmParser.y
lib/VMCore/Instructions.cpp

index 2b7241e725366c8a4103e262c8f338a52eac68b1..be523b1b723055f31cc95d766dee0807cd34bdf9 100644 (file)
@@ -1397,9 +1397,6 @@ public:
   // if it was passed NULL.
   explicit ReturnInst(Value *retVal = 0, Instruction *InsertBefore = 0);
   ReturnInst(Value *retVal, BasicBlock *InsertAtEnd);
-  ReturnInst(const std::vector<Value *> &retVals);
-  ReturnInst(const std::vector<Value *> &retVals, Instruction *InsertBefore);
-  ReturnInst(const std::vector<Value *> &retVals, BasicBlock *InsertAtEnd);
   ReturnInst(Value * const* retVals, unsigned N);
   ReturnInst(Value * const* retVals, unsigned N, Instruction *InsertBefore);
   ReturnInst(Value * const* retVals, unsigned N, BasicBlock *InsertAtEnd);
index 084a328844e997eed6e7421d6bfc477c858ad1ab..b7b40090e8318579ec6179cf0ed61ccbde86b327 100644 (file)
@@ -2580,7 +2580,9 @@ InstructionList : InstructionList Inst {
 
 BBTerminatorInst : 
   RET ReturnedVal  { // Return with a result...
-    $$ = new ReturnInst(*$2);
+    ValueList &VL = *$2;
+    if (!VL.empty())
+      $$ = new ReturnInst(&VL[0], VL.size());
     delete $2;
     CHECK_FOR_ERROR
   }
index 012aad189eb0e16d2e0d9662555379dd143fd0ee..e66f5e9bdf063a7747c9660cec003a593438afbb 100644 (file)
@@ -598,26 +598,6 @@ ReturnInst::ReturnInst(BasicBlock *InsertAtEnd)
   : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, 0, InsertAtEnd) {
 }
 
-ReturnInst::ReturnInst(const std::vector<Value *> &retVals, 
-                       Instruction *InsertBefore)
-  : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, retVals.size(), 
-                   InsertBefore) {
-  if (!retVals.empty())
-    init(&retVals[0], retVals.size());
-}
-ReturnInst::ReturnInst(const std::vector<Value *> &retVals, 
-                       BasicBlock *InsertAtEnd)
-  : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, retVals.size(), 
-                   InsertAtEnd) {
-  if (!retVals.empty())
-    init(&retVals[0], retVals.size());
-}
-ReturnInst::ReturnInst(const std::vector<Value *> &retVals)
-  : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, retVals.size()) {
-  if (!retVals.empty())
-    init(&retVals[0], retVals.size());
-}
-
 ReturnInst::ReturnInst(Value * const* retVals, unsigned N,
                        Instruction *InsertBefore)
   : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, N, InsertBefore) {