aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader/Reader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-09 18:25:19 +0000
committerChris Lattner <sabre@nondot.org>2003-10-09 18:25:19 +0000
commit3483f54367e990c61eda61a6a550ba2634a13cb9 (patch)
tree5f8492876742d269eef59d87fc259e7485d600af /lib/Bytecode/Reader/Reader.cpp
parentabb84f84278be1ede058a73529c1ab81db2ea3cd (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8983 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader/Reader.cpp')
-rw-r--r--lib/Bytecode/Reader/Reader.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index 4011af7b04..67726eb2c1 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/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.");
}