enrich folder interfaces around exactness.
authorChris Lattner <sabre@nondot.org>
Wed, 9 Feb 2011 16:44:36 +0000 (16:44 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 9 Feb 2011 16:44:36 +0000 (16:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125191 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/ConstantFolder.h
include/llvm/Support/TargetFolder.h

index 93adb3a403defa85fca12e6be90207e1cb5c504c..e56d3f6bce9f5b6a2cd2fe2eb087457ab2a76c0a 100644 (file)
@@ -69,17 +69,13 @@ public:
   Constant *CreateFMul(Constant *LHS, Constant *RHS) const {
     return ConstantExpr::getFMul(LHS, RHS);
   }
-  Constant *CreateUDiv(Constant *LHS, Constant *RHS) const {
-    return ConstantExpr::getUDiv(LHS, RHS);
+  Constant *CreateUDiv(Constant *LHS, Constant *RHS,
+                       bool isExact = false) const {
+    return ConstantExpr::getUDiv(LHS, RHS, isExact);
   }
-  Constant *CreateExactUDiv(Constant *LHS, Constant *RHS) const {
-    return ConstantExpr::getExactUDiv(LHS, RHS);
-  }
-  Constant *CreateSDiv(Constant *LHS, Constant *RHS) const {
-    return ConstantExpr::getSDiv(LHS, RHS);
-  }
-  Constant *CreateExactSDiv(Constant *LHS, Constant *RHS) const {
-    return ConstantExpr::getExactSDiv(LHS, RHS);
+  Constant *CreateSDiv(Constant *LHS, Constant *RHS,
+                       bool isExact = false) const {
+    return ConstantExpr::getSDiv(LHS, RHS, isExact);
   }
   Constant *CreateFDiv(Constant *LHS, Constant *RHS) const {
     return ConstantExpr::getFDiv(LHS, RHS);
@@ -96,11 +92,13 @@ public:
   Constant *CreateShl(Constant *LHS, Constant *RHS) const {
     return ConstantExpr::getShl(LHS, RHS);
   }
-  Constant *CreateLShr(Constant *LHS, Constant *RHS) const {
-    return ConstantExpr::getLShr(LHS, RHS);
+  Constant *CreateLShr(Constant *LHS, Constant *RHS,
+                       bool isExact = false) const {
+    return ConstantExpr::getLShr(LHS, RHS, isExact);
   }
-  Constant *CreateAShr(Constant *LHS, Constant *RHS) const {
-    return ConstantExpr::getAShr(LHS, RHS);
+  Constant *CreateAShr(Constant *LHS, Constant *RHS,
+                       bool isExact = false) const {
+    return ConstantExpr::getAShr(LHS, RHS, isExact);
   }
   Constant *CreateAnd(Constant *LHS, Constant *RHS) const {
     return ConstantExpr::getAnd(LHS, RHS);
index 138885d48d1cf6087901f3c9f86fd2980970d144..efae4b1e3b4581b59a9445e42d21891ebe1a2f65 100644 (file)
@@ -82,17 +82,11 @@ public:
   Constant *CreateFMul(Constant *LHS, Constant *RHS) const {
     return Fold(ConstantExpr::getFMul(LHS, RHS));
   }
-  Constant *CreateUDiv(Constant *LHS, Constant *RHS) const {
-    return Fold(ConstantExpr::getUDiv(LHS, RHS));
+  Constant *CreateUDiv(Constant *LHS, Constant *RHS, bool isExact = false)const{
+    return Fold(ConstantExpr::getUDiv(LHS, RHS, isExact));
   }
-  Constant *CreateExactUDiv(Constant *LHS, Constant *RHS) const {
-    return Fold(ConstantExpr::getExactUDiv(LHS, RHS));
-  }
-  Constant *CreateSDiv(Constant *LHS, Constant *RHS) const {
-    return Fold(ConstantExpr::getSDiv(LHS, RHS));
-  }
-  Constant *CreateExactSDiv(Constant *LHS, Constant *RHS) const {
-    return Fold(ConstantExpr::getExactSDiv(LHS, RHS));
+  Constant *CreateSDiv(Constant *LHS, Constant *RHS, bool isExact = false)const{
+    return Fold(ConstantExpr::getSDiv(LHS, RHS, isExact));
   }
   Constant *CreateFDiv(Constant *LHS, Constant *RHS) const {
     return Fold(ConstantExpr::getFDiv(LHS, RHS));
@@ -109,11 +103,11 @@ public:
   Constant *CreateShl(Constant *LHS, Constant *RHS) const {
     return Fold(ConstantExpr::getShl(LHS, RHS));
   }
-  Constant *CreateLShr(Constant *LHS, Constant *RHS) const {
-    return Fold(ConstantExpr::getLShr(LHS, RHS));
+  Constant *CreateLShr(Constant *LHS, Constant *RHS, bool isExact = false)const{
+    return Fold(ConstantExpr::getLShr(LHS, RHS, isExact));
   }
-  Constant *CreateAShr(Constant *LHS, Constant *RHS) const {
-    return Fold(ConstantExpr::getAShr(LHS, RHS));
+  Constant *CreateAShr(Constant *LHS, Constant *RHS, bool isExact = false)const{
+    return Fold(ConstantExpr::getAShr(LHS, RHS, isExact));
   }
   Constant *CreateAnd(Constant *LHS, Constant *RHS) const {
     return Fold(ConstantExpr::getAnd(LHS, RHS));