diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-09 18:25:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-09 18:25:19 +0000 |
commit | bd26abdc9544067d251b2569d4d97adad1f86e3e (patch) | |
tree | 1bcb4b773f48f17444f87ddf0dec7a5a7b36f3cc /llvm/lib/Bytecode/Reader/Reader.cpp | |
parent | 60eb9bc4af0e745280aae1619e74953348481bbc (diff) | |
download | bcm5719-llvm-bd26abdc9544067d251b2569d4d97adad1f86e3e.tar.gz bcm5719-llvm-bd26abdc9544067d251b2569d4d97adad1f86e3e.zip |
Significantly clean up parsing of instructions. This exceptionizes and
simplifies the control flow a bit. This provides a small (~3%) speedup,
but it's primarily a cleanup exercise.
llvm-svn: 8983
Diffstat (limited to 'llvm/lib/Bytecode/Reader/Reader.cpp')
-rw-r--r-- | llvm/lib/Bytecode/Reader/Reader.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp index 4011af7b049..67726eb2c11 100644 --- a/llvm/lib/Bytecode/Reader/Reader.cpp +++ b/llvm/lib/Bytecode/Reader/Reader.cpp @@ -199,10 +199,7 @@ BasicBlock *BytecodeParser::ParseBasicBlock(const unsigned char *&Buf, BB = ParsedBasicBlocks[BlockNo]; while (Buf < EndBuf) { - Instruction *Inst; - ParseInstruction(Buf, EndBuf, Inst); - - if (Inst == 0) { throw std::string("Could not parse Instruction."); } + Instruction *Inst = ParseInstruction(Buf, EndBuf); if (insertValue(Inst, Values) == -1) { throw std::string("Could not insert value."); } |