1 //===-- llvm/iBinary.h - Binary Operator node definitions --------*- C++ -*--=//
3 // This file contains the declarations of all of the Binary Operator classes.
5 //===----------------------------------------------------------------------===//
10 #include "llvm/InstrTypes.h"
12 //===----------------------------------------------------------------------===//
13 // Classes to represent Binary operators
14 //===----------------------------------------------------------------------===//
16 // All of these classes are subclasses of the BinaryOperator class...
19 class GenericBinaryInst : public BinaryOperator {
21 GenericBinaryInst(BinaryOps Opcode, Value *S1, Value *S2,
22 const std::string &Name = "")
23 : BinaryOperator(Opcode, S1, S2, Name) {
27 class SetCondInst : public BinaryOperator {
30 SetCondInst(BinaryOps opType, Value *S1, Value *S2,
31 const std::string &Name = "");
33 // getInverseCondition - Return the inverse of the current condition opcode.
34 // For example seteq -> setne, setgt -> setle, setlt -> setge, etc...
36 BinaryOps getInverseCondition() const;
38 // Methods for support type inquiry through isa, cast, and dyn_cast:
39 static inline bool classof(const SetCondInst *) { return true; }
40 static inline bool classof(const Instruction *I) {
41 return I->getOpcode() == SetEQ || I->getOpcode() == SetNE ||
42 I->getOpcode() == SetLE || I->getOpcode() == SetGE ||
43 I->getOpcode() == SetLT || I->getOpcode() == SetGT;
45 static inline bool classof(const Value *V) {
46 return isa<Instruction>(V) && classof(cast<Instruction>(V));