[llvm-commits] [llvm] r47577 - in /llvm/trunk: include/llvm/Instructions.h lib/VMCore/Instructions.cpp
Devang Patel
dpatel at apple.com
Mon Feb 25 16:12:13 PST 2008
Author: dpatel
Date: Mon Feb 25 18:12:13 2008
New Revision: 47577
URL: http://llvm.org/viewvc/llvm-project?rev=47577&view=rev
Log:
Pass const vectors by reference.
Modified:
llvm/trunk/include/llvm/Instructions.h
llvm/trunk/lib/VMCore/Instructions.cpp
Modified: llvm/trunk/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=47577&r1=47576&r2=47577&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Instructions.h (original)
+++ llvm/trunk/include/llvm/Instructions.h Mon Feb 25 18:12:13 2008
@@ -1381,7 +1381,7 @@
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 @@
// 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();
Modified: llvm/trunk/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=47577&r1=47576&r2=47577&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Instructions.cpp (original)
+++ llvm/trunk/lib/VMCore/Instructions.cpp Mon Feb 25 18:12:13 2008
@@ -592,15 +592,15 @@
: 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(std::vector<Value *> &retVals) {
+void ReturnInst::init(const std::vector<Value *> &retVals) {
if (retVals.empty())
return;
More information about the llvm-commits
mailing list