mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Share some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14106 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -73,17 +73,9 @@ BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
|
|||||||
BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
|
BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
|
||||||
const std::string &Name,
|
const std::string &Name,
|
||||||
BasicBlock *InsertAtEnd) {
|
BasicBlock *InsertAtEnd) {
|
||||||
assert(S1->getType() == S2->getType() &&
|
BinaryOperator *Res = create(Op, S1, S2, Name);
|
||||||
"Cannot create binary operator with two operands of differing type!");
|
InsertAtEnd->getInstList().push_back(Res);
|
||||||
switch (Op) {
|
return Res;
|
||||||
// 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 *BinaryOperator::createNeg(Value *Op, const std::string &Name,
|
BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name,
|
||||||
|
Reference in New Issue
Block a user