00001 00017 #ifndef LinearityVisitor_H 00018 #define LinearityVisitor_H 00019 00020 #include <OpenAnalysis/IRInterface/IRHandles.hpp> 00021 #include <OpenAnalysis/IRInterface/LinearityIRInterface.hpp> 00022 #include <OpenAnalysis/ExprTree/ExprTree.hpp> 00023 #include <OpenAnalysis/ExprTree/ExprTreeVisitor.hpp> 00024 #include <OpenAnalysis/Linearity/LinearityDepsSet.hpp> 00025 #include <OpenAnalysis/Linearity/LinearityMatrixStandard.hpp> 00026 #include <OpenAnalysis/Alias/Interface.hpp> 00027 #include <OpenAnalysis/DataFlow/ParamBindings.hpp> 00028 #include <OpenAnalysis/Linearity/Interface.hpp> 00029 #include <OpenAnalysis/ExprTree/MemRefsVisitor.hpp> 00030 00031 namespace OA { 00032 00033 //-------------------------------------------------------------------- 00036 class LinearityLocsVisitor : public ExprTreeVisitor { 00037 public: 00038 LinearityLocsVisitor(OA_ptr<Linearity::LinearityIRInterface> ir, 00039 OA_ptr<Linearity::Interface> rc, 00040 OA_ptr<Alias::Interface> alias, 00041 OA_ptr<DataFlow::ParamBindings> paramBind); 00042 ~LinearityLocsVisitor() {} 00043 00044 void visitExprTreeBefore(ExprTree&) { } 00045 void visitExprTreeAfter(ExprTree&) { } 00046 00047 //--------------------------------------- 00048 // method for each ExprTree::Node subclass 00049 //--------------------------------------- 00050 // default base class so that visitors can handle unknown 00051 // node sub-classes in a generic fashion 00052 void visitNode(ExprTree::Node&); 00053 00054 void visitOpNode(ExprTree::OpNode& n); 00055 void visitCallNode(ExprTree::CallNode& n); 00056 void visitMemRefNode(ExprTree::MemRefNode& n); 00057 void visitConstSymNode(ExprTree::ConstSymNode& n); 00058 void visitConstValNode(ExprTree::ConstValNode& n); 00059 00060 bool getIsConst() { return mIsConst; } 00061 00063 OA_ptr<Linearity::LinearityDepsSet> getDepsSet() { return mDeps; } 00064 00065 private: 00066 OA_ptr<Linearity::LinearityDepsSet> mDeps; 00067 OA_ptr<Linearity::LinearityIRInterface> mIR; 00068 OA_ptr<Linearity::Interface> mLM; 00069 OA_ptr<Alias::Interface> mAlias; 00070 OA_ptr<DataFlow::ParamBindings> mParamBind; 00071 bool mIsConst; 00072 }; 00073 00074 00075 } // end of OA namespace 00076 00077 #endif
1.6.1