[llvm-commits] [llvm] r75559 - in /llvm/trunk: include/llvm/Constants.h lib/Analysis/ScalarEvolution.cpp lib/VMCore/Constants.cpp lib/VMCore/LLVMContext.cpp
Owen Anderson
resistor at mac.com
Mon Jul 13 16:51:02 PDT 2009
Author: resistor
Date: Mon Jul 13 18:50:59 2009
New Revision: 75559
URL: http://llvm.org/viewvc/llvm-project?rev=75559&view=rev
Log:
Move more functionality over to LLVMContext.
Modified:
llvm/trunk/include/llvm/Constants.h
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
llvm/trunk/lib/VMCore/Constants.cpp
llvm/trunk/lib/VMCore/LLVMContext.cpp
Modified: llvm/trunk/include/llvm/Constants.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Constants.h?rev=75559&r1=75558&r2=75559&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Constants.h (original)
+++ llvm/trunk/include/llvm/Constants.h Mon Jul 13 18:50:59 2009
@@ -692,26 +692,8 @@
/// ConstantExpr::get* - Return some common constants without having to
/// specify the full Instruction::OPCODE identifier.
///
- static Constant *getAdd(Constant *C1, Constant *C2);
- static Constant *getFAdd(Constant *C1, Constant *C2);
- static Constant *getSub(Constant *C1, Constant *C2);
- static Constant *getFSub(Constant *C1, Constant *C2);
- static Constant *getMul(Constant *C1, Constant *C2);
- static Constant *getFMul(Constant *C1, Constant *C2);
- static Constant *getUDiv(Constant *C1, Constant *C2);
- static Constant *getSDiv(Constant *C1, Constant *C2);
- static Constant *getFDiv(Constant *C1, Constant *C2);
- static Constant *getURem(Constant *C1, Constant *C2); // unsigned rem
- static Constant *getSRem(Constant *C1, Constant *C2); // signed rem
- static Constant *getFRem(Constant *C1, Constant *C2);
- static Constant *getAnd(Constant *C1, Constant *C2);
- static Constant *getOr(Constant *C1, Constant *C2);
- static Constant *getXor(Constant *C1, Constant *C2);
static Constant *getICmp(unsigned short pred, Constant *LHS, Constant *RHS);
static Constant *getFCmp(unsigned short pred, Constant *LHS, Constant *RHS);
- static Constant *getShl(Constant *C1, Constant *C2);
- static Constant *getLShr(Constant *C1, Constant *C2);
- static Constant *getAShr(Constant *C1, Constant *C2);
/// Getelementptr form. std::vector<Value*> is only accepted for convenience:
/// all elements must be Constant's.
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=75559&r1=75558&r2=75559&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Jul 13 18:50:59 2009
@@ -1722,7 +1722,7 @@
if (const SCEVConstant *LHSC = dyn_cast<SCEVConstant>(LHS)) {
Constant *LHSCV = LHSC->getValue();
Constant *RHSCV = RHSC->getValue();
- return getConstant(cast<ConstantInt>(ConstantExpr::getUDiv(LHSCV,
+ return getConstant(cast<ConstantInt>(Context->getConstantExprUDiv(LHSCV,
RHSCV)));
}
}
Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=75559&r1=75558&r2=75559&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Mon Jul 13 18:50:59 2009
@@ -754,65 +754,11 @@
return cast<InsertValueConstantExpr>(this)->Indices;
}
-Constant *ConstantExpr::getAdd(Constant *C1, Constant *C2) {
- return get(Instruction::Add, C1, C2);
-}
-Constant *ConstantExpr::getFAdd(Constant *C1, Constant *C2) {
- return get(Instruction::FAdd, C1, C2);
-}
-Constant *ConstantExpr::getSub(Constant *C1, Constant *C2) {
- return get(Instruction::Sub, C1, C2);
-}
-Constant *ConstantExpr::getFSub(Constant *C1, Constant *C2) {
- return get(Instruction::FSub, C1, C2);
-}
-Constant *ConstantExpr::getMul(Constant *C1, Constant *C2) {
- return get(Instruction::Mul, C1, C2);
-}
-Constant *ConstantExpr::getFMul(Constant *C1, Constant *C2) {
- return get(Instruction::FMul, C1, C2);
-}
-Constant *ConstantExpr::getUDiv(Constant *C1, Constant *C2) {
- return get(Instruction::UDiv, C1, C2);
-}
-Constant *ConstantExpr::getSDiv(Constant *C1, Constant *C2) {
- return get(Instruction::SDiv, C1, C2);
-}
-Constant *ConstantExpr::getFDiv(Constant *C1, Constant *C2) {
- return get(Instruction::FDiv, C1, C2);
-}
-Constant *ConstantExpr::getURem(Constant *C1, Constant *C2) {
- return get(Instruction::URem, C1, C2);
-}
-Constant *ConstantExpr::getSRem(Constant *C1, Constant *C2) {
- return get(Instruction::SRem, C1, C2);
-}
-Constant *ConstantExpr::getFRem(Constant *C1, Constant *C2) {
- return get(Instruction::FRem, C1, C2);
-}
-Constant *ConstantExpr::getAnd(Constant *C1, Constant *C2) {
- return get(Instruction::And, C1, C2);
-}
-Constant *ConstantExpr::getOr(Constant *C1, Constant *C2) {
- return get(Instruction::Or, C1, C2);
-}
-Constant *ConstantExpr::getXor(Constant *C1, Constant *C2) {
- return get(Instruction::Xor, C1, C2);
-}
unsigned ConstantExpr::getPredicate() const {
assert(getOpcode() == Instruction::FCmp ||
getOpcode() == Instruction::ICmp);
return ((const CompareConstantExpr*)this)->predicate;
}
-Constant *ConstantExpr::getShl(Constant *C1, Constant *C2) {
- return get(Instruction::Shl, C1, C2);
-}
-Constant *ConstantExpr::getLShr(Constant *C1, Constant *C2) {
- return get(Instruction::LShr, C1, C2);
-}
-Constant *ConstantExpr::getAShr(Constant *C1, Constant *C2) {
- return get(Instruction::AShr, C1, C2);
-}
/// getWithOperandReplaced - Return a constant expression identical to this
/// one, but with the specified operand set to the specified value.
Modified: llvm/trunk/lib/VMCore/LLVMContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContext.cpp?rev=75559&r1=75558&r2=75559&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/LLVMContext.cpp (original)
+++ llvm/trunk/lib/VMCore/LLVMContext.cpp Mon Jul 13 18:50:59 2009
@@ -293,63 +293,63 @@
}
Constant* LLVMContext::getConstantExprAdd(Constant* C1, Constant* C2) {
- return ConstantExpr::getAdd(C1, C2);
+ return getConstantExpr(Instruction::Add, C1, C2);
}
Constant* LLVMContext::getConstantExprFAdd(Constant* C1, Constant* C2) {
- return ConstantExpr::getFAdd(C1, C2);
+ return getConstantExpr(Instruction::FAdd, C1, C2);
}
Constant* LLVMContext::getConstantExprSub(Constant* C1, Constant* C2) {
- return ConstantExpr::getSub(C1, C2);
+ return getConstantExpr(Instruction::Sub, C1, C2);
}
Constant* LLVMContext::getConstantExprFSub(Constant* C1, Constant* C2) {
- return ConstantExpr::getFSub(C1, C2);
+ return getConstantExpr(Instruction::FSub, C1, C2);
}
Constant* LLVMContext::getConstantExprMul(Constant* C1, Constant* C2) {
- return ConstantExpr::getMul(C1, C2);
+ return getConstantExpr(Instruction::Mul, C1, C2);
}
Constant* LLVMContext::getConstantExprFMul(Constant* C1, Constant* C2) {
- return ConstantExpr::getFMul(C1, C2);
+ return getConstantExpr(Instruction::FMul, C1, C2);
}
Constant* LLVMContext::getConstantExprUDiv(Constant* C1, Constant* C2) {
- return ConstantExpr::getUDiv(C1, C2);
+ return getConstantExpr(Instruction::UDiv, C1, C2);
}
Constant* LLVMContext::getConstantExprSDiv(Constant* C1, Constant* C2) {
- return ConstantExpr::getSDiv(C1, C2);
+ return getConstantExpr(Instruction::SDiv, C1, C2);
}
Constant* LLVMContext::getConstantExprFDiv(Constant* C1, Constant* C2) {
- return ConstantExpr::getFDiv(C1, C2);
+ return getConstantExpr(Instruction::FDiv, C1, C2);
}
Constant* LLVMContext::getConstantExprURem(Constant* C1, Constant* C2) {
- return ConstantExpr::getURem(C1, C2);
+ return getConstantExpr(Instruction::URem, C1, C2);
}
Constant* LLVMContext::getConstantExprSRem(Constant* C1, Constant* C2) {
- return ConstantExpr::getSRem(C1, C2);
+ return getConstantExpr(Instruction::SRem, C1, C2);
}
Constant* LLVMContext::getConstantExprFRem(Constant* C1, Constant* C2) {
- return ConstantExpr::getFRem(C1, C2);
+ return getConstantExpr(Instruction::FRem, C1, C2);
}
Constant* LLVMContext::getConstantExprAnd(Constant* C1, Constant* C2) {
- return ConstantExpr::getAnd(C1, C2);
+ return getConstantExpr(Instruction::And, C1, C2);
}
Constant* LLVMContext::getConstantExprOr(Constant* C1, Constant* C2) {
- return ConstantExpr::getOr(C1, C2);
+ return getConstantExpr(Instruction::Or, C1, C2);
}
Constant* LLVMContext::getConstantExprXor(Constant* C1, Constant* C2) {
- return ConstantExpr::getXor(C1, C2);
+ return getConstantExpr(Instruction::Xor, C1, C2);
}
Constant* LLVMContext::getConstantExprICmp(unsigned short pred, Constant* LHS,
@@ -363,15 +363,15 @@
}
Constant* LLVMContext::getConstantExprShl(Constant* C1, Constant* C2) {
- return ConstantExpr::getShl(C1, C2);
+ return getConstantExpr(Instruction::Shl, C1, C2);
}
Constant* LLVMContext::getConstantExprLShr(Constant* C1, Constant* C2) {
- return ConstantExpr::getLShr(C1, C2);
+ return getConstantExpr(Instruction::LShr, C1, C2);
}
Constant* LLVMContext::getConstantExprAShr(Constant* C1, Constant* C2) {
- return ConstantExpr::getAShr(C1, C2);
+ return getConstantExpr(Instruction::AShr, C1, C2);
}
Constant* LLVMContext::getConstantExprGetElementPtr(Constant* C,
More information about the llvm-commits
mailing list