mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Share some code
llvm-svn: 14106
This commit is contained in:
parent
9a3779e0a0
commit
2c6bea32de
@ -73,17 +73,9 @@ BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user