From fb242b6edc3d92daf49c7d5b2c19d81447aa61bc Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 16 Apr 2003 22:40:51 +0000 Subject: Change the interface to constant expressions to allow automatic folding git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5793 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Constants.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/VMCore/Constants.cpp') diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 84f2566e46..27c48c8774 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -418,7 +418,7 @@ void ConstantPointerRef::replaceUsesOfWithOnConstant(Value *From, Value *To) { void ConstantExpr::replaceUsesOfWithOnConstant(Value *From, Value *To) { assert(isa(To) && "Cannot make Constant refer to non-constant!"); - ConstantExpr *Replacement = 0; + Constant *Replacement = 0; if (getOpcode() == Instruction::GetElementPtr) { std::vector Indices; Constant *Pointer = cast(getOperand(0)); @@ -635,8 +635,7 @@ void ConstantPointerRef::destroyConstant() { typedef pair > ExprMapKeyType; static ValueMap 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 argVec(1, C); const ExprMapKeyType &Key = make_pair(Instruction::Cast, argVec); @@ -649,7 +648,7 @@ ConstantExpr *ConstantExpr::getCast(Constant *C, const Type *Ty) { 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 argVec(1, C1); argVec.push_back(C2); const ExprMapKeyType &Key = make_pair(Opcode, argVec); @@ -670,8 +669,8 @@ ConstantExpr *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2) { return Result; } -ConstantExpr *ConstantExpr::getGetElementPtr(Constant *C, - const std::vector &IdxList) { +Constant *ConstantExpr::getGetElementPtr(Constant *C, + const std::vector &IdxList){ const Type *Ty = C->getType(); // Look up the constant in the table first to ensure uniqueness -- cgit v1.2.3-70-g09d2