00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef SAIL_BLOCK_H_
00013 #define SAIL_BLOCK_H_
00014
00015 #include <boost/serialization/vector.hpp>
00016 #include <boost/serialization/map.hpp>
00017 #include <boost/serialization/list.hpp>
00018 #include <boost/serialization/string.hpp>
00019 #include <boost/serialization/version.hpp>
00020 #include <boost/serialization/split_member.hpp>
00021 #include <boost/serialization/shared_ptr.hpp>
00022 #include <boost/serialization/base_object.hpp>
00023 #include <boost/serialization/export.hpp>
00024 #include <boost/serialization/set.hpp>
00025
00026
00027 #include <set>
00028 #include <string>
00029 using namespace std;
00030
00031 namespace sail {
00032 class CfgEdge;
00033
00037 class Block {
00038 friend class boost::serialization::access;
00039
00040 template<class Archive>
00041 void serialize(Archive & ar, const unsigned int version)
00042 {
00043 ar & block_id;
00044 ar & successors;
00045 ar & predecessors;
00046 }
00047 protected:
00048 int block_id;
00049 set<CfgEdge*> successors;
00050 set<CfgEdge*> predecessors;
00051 public:
00052
00053
00054 Block();
00055 virtual ~Block();
00056
00060 virtual bool is_basicblock();
00061
00066 virtual bool is_superblock();
00067 virtual string to_string() const = 0;
00068 virtual string to_dotty(string prelude, bool pretty_print = true) = 0;
00069
00070 void add_successor_edge(CfgEdge* edge);
00071 void add_predecessor_edge(CfgEdge* edge);
00072 void set_block_id(int id);
00073 int get_block_id() const;
00074
00080 set<CfgEdge*>& get_successors();
00081
00086 set<CfgEdge*>& get_predecessors();
00087
00088
00089 };
00090
00091 }
00092
00093 #endif