diff options
author | Duncan Sands <baldrick@free.fr> | 2009-09-26 15:35:35 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2009-09-26 15:35:35 +0000 |
commit | 3548ea8e905269e819fdd4c7fab42142b745c6c5 (patch) | |
tree | 10e110cbda235efd41cf7f7a5a0d219f1e613ff0 /lib/VMCore | |
parent | 11eab02b770086c119a18aae0fe214fbe5eed0d0 (diff) | |
download | external_llvm-3548ea8e905269e819fdd4c7fab42142b745c6c5.zip external_llvm-3548ea8e905269e819fdd4c7fab42142b745c6c5.tar.gz external_llvm-3548ea8e905269e819fdd4c7fab42142b745c6c5.tar.bz2 |
For the NSWSub support in the builder to actually be useable,
there need to be corresponding changes to the constant folders,
done in this patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Constants.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index ecaf9ab..eb7e7c0 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -643,6 +643,11 @@ Constant* ConstantExpr::getNSWAdd(Constant* C1, Constant* C2) { OverflowingBinaryOperator::NoSignedWrap); } +Constant* ConstantExpr::getNSWSub(Constant* C1, Constant* C2) { + return getTy(C1->getType(), Instruction::Sub, C1, C2, + OverflowingBinaryOperator::NoSignedWrap); +} + Constant* ConstantExpr::getExactSDiv(Constant* C1, Constant* C2) { return getTy(C1->getType(), Instruction::SDiv, C1, C2, SDivOperator::IsExact); |