diff options
author | Chris Lattner <sabre@nondot.org> | 2004-03-12 05:50:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-03-12 05:50:39 +0000 |
commit | 46a57d8f144af82be46ac925f1c53a3405bcfb3a (patch) | |
tree | 7d162b2d0fd1436588c7dcfa6e57eb36de5af282 | |
parent | 17fa4490104b558bffecf41b12626928ddf8df64 (diff) | |
download | external_llvm-46a57d8f144af82be46ac925f1c53a3405bcfb3a.zip external_llvm-46a57d8f144af82be46ac925f1c53a3405bcfb3a.tar.gz external_llvm-46a57d8f144af82be46ac925f1c53a3405bcfb3a.tar.bz2 |
Add support for select constant exprs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12309 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Constants.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 6a02c5d..1d4892f 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -518,6 +518,8 @@ protected: ConstantExpr(unsigned Opcode, Constant *C, const Type *Ty); // Binary/Shift instruction creation ctor ConstantExpr(unsigned Opcode, Constant *C1, Constant *C2); + // Select instruction creation ctor + ConstantExpr(Constant *C, Constant *V1, Constant *V2); // GEP instruction creation ctor ConstantExpr(Constant *C, const std::vector<Constant*> &IdxList, const Type *DestTy); @@ -528,6 +530,8 @@ protected: Constant *C1, Constant *C2); static Constant *getShiftTy(const Type *Ty, unsigned Opcode, Constant *C1, Constant *C2); + static Constant *getSelectTy(const Type *Ty, + Constant *C1, Constant *C2, Constant *C3); static Constant *getGetElementPtrTy(const Type *Ty, Constant *C, const std::vector<Constant*> &IdxList); @@ -541,6 +545,13 @@ public: /// static Constant *getCast(Constant *C, const Type *Ty); + /// Select constant expr + /// + static Constant *getSelect(Constant *C, Constant *V1, Constant *V2) { + return getSelectTy(V1->getType(), C, V1, V2); + } + + /// ConstantExpr::get - Return a binary or shift operator constant expression, /// folding if possible. /// |