[llvm-commits] CVS: llvm/lib/Transforms/ExprTypeConvert.cpp LevelRaise.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Jan 12 12:13:02 PST 2004
Changes in directory llvm/lib/Transforms:
ExprTypeConvert.cpp updated: 1.87 -> 1.88
LevelRaise.cpp updated: 1.92 -> 1.93
---
Log message:
Remove uses of ConstantHandling itf
---
Diffs of the changes: (+5 -9)
Index: llvm/lib/Transforms/ExprTypeConvert.cpp
diff -u llvm/lib/Transforms/ExprTypeConvert.cpp:1.87 llvm/lib/Transforms/ExprTypeConvert.cpp:1.88
--- llvm/lib/Transforms/ExprTypeConvert.cpp:1.87 Thu Jan 8 23:53:38 2004
+++ llvm/lib/Transforms/ExprTypeConvert.cpp Mon Jan 12 12:12:44 2004
@@ -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 @@
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 @@
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;
Index: llvm/lib/Transforms/LevelRaise.cpp
diff -u llvm/lib/Transforms/LevelRaise.cpp:1.92 llvm/lib/Transforms/LevelRaise.cpp:1.93
--- llvm/lib/Transforms/LevelRaise.cpp:1.92 Thu Jan 8 23:53:38 2004
+++ llvm/lib/Transforms/LevelRaise.cpp Mon Jan 12 12:12:44 2004
@@ -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"
More information about the llvm-commits
mailing list