00001 // Sh: A GPU metaprogramming language. 00002 // 00003 // Copyright 2003-2006 Serious Hack Inc. 00004 // 00005 // This library is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public 00007 // License as published by the Free Software Foundation; either 00008 // version 2.1 of the License, or (at your option) any later version. 00009 // 00010 // This library is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with this library; if not, write to the Free Software 00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00018 // MA 02110-1301, USA 00020 #ifndef SHCFGBLOCK_HPP 00021 #define SHCFGBLOCK_HPP 00022 00023 #include <list> 00024 #include "ShBlock.hpp" 00025 #include "ShCtrlGraph.hpp" 00026 00027 namespace SH { 00028 00034 class 00035 SH_DLLEXPORT 00036 ShCfgBlock : public ShBlock { 00037 public: 00038 ShCfgBlock(const ShProgram &program, bool copy=true); 00039 ShCfgBlock(const ShCtrlGraphPtr& cfg, bool copy=true); 00040 ShCfgBlock(const ShCtrlGraphNodePtr& node, bool copy=true); 00041 00042 ~ShCfgBlock(); 00043 00044 ShCtrlGraphNodePtr entry() const; 00045 ShCtrlGraphNodePtr exit() const; 00046 00047 void print(std::ostream& out, int indent) const; 00048 void graphvizDump(std::ostream& out) const; 00049 00050 00051 private: 00052 void init(const ShCtrlGraphPtr& cfg, bool copy); 00053 ShCtrlGraphNodePtr m_entry, m_exit; 00054 }; 00055 00056 typedef ShPointer<ShCfgBlock> ShCfgBlockPtr; 00057 typedef ShPointer<const ShCfgBlock> ShCfgBlockCPtr; 00058 00059 } 00060 00061 #endif
1.4.6