Change to use the new GenericBinaryInst class. Support lots more operators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2001-06-27 23:36:49 +00:00
parent 3b34c59dcb
commit 8a36b31e1a

View File

@ -10,14 +10,21 @@
BinaryOperator *BinaryOperator::create(unsigned Op, Value *S1, Value *S2,
const string &Name) {
switch (Op) {
case Add: return new AddInst(S1, S2, Name);
case Sub: return new SubInst(S1, S2, Name);
case SetLT:
case SetGT:
case SetLE:
case SetGE:
case SetEQ:
case SetNE:
// Standard binary operators...
case Add: return new GenericBinaryInst(Op, S1, S2, "add", Name);
case Sub: return new GenericBinaryInst(Op, S1, S2, "sub", Name);
case Mul: return new GenericBinaryInst(Op, S1, S2, "mul", Name);
case Div: return new GenericBinaryInst(Op, S1, S2, "div", Name);
case Rem: return new GenericBinaryInst(Op, S1, S2, "rem", Name);
// Logical operators...
case And: return new GenericBinaryInst(Op, S1, S2, "and", Name);
case Or : return new GenericBinaryInst(Op, S1, S2, "or", Name);
case Xor: return new GenericBinaryInst(Op, S1, S2, "xor", Name);
// Binary comparison operators...
case SetLT: case SetGT: case SetLE:
case SetGE: case SetEQ: case SetNE:
return new SetCondInst((BinaryOps)Op, S1, S2, Name);
default: