aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-04 05:19:02 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-04 05:19:02 +0000
commit4b94f49091be8e26ce6e49db1268458995299b82 (patch)
tree90771aa8de9a7bae51f8acc6ba924ecca6cabd42 /include
parent3b3844288bb9fa13be228c71e37233039f3e178f (diff)
For PR950: Provide an isCompare method for detection of ICmp and FCmp constant expressions. Change interfaces to allow for ICmp and FCmp predicate values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32167 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Constants.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index 335913813b..d4744d4d72 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -498,7 +498,7 @@ protected:
// 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);
+ Constant *C1, Constant *C2, unsigned short pred = 0);
static Constant *getShiftTy(const Type *Ty,
unsigned Opcode, Constant *C1, Constant *C2);
static Constant *getSelectTy(const Type *Ty,
@@ -554,6 +554,9 @@ public:
/// @brief Return true if this is a convert constant expression
bool isCast() const;
+ /// @brief Return true if this is a compare constant expression
+ bool isCompare() const;
+
/// Select constant expr
///
static Constant *getSelect(Constant *C, Constant *V1, Constant *V2) {
@@ -572,7 +575,8 @@ public:
/// ConstantExpr::get - Return a binary or shift operator constant expression,
/// folding if possible.
///
- static Constant *get(unsigned Opcode, Constant *C1, Constant *C2);
+ static Constant *get(unsigned Opcode, Constant *C1, Constant *C2,
+ unsigned short pred = 0);
/// ConstantExpr::get* - Return some common constants without having to
/// specify the full Instruction::OPCODE identifier.