[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp
Reid Spencer
reid at x10sys.com
Fri Jan 12 16:09:27 PST 2007
Changes in directory llvm/lib/Bytecode/Reader:
Reader.cpp updated: 1.221 -> 1.222
---
Log message:
Get rid of some useless distinction between bool and integer.
---
Diffs of the changes: (+4 -11)
Reader.cpp | 15 ++++-----------
1 files changed, 4 insertions(+), 11 deletions(-)
Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.221 llvm/lib/Bytecode/Reader/Reader.cpp:1.222
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.221 Fri Jan 12 13:20:46 2007
+++ llvm/lib/Bytecode/Reader/Reader.cpp Fri Jan 12 18:09:12 2007
@@ -1408,17 +1408,10 @@
const IntegerType *IT = cast<IntegerType>(Ty);
if (IT->getBitWidth() <= 32) {
uint32_t Val = read_vbr_uint();
- if (IT->getBitWidth() == 1) {
- if (Val != 0 && Val != 1)
- error("Invalid boolean value read.");
- Result = ConstantInt::get(Type::Int1Ty, Val == 1);
- if (Handler) Handler->handleConstantValue(Result);
- } else {
- if (!ConstantInt::isValueValidForType(Ty, uint64_t(Val)))
- error("Integer value read is invalid for type.");
- Result = ConstantInt::get(IT, Val);
- if (Handler) Handler->handleConstantValue(Result);
- }
+ if (!ConstantInt::isValueValidForType(Ty, uint64_t(Val)))
+ error("Integer value read is invalid for type.");
+ Result = ConstantInt::get(IT, Val);
+ if (Handler) Handler->handleConstantValue(Result);
} else if (IT->getBitWidth() <= 64) {
uint64_t Val = read_vbr_uint64();
if (!ConstantInt::isValueValidForType(Ty, Val))
More information about the llvm-commits
mailing list