[llvm-commits] CVS: llvm/lib/VMCore/iOperators.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Jun 9 21:08:01 PDT 2004
Changes in directory llvm/lib/VMCore:
iOperators.cpp updated: 1.27 -> 1.28
---
Log message:
Share some code
---
Diffs of the changes: (+3 -11)
Index: llvm/lib/VMCore/iOperators.cpp
diff -u llvm/lib/VMCore/iOperators.cpp:1.27 llvm/lib/VMCore/iOperators.cpp:1.28
--- llvm/lib/VMCore/iOperators.cpp:1.27 Wed May 26 19:15:23 2004
+++ llvm/lib/VMCore/iOperators.cpp Wed Jun 9 20:57:38 2004
@@ -73,17 +73,9 @@
BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
const std::string &Name,
BasicBlock *InsertAtEnd) {
- assert(S1->getType() == S2->getType() &&
- "Cannot create binary operator with two operands of differing type!");
- switch (Op) {
- // Binary comparison operators...
- case SetLT: case SetGT: case SetLE:
- case SetGE: case SetEQ: case SetNE:
- return new SetCondInst(Op, S1, S2, Name, InsertAtEnd);
-
- default:
- return new BinaryOperator(Op, S1, S2, S1->getType(), Name, InsertAtEnd);
- }
+ BinaryOperator *Res = create(Op, S1, S2, Name);
+ InsertAtEnd->getInstList().push_back(Res);
+ return Res;
}
BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name,
More information about the llvm-commits
mailing list