From: Chris Lattner Date: Wed, 27 Jun 2001 23:36:49 +0000 (+0000) Subject: Change to use the new GenericBinaryInst class. Support lots more operators. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=8a36b31e1afc958446c316218da5c54a1a61409e;p=oota-llvm.git 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 --- diff --git a/lib/VMCore/iOperators.cpp b/lib/VMCore/iOperators.cpp index d856a20d0a5..c1efb42e716 100644 --- a/lib/VMCore/iOperators.cpp +++ b/lib/VMCore/iOperators.cpp @@ -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: