aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-09-26 15:35:35 +0000
committerDuncan Sands <baldrick@free.fr>2009-09-26 15:35:35 +0000
commit3548ea8e905269e819fdd4c7fab42142b745c6c5 (patch)
tree10e110cbda235efd41cf7f7a5a0d219f1e613ff0 /lib/VMCore
parent11eab02b770086c119a18aae0fe214fbe5eed0d0 (diff)
downloadexternal_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.cpp5
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);