aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/ConstantFold.cpp
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
commit2f2ab4797b28ede081fda36855a26e8ec1b9357e (patch)
tree1c8c18901981239213e9c0c60e52786bd8916c38 /lib/VMCore/ConstantFold.cpp
parent856b38c3e9341ed6667788eb3c923be358ac5b71 (diff)
downloadexternal_llvm-2f2ab4797b28ede081fda36855a26e8ec1b9357e.zip
external_llvm-2f2ab4797b28ede081fda36855a26e8ec1b9357e.tar.gz
external_llvm-2f2ab4797b28ede081fda36855a26e8ec1b9357e.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80959 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r--lib/VMCore/ConstantFold.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index 701a195..a869467 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -122,9 +122,7 @@ static Constant *FoldBitCast(LLVMContext &Context,
}
if (ElTy == DPTy->getElementType())
- // This GEP is inbounds because all indices are zero.
- return ConstantExpr::getInBoundsGetElementPtr(V, &IdxList[0],
- IdxList.size());
+ return ConstantExpr::getGetElementPtr(V, &IdxList[0], IdxList.size());
}
// Handle casts from one vector constant to another. We know that the src