diff options
Diffstat (limited to 'include/llvm/Constants.h')
| -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 0abe17d365d4e..fdd53823aa0c0 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -917,6 +917,17 @@ public:      return getLShr(C1, C2, true);    } +  /// getBinOpIdentity - Return the identity for the given binary operation, +  /// i.e. a constant C such that X op C = X and C op X = X for every X.  It +  /// returns null if the operator doesn't have an identity. +  static Constant *getBinOpIdentity(unsigned Opcode, Type *Ty); + +  /// getBinOpAbsorber - Return the absorbing element for the given binary +  /// operation, i.e. a constant C such that X op C = C and C op X = C for +  /// every X.  For example, this returns zero for integer multiplication. +  /// It returns null if the operator doesn't have an absorbing element. +  static Constant *getBinOpAbsorber(unsigned Opcode, Type *Ty); +    /// Transparently provide more efficient getOperand methods.    DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);  | 
