summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-06-02 21:48:15 +0000
committerDan Gohman <gohman@apple.com>2009-06-02 21:48:15 +0000
commit7714285efd2a7f4e503f0f600667193e63ee6d08 (patch)
treec8c2337a78ffb65fb9401c45017780ed3a127c2c /lib
parent014d53595c06a77d0f06f92ef8a7ab15e7e05c4a (diff)
downloadllvm-7714285efd2a7f4e503f0f600667193e63ee6d08.tar.gz
llvm-7714285efd2a7f4e503f0f600667193e63ee6d08.tar.bz2
llvm-7714285efd2a7f4e503f0f600667193e63ee6d08.tar.xz
Change ConstantFoldConstantExpression to accept a null
TargetData pointer. The only thing it's used for are calls to ConstantFoldCompareInstOperands and ConstantFoldInstOperands, which both already accept a null TargetData pointer. This makes ConstantFoldConstantExpression easier to use in clients where TargetData is optional. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72741 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/ConstantFolding.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp
index e5ab3226ce..261c635feb 100644
--- a/lib/Analysis/ConstantFolding.cpp
+++ b/lib/Analysis/ConstantFolding.cpp
@@ -317,8 +317,6 @@ Constant *llvm::ConstantFoldInstruction(Instruction *I, const TargetData *TD) {
/// result is returned, if not, null is returned.
Constant *llvm::ConstantFoldConstantExpression(ConstantExpr *CE,
const TargetData *TD) {
- assert(TD && "ConstantFoldConstantExpression requires a valid TargetData.");
-
SmallVector<Constant*, 8> Ops;
for (User::op_iterator i = CE->op_begin(), e = CE->op_end(); i != e; ++i)
Ops.push_back(cast<Constant>(*i));