[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Apr 16 17:42:01 PDT 2003
Changes in directory llvm/lib/VMCore:
Constants.cpp updated: 1.34 -> 1.35
---
Log message:
Change the interface to constant expressions to allow automatic folding
---
Diffs of the changes:
Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.34 llvm/lib/VMCore/Constants.cpp:1.35
--- llvm/lib/VMCore/Constants.cpp:1.34 Mon Mar 10 16:39:02 2003
+++ llvm/lib/VMCore/Constants.cpp Wed Apr 16 17:40:51 2003
@@ -418,7 +418,7 @@
void ConstantExpr::replaceUsesOfWithOnConstant(Value *From, Value *To) {
assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!");
- ConstantExpr *Replacement = 0;
+ Constant *Replacement = 0;
if (getOpcode() == Instruction::GetElementPtr) {
std::vector<Constant*> Indices;
Constant *Pointer = cast<Constant>(getOperand(0));
@@ -635,8 +635,7 @@
typedef pair<unsigned, vector<Constant*> > ExprMapKeyType;
static ValueMap<const ExprMapKeyType, ConstantExpr> ExprConstants;
-ConstantExpr *ConstantExpr::getCast(Constant *C, const Type *Ty) {
-
+Constant *ConstantExpr::getCast(Constant *C, const Type *Ty) {
// Look up the constant in the table first to ensure uniqueness
vector<Constant*> argVec(1, C);
const ExprMapKeyType &Key = make_pair(Instruction::Cast, argVec);
@@ -649,7 +648,7 @@
return Result;
}
-ConstantExpr *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2) {
+Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2) {
// Look up the constant in the table first to ensure uniqueness
vector<Constant*> argVec(1, C1); argVec.push_back(C2);
const ExprMapKeyType &Key = make_pair(Opcode, argVec);
@@ -670,8 +669,8 @@
return Result;
}
-ConstantExpr *ConstantExpr::getGetElementPtr(Constant *C,
- const std::vector<Constant*> &IdxList) {
+Constant *ConstantExpr::getGetElementPtr(Constant *C,
+ const std::vector<Constant*> &IdxList){
const Type *Ty = C->getType();
// Look up the constant in the table first to ensure uniqueness
More information about the llvm-commits
mailing list