[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp
Reid Spencer
reid at x10sys.com
Sun Dec 3 21:24:06 PST 2006
Changes in directory llvm/lib/Bytecode/Reader:
Reader.cpp updated: 1.210 -> 1.211
---
Log message:
For PR950: http://llvm.org/PR950 : Implement read/write of ICmp and FCmp constant expressions
---
Diffs of the changes: (+10 -6)
Reader.cpp | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.210 llvm/lib/Bytecode/Reader/Reader.cpp:1.211
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.210 Sun Dec 3 11:17:02 2006
+++ llvm/lib/Bytecode/Reader/Reader.cpp Sun Dec 3 23:23:49 2006
@@ -1355,14 +1355,18 @@
return Result;
} else if (Opcode == Instruction::ICmp) {
if (ArgVec.size() != 2)
- error("Invalid ICmp constant expr arguments");
- unsigned short pred = read_vbr_uint();
- return ConstantExpr::getICmp(pred, ArgVec[0], ArgVec[1]);
+ error("Invalid ICmp constant expr arguments.");
+ unsigned predicate = read_vbr_uint();
+ Constant *Result = ConstantExpr::getICmp(predicate, ArgVec[0], ArgVec[1]);
+ if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
+ return Result;
} else if (Opcode == Instruction::FCmp) {
if (ArgVec.size() != 2)
- error("Invalid FCmp constant expr arguments");
- unsigned short pred = read_vbr_uint();
- return ConstantExpr::getFCmp(pred, ArgVec[0], ArgVec[1]);
+ error("Invalid FCmp constant expr arguments.");
+ unsigned predicate = read_vbr_uint();
+ Constant *Result = ConstantExpr::getFCmp(predicate, ArgVec[0], ArgVec[1]);
+ if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
+ return Result;
} else { // All other 2-operand expressions
Constant* Result = ConstantExpr::get(Opcode, ArgVec[0], ArgVec[1]);
if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
More information about the llvm-commits
mailing list