00001
00002
00003
00004
00005
00006
00007
00008 #ifndef SUPERBLOCK_H_
00009 #define SUPERBLOCK_H_
00010 #include "Block.h"
00011 #include "SummaryUnit.h"
00012 #include "Instruction.h"
00013 #include "Identifier.h"
00014
00015 namespace sail {
00016
00017 class Loop;
00018 class BasicBlock;
00019 class Function;
00020
00028 class SuperBlock:public Block, public SummaryUnit {
00029 friend class boost::serialization::access;
00030
00031 template<class Archive>
00032 void serialize(Archive & ar, const unsigned int version)
00033 {
00034 ar & boost::serialization::base_object<sail::Block>(*this);
00035 ar & boost::serialization::base_object<sail::SummaryUnit>(*this);
00036 ar & entry_block;
00037 ar & exit_block;
00038 ar & body;
00039 ar & exit_blocks;
00040 ar & parent_fn;
00041 ar & id;
00042 }
00043 private:
00044 BasicBlock* entry_block;
00045 BasicBlock* exit_block;
00046 set<Block*> body;
00047
00048
00049
00050
00051
00052
00053 set<BasicBlock*> exit_blocks;
00054
00055 Function* parent_fn;
00056
00057
00058 Identifier id;
00059
00060
00061
00062 public:
00063 SuperBlock(Loop* l, Function* parent_fn);
00064 SuperBlock(){};
00065 virtual ~SuperBlock();
00066 virtual string to_string() const;
00067 virtual string to_dotty(string prelude, bool pretty_print = true);
00068
00073 virtual BasicBlock* get_entry_block();
00074
00079 virtual BasicBlock* get_exit_block();
00080
00084 virtual BasicBlock* get_exception_block();
00085 set<Block*> & get_body();
00086
00090 bool is_exit_block(BasicBlock* b);
00091
00096 sail::Function* get_parent_function();
00097
00098
00099
00100
00101
00102 virtual bool is_function();
00103 virtual bool is_superblock();
00104
00105 virtual Identifier get_identifier();
00106
00107
00108 Instruction* get_first_instruction();
00109 Instruction* get_last_instruction();
00110
00111 private:
00112 void make_exitpoint(Loop *l);
00113 };
00114
00115 }
00116
00117 #endif