Skip to content

Commit

Permalink
the various ConstantExpr::get*Ty methods existed to work with issues …
Browse files Browse the repository at this point in the history
…around

type refinement.  Zap them now that type refinement is toast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134837 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lattner committed Jul 9, 2011
1 parent bda2065 commit eaf7980
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 178 deletions.
37 changes: 4 additions & 33 deletions include/llvm/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,35 +640,6 @@ class ConstantExpr : public Constant {
setValueSubclassData(Opcode);
}

// These private methods are used by the type resolution code to create
// ConstantExprs in intermediate forms.
static Constant *getTy(const Type *Ty, unsigned Opcode,
Constant *C1, Constant *C2,
unsigned Flags = 0);
static Constant *getCompareTy(unsigned short pred, Constant *C1,
Constant *C2);
static Constant *getSelectTy(const Type *Ty,
Constant *C1, Constant *C2, Constant *C3);
template<typename IndexTy>
static Constant *getGetElementPtrTy(const Type *Ty, Constant *C,
IndexTy const *Idxs, unsigned NumIdxs,
bool InBounds);
static Constant *getExtractElementTy(const Type *Ty, Constant *Val,
Constant *Idx);
static Constant *getInsertElementTy(const Type *Ty, Constant *Val,
Constant *Elt, Constant *Idx);
static Constant *getShuffleVectorTy(const Type *Ty, Constant *V1,
Constant *V2, Constant *Mask);
static Constant *getExtractValueTy(const Type *Ty, Constant *Agg,
const unsigned *Idxs, unsigned NumIdxs);
static Constant *getInsertValueTy(const Type *Ty, Constant *Agg,
Constant *Val,
const unsigned *Idxs, unsigned NumIdxs);
template<typename IndexTy>
static Constant *getGetElementPtrImpl(Constant *C,
IndexTy const *IdxList,
unsigned NumIdx, bool InBounds);

public:
// Static methods to construct a ConstantExpr of different kinds. Note that
// these methods may return a object that is not an instance of the
Expand Down Expand Up @@ -839,9 +810,7 @@ class ConstantExpr : public Constant {

/// Select constant expr
///
static Constant *getSelect(Constant *C, Constant *V1, Constant *V2) {
return getSelectTy(V1->getType(), C, V1, V2);
}
static Constant *getSelect(Constant *C, Constant *V1, Constant *V2);

/// get - Return a binary or shift operator constant expression,
/// folding if possible.
Expand All @@ -863,7 +832,9 @@ class ConstantExpr : public Constant {
///
static Constant *getGetElementPtr(Constant *C,
Constant *const *IdxList, unsigned NumIdx,
bool InBounds = false);
bool InBounds = false) {
return getGetElementPtr(C, (Value**)IdxList, NumIdx, InBounds);
}
static Constant *getGetElementPtr(Constant *C,
Value *const *IdxList, unsigned NumIdx,
bool InBounds = false);
Expand Down
Loading

0 comments on commit eaf7980

Please sign in to comment.