aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-01-12 18:12:44 +0000
committerChris Lattner <sabre@nondot.org>2004-01-12 18:12:44 +0000
commitccd3a878d0b17017eb5d86c89351992dc3e35638 (patch)
treeff5b264157ffe4691bfde404b298cfdd6ca5e464 /lib
parentd4d4ab58ef214c5eef781417719107032c361b45 (diff)
Remove uses of ConstantHandling itf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10783 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/ExprTypeConvert.cpp13
-rw-r--r--lib/Transforms/LevelRaise.cpp1
2 files changed, 5 insertions, 9 deletions
diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp
index 3fce96b628..d46878d26b 100644
--- a/lib/Transforms/ExprTypeConvert.cpp
+++ b/lib/Transforms/ExprTypeConvert.cpp
@@ -14,10 +14,11 @@
//===----------------------------------------------------------------------===//
#include "TransformInternals.h"
+#include "llvm/Constants.h"
#include "llvm/iOther.h"
#include "llvm/iPHINode.h"
#include "llvm/iMemory.h"
-#include "llvm/ConstantHandling.h"
+
#include "llvm/Analysis/Expressions.h"
#include "Support/STLExtras.h"
#include "Support/Debug.h"
@@ -151,11 +152,10 @@ bool llvm::ExpressionConvertibleToType(Value *V, const Type *Ty,
if (CTMI != CTMap.end()) return CTMI->second == Ty;
// If it's a constant... all constants can be converted to a different
- // type. We just ask the constant propagator to see if it can convert the
- // value...
+ // type.
//
if (Constant *CPV = dyn_cast<Constant>(V))
- return ConstantFoldCastInstruction(CPV, Ty);
+ return true;
CTMap[V] = Ty;
if (V->getType() == Ty) return true; // Expression already correct type!
@@ -352,10 +352,7 @@ Value *llvm::ConvertExpressionToType(Value *V, const Type *Ty,
Constant *CPV = cast<Constant>(V);
// Constants are converted by constant folding the cast that is required.
// We assume here that all casts are implemented for constant prop.
- Value *Result = ConstantFoldCastInstruction(CPV, Ty);
- assert(Result && "ConstantFoldCastInstruction Failed!!!");
- assert(Result->getType() == Ty && "Const prop of cast failed!");
-
+ Value *Result = ConstantExpr::getCast(CPV, Ty);
// Add the instruction to the expression map
//VMC.ExprMap[V] = Result;
return Result;
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp
index 8b5e253950..c128688da2 100644
--- a/lib/Transforms/LevelRaise.cpp
+++ b/lib/Transforms/LevelRaise.cpp
@@ -19,7 +19,6 @@
#include "llvm/iOther.h"
#include "llvm/iMemory.h"
#include "llvm/Pass.h"
-#include "llvm/ConstantHandling.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "Support/CommandLine.h"
#include "Support/Debug.h"