Remove boilerplate code (unaryOp methods in Compiler)

This commit is contained in:
Joshua Warner
2013-12-18 16:43:15 -07:00
parent 07d0f1172f
commit bd7b66a898
4 changed files with 22 additions and 48 deletions

View File

@ -99,7 +99,6 @@ const unsigned OperandTypeCount = MemoryOperand + 1;
const int NoRegister = -1;
inline bool isBranch(lir::TernaryOperation op) {
return op > FloatMin;
}
@ -120,6 +119,14 @@ inline bool isFloatBinaryOp(lir::TernaryOperation op) {
return op >= FloatAdd && op <= FloatMin;
}
inline bool isGeneralUnaryOp(lir::BinaryOperation op) {
return op == Negate || op == Absolute;
}
inline bool isFloatUnaryOp(lir::BinaryOperation op) {
return op == FloatNegate || op == FloatSquareRoot || op == FloatAbsolute;
}
class Operand { };
class Constant: public Operand {