00001 00020 #ifndef LinearityIRInterface_h 00021 #define LinearityIRInterface_h 00022 00023 #include <iostream> 00024 #include <list> 00025 #include <string> 00026 #include <OpenAnalysis/Utils/OA_ptr.hpp> 00027 #include <OpenAnalysis/IRInterface/IRHandles.hpp> 00028 #include <OpenAnalysis/ExprTree/ExprTree.hpp> 00029 //#include <OpenAnalysis/IRInterface/ExprStmtPairIterator.hpp> 00030 #include <OpenAnalysis/IRInterface/AssignPairIterator.hpp> 00031 00032 namespace OA { 00033 namespace Linearity { 00034 00035 00036 // Operations are classified into one of the following types: 00037 enum LinOpType { 00038 OPR_ADDSUB, // Operation is either Add or Subtract 00039 OPR_MPYDIV, // Operation is either Multiply or Divide 00040 OPR_POWER, // Operation is a Power 00041 OPR_LINEAR, // Generic Linear Operation 00042 OPR_NONLINEAR, // Generic Nonlinear Operation 00043 OPR_NONE 00044 }; 00045 00051 class LinearityIRInterface : public virtual IRHandlesIRInterface { 00052 public: 00053 LinearityIRInterface() { } 00054 virtual ~LinearityIRInterface() { } 00055 00057 virtual LinOpType getLinearityOpType(OpHandle op) = 0; 00058 00062 virtual OA_ptr<AssignPairIterator> 00063 getAssignPairIterator(StmtHandle h) = 0; 00064 00066 virtual OA_ptr<ExprTree> getExprTree(ExprHandle h) = 0; 00067 00068 }; 00069 00070 } // end of namespace Linearity 00071 } // end of namespace OA 00072 00073 #endif 00074
1.6.1