aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bytecode/Reader
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
commitcdaff32ef63230f2f2e5f1ecdc4243c7d4d9acd7 (patch)
tree63f0e5ee2ab837d5b6f3bd3d32386c04cf30dc63 /lib/Bytecode/Reader
parent68e3dbc4933c11ed15dbcdb073e5c28d3f90047f (diff)
downloadexternal_llvm-cdaff32ef63230f2f2e5f1ecdc4243c7d4d9acd7.zip
external_llvm-cdaff32ef63230f2f2e5f1ecdc4243c7d4d9acd7.tar.gz
external_llvm-cdaff32ef63230f2f2e5f1ecdc4243c7d4d9acd7.tar.bz2
Fix bogus warning and simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10924 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader')
-rw-r--r--lib/Bytecode/Reader/Reader.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index dca8890..977acbc 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/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())