summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader/Reader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-01-20 17:06:29 +0000
committerChris Lattner <sabre@nondot.org>2004-01-20 17:06:29 +0000
commit6cc66d93f1d0a1b043f5dc184569bfb84cb60090 (patch)
treecab8e9bbdee14875a17313cb02402d1a3d72fbd7 /llvm/lib/Bytecode/Reader/Reader.cpp
parent083c99e347abae4d053638d23dae7a730ef63b18 (diff)
downloadbcm5719-llvm-6cc66d93f1d0a1b043f5dc184569bfb84cb60090.tar.gz
bcm5719-llvm-6cc66d93f1d0a1b043f5dc184569bfb84cb60090.zip
Fix bogus warning and simplify code
llvm-svn: 10924
Diffstat (limited to 'llvm/lib/Bytecode/Reader/Reader.cpp')
-rw-r--r--llvm/lib/Bytecode/Reader/Reader.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp
index dca88902059..977acbc861b 100644
--- a/llvm/lib/Bytecode/Reader/Reader.cpp
+++ b/llvm/lib/Bytecode/Reader/Reader.cpp
@@ -509,21 +509,15 @@ void BytecodeParser::ParseCompactionTable(const unsigned char *&Buf,
const unsigned char *End) {
while (Buf != End) {
- unsigned NumEntries;
+ unsigned NumEntries = read_vbr_uint(Buf, End);
unsigned Ty;
- NumEntries = read_vbr_uint(Buf, End);
- switch (NumEntries & 3) {
- case 0:
- case 1:
- case 2:
- Ty = NumEntries >> 2;
- NumEntries &= 3;
- break;
- case 3:
+ if ((NumEntries & 3) == 3) {
NumEntries >>= 2;
Ty = read_vbr_uint(Buf, End);
- break;
+ } else {
+ Ty = NumEntries >> 2;
+ NumEntries &= 3;
}
if (Ty >= CompactionTable.size())
OpenPOWER on IntegriCloud