OSDN Git Service

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 2b7241e..be523b1 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 084a328..b7b4009 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 012aad1..e66f5e9 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) {