Add a getNUWMul function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94982 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2010-02-01 16:38:14 +00:00
parent 2544a1de66
commit d75ff3104c
2 changed files with 6 additions and 0 deletions

View File

@ -699,6 +699,7 @@ public:
static Constant *getNSWNeg(Constant *C);
static Constant *getNSWAdd(Constant *C1, Constant *C2);
static Constant *getNSWSub(Constant *C1, Constant *C2);
static Constant *getNUWMul(Constant *C1, Constant *C2);
static Constant *getNSWMul(Constant *C1, Constant *C2);
static Constant *getExactSDiv(Constant *C1, Constant *C2);

View File

@ -656,6 +656,11 @@ Constant* ConstantExpr::getNSWSub(Constant* C1, Constant* C2) {
OverflowingBinaryOperator::NoSignedWrap);
}
Constant* ConstantExpr::getNUWMul(Constant* C1, Constant* C2) {
return getTy(C1->getType(), Instruction::Mul, C1, C2,
OverflowingBinaryOperator::NoUnsignedWrap);
}
Constant* ConstantExpr::getNSWMul(Constant* C1, Constant* C2) {
return getTy(C1->getType(), Instruction::Mul, C1, C2,
OverflowingBinaryOperator::NoSignedWrap);