#include "llvm/iBinary.h"
#include "llvm/Type.h"
+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:
+ return new SetCondInst((BinaryOps)Op, S1, S2, Name);
+
+ default:
+ cerr << "Don't know how to GetBinaryOperator " << Op << endl;
+ return 0;
+ }
+}
+
//===----------------------------------------------------------------------===//
// SetCondInst Class
//===----------------------------------------------------------------------===//