Pass a vector around to reduce dynamic allocation

Throw the RawInst class in an anon namespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8990 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2003-10-09 20:45:42 +00:00
parent 342be126ef
commit 6fcf50338e
3 changed files with 17 additions and 13 deletions

View File

@ -14,15 +14,16 @@
#include "llvm/iPHINode.h"
#include "llvm/iOther.h"
struct RawInst { // The raw fields out of the bytecode stream...
unsigned NumOperands;
unsigned Opcode;
unsigned Type;
RawInst(const unsigned char *&Buf, const unsigned char *EndBuf,
std::vector<unsigned> &Args);
};
namespace {
struct RawInst { // The raw fields out of the bytecode stream...
unsigned NumOperands;
unsigned Opcode;
unsigned Type;
RawInst(const unsigned char *&Buf, const unsigned char *EndBuf,
std::vector<unsigned> &Args);
};
}
@ -102,8 +103,9 @@ RawInst::RawInst(const unsigned char *&Buf, const unsigned char *EndBuf,
Instruction *BytecodeParser::ParseInstruction(const unsigned char *&Buf,
const unsigned char *EndBuf) {
std::vector<unsigned> Args;
const unsigned char *EndBuf,
std::vector<unsigned> &Args) {
Args.clear();
RawInst RI(Buf, EndBuf, Args);
const Type *InstTy = getType(RI.Type);