00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef CFGEDGE_H_
00015 #define CFGEDGE_H_
00016
00017 #include <string>
00018 using namespace std;
00019
00020 #include <boost/serialization/vector.hpp>
00021 #include <boost/serialization/map.hpp>
00022 #include <boost/serialization/list.hpp>
00023 #include <boost/serialization/string.hpp>
00024 #include <boost/serialization/version.hpp>
00025 #include <boost/serialization/split_member.hpp>
00026 #include <boost/serialization/shared_ptr.hpp>
00027 #include <boost/serialization/base_object.hpp>
00028 #include <boost/serialization/export.hpp>
00029 #include <boost/serialization/set.hpp>
00030
00031 namespace sail {
00032
00033 class BasicBlock;
00034 class Symbol;
00035 class Block;
00036
00041 class CfgEdge {
00042 friend class boost::serialization::access;
00043
00044 template<class Archive>
00045 void serialize(Archive & ar, const unsigned int version)
00046 {
00047 ar & source;
00048 ar & target;
00049 ar & cond;
00050 ar & backedge;
00051 }
00052 private:
00053 Block* source;
00054 Block* target;
00055 Symbol* cond;
00056 bool backedge;
00057 public:
00058 CfgEdge(Block* source, Block* target, Symbol* cond);
00059 CfgEdge(const CfgEdge& other);
00060 CfgEdge(){};
00061
00066 Block* get_source();
00067
00072 Block* get_target();
00073
00078 bool is_backedge();
00079 void mark_backedge();
00080 void unmark_backedge();
00081
00082 void set_target(Block* b);
00083 void set_source(Block* b);
00084 void set_cond(Symbol* cond);
00085
00091 Symbol* get_cond();
00092 string to_string() const;
00093 string to_string(bool pretty_print) const;
00094 virtual ~CfgEdge();
00095 };
00096
00097 }
00098
00099 #endif