Pass const vectors by reference.
authorDevang Patel <dpatel@apple.com>
Tue, 26 Feb 2008 00:12:13 +0000 (00:12 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 26 Feb 2008 00:12:13 +0000 (00:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47577 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Instructions.h
lib/VMCore/Instructions.cpp

index 2ac311a575e158e5aa5f8b6a95790cf7c1d4d650..c9329db29d726a06edf95c2537950da8d93e7dcb 100644 (file)
@@ -1381,7 +1381,7 @@ public:
 class ReturnInst : public TerminatorInst {
   ReturnInst(const ReturnInst &RI);
   void init(Value *RetVal);
-  void init(std::vector<Value *> &RetVals);
+  void init(const std::vector<Value *> &RetVals);
 
 public:
   // ReturnInst constructors:
@@ -1397,9 +1397,9 @@ public:
   // if it was passed NULL.
   explicit ReturnInst(Value *retVal = 0, Instruction *InsertBefore = 0);
   ReturnInst(Value *retVal, BasicBlock *InsertAtEnd);
-  ReturnInst(std::vector<Value *> &retVals);
-  ReturnInst(std::vector<Value *> &retVals, Instruction *InsertBefore);
-  ReturnInst(std::vector<Value *> &retVals, BasicBlock *InsertAtEnd);
+  ReturnInst(const std::vector<Value *> &retVals);
+  ReturnInst(const std::vector<Value *> &retVals, Instruction *InsertBefore);
+  ReturnInst(const std::vector<Value *> &retVals, BasicBlock *InsertAtEnd);
   explicit ReturnInst(BasicBlock *InsertAtEnd);
   virtual ~ReturnInst();
 
index d1df30b10330b8eef796ec6cf9ba0b2aea1aae8d..9a84b5400458d41c2c61e089ce74f15a21144462 100644 (file)
@@ -592,15 +592,15 @@ ReturnInst::ReturnInst(BasicBlock *InsertAtEnd)
   : TerminatorInst(Type::VoidTy, Instruction::Ret, OperandList, 0, InsertAtEnd) {
 }
 
-ReturnInst::ReturnInst(std::vector<Value *> &retVals, Instruction *InsertBefore)
+ReturnInst::ReturnInst(const std::vector<Value *> &retVals, Instruction *InsertBefore)
   : TerminatorInst(Type::VoidTy, Instruction::Ret, OperandList, retVals.size(), InsertBefore) {
   init(retVals);
 }
-ReturnInst::ReturnInst(std::vector<Value *> &retVals, BasicBlock *InsertAtEnd)
+ReturnInst::ReturnInst(const std::vector<Value *> &retVals, BasicBlock *InsertAtEnd)
   : TerminatorInst(Type::VoidTy, Instruction::Ret, OperandList, retVals.size(), InsertAtEnd) {
   init(retVals);
 }
-ReturnInst::ReturnInst(std::vector<Value *> &retVals)
+ReturnInst::ReturnInst(const std::vector<Value *> &retVals)
   : TerminatorInst(Type::VoidTy, Instruction::Ret, OperandList, retVals.size()) {
   init(retVals);
 }
@@ -615,7 +615,7 @@ void ReturnInst::init(Value *retVal) {
   }
 }
 
-void ReturnInst::init(std::vector<Value *> &retVals) {
+void ReturnInst::init(const std::vector<Value *> &retVals) {
   if (retVals.empty())
     return;