aboutsummaryrefslogtreecommitdiff
path: root/lib/Bitcode
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-02-26 19:38:17 +0000
committerDevang Patel <dpatel@apple.com>2008-02-26 19:38:17 +0000
commitf4511cd8fbcea9f8eca79b162b3ad3edbd951746 (patch)
tree8965958a05e59c267fa0c8f649eb7231955bd81f /lib/Bitcode
parentfea9830468c316a77f34412004b682e5aacd6a69 (diff)
Use SmallVector while constructing ReturnInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47619 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 487a135509..61e0ab9898 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -21,6 +21,7 @@
#include "llvm/ParamAttrsList.h"
#include "llvm/AutoUpgrade.h"
#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h"
using namespace llvm;
@@ -1344,7 +1345,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
break;
} else {
unsigned OpNum = 0;
- std::vector<Value *> Vs;
+ SmallVector<Value *,4> Vs;
do {
Value *Op = NULL;
if (getValueTypePair(Record, OpNum, NextValueNo, Op))
@@ -1352,7 +1353,8 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
Vs.push_back(Op);
} while(OpNum != Record.size());
- I = new ReturnInst(Vs);
+ // SmallVector Vs has at least one element.
+ I = new ReturnInst(&Vs[0], Vs.size());
break;
}
}