summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/Support/ConstantFolder.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-03 22:17:40 +0000
committerDan Gohman <gohman@apple.com>2009-09-03 22:17:40 +0000
commit2a53b30f6d938c17cca0ce578fee0f4e301565c4 (patch)
tree00afd31a3be33726ea4a2b7da8ed5566ffd2f8d2 /llvm/include/llvm/Support/ConstantFolder.h
parent6c08cfcfa0eb81f28cfd3003bac0d554ec9dc051 (diff)
downloadbcm5719-llvm-2a53b30f6d938c17cca0ce578fee0f4e301565c4.tar.gz
bcm5719-llvm-2a53b30f6d938c17cca0ce578fee0f4e301565c4.zip
Remove the API for creating ConstantExprs with the nsw, nuw, inbounds,
and exact flags. Because ConstantExprs are uniqued, creating an expression with this flag causes all expressions with the same operands to have the same flag, which may not be safe. Add, sub, mul, and sdiv ConstantExprs are usually folded anyway, so the main interesting flag here is inbounds, and the constant folder already knows how to set the inbounds flag automatically in most cases, so there isn't an urgent need for the API support. This can be reconsidered in the future, but for now just removing these API bits eliminates a source of potential trouble with little downside. llvm-svn: 80959
Diffstat (limited to 'llvm/include/llvm/Support/ConstantFolder.h')
-rw-r--r--llvm/include/llvm/Support/ConstantFolder.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/include/llvm/Support/ConstantFolder.h b/llvm/include/llvm/Support/ConstantFolder.h
index 3c9278aaa7a..8ce52379fc2 100644
--- a/llvm/include/llvm/Support/ConstantFolder.h
+++ b/llvm/include/llvm/Support/ConstantFolder.h
@@ -36,7 +36,7 @@ public:
return ConstantExpr::getAdd(LHS, RHS);
}
Constant *CreateNSWAdd(Constant *LHS, Constant *RHS) const {
- return ConstantExpr::getNSWAdd(LHS, RHS);
+ return ConstantExpr::getAdd(LHS, RHS);
}
Constant *CreateFAdd(Constant *LHS, Constant *RHS) const {
return ConstantExpr::getFAdd(LHS, RHS);
@@ -60,7 +60,7 @@ public:
return ConstantExpr::getSDiv(LHS, RHS);
}
Constant *CreateExactSDiv(Constant *LHS, Constant *RHS) const {
- return ConstantExpr::getExactSDiv(LHS, RHS);
+ return ConstantExpr::getSDiv(LHS, RHS);
}
Constant *CreateFDiv(Constant *LHS, Constant *RHS) const {
return ConstantExpr::getFDiv(LHS, RHS);
@@ -127,11 +127,11 @@ public:
Constant *CreateInBoundsGetElementPtr(Constant *C, Constant* const *IdxList,
unsigned NumIdx) const {
- return ConstantExpr::getInBoundsGetElementPtr(C, IdxList, NumIdx);
+ return ConstantExpr::getGetElementPtr(C, IdxList, NumIdx);
}
Constant *CreateInBoundsGetElementPtr(Constant *C, Value* const *IdxList,
unsigned NumIdx) const {
- return ConstantExpr::getInBoundsGetElementPtr(C, IdxList, NumIdx);
+ return ConstantExpr::getGetElementPtr(C, IdxList, NumIdx);
}
//===--------------------------------------------------------------------===//
OpenPOWER on IntegriCloud