code_domains.hGo to the documentation of this file.00001
00002 #ifndef _code_domains_h
00003 #define _code_domains_h
00004
00005 #include "Program.h"
00006
00007 class IntraPCodeDomain : public Listable {
00008 private:
00009 bool _empty;
00010 bool _whole_pgm;
00011 ProgramUnit& _pgm;
00012 Statement* _begin;
00013 Statement* _end;
00014 Database<Statement*, IntElem> _map;
00015 protected:
00016 void _build_map();
00017 public:
00018 IntraPCodeDomain(ProgramUnit& pgm, bool whole_pgm=true);
00019 IntraPCodeDomain(ProgramUnit& pgm, Statement& begin, Statement& end);
00020 IntraPCodeDomain(const IntraPCodeDomain& other);
00021 ~IntraPCodeDomain();
00022 bool contains(Statement& stmt);
00023 Statement* begin();
00024 Statement* end();
00025 bool empty();
00026 bool full();
00027 void expand_context_before(Statement& begin, Statement& end);
00028 void expand_context_after(Statement& begin, Statement& end);
00029 void print(ostream& o) const;
00030 Listable* listable_clone() const;
00031 };
00032
00033 inline Statement* IntraPCodeDomain::begin(){
00034 return _begin;
00035 }
00036
00037 inline Statement* IntraPCodeDomain::end(){
00038 return _end;
00039 }
00040
00041 inline bool IntraPCodeDomain::empty(){
00042 return _empty;
00043 }
00044
00045 inline bool IntraPCodeDomain::full(){
00046 return _whole_pgm;
00047 }
00048
00049 class InterPCodeDomain : public Listable{
00050 private:
00051 Database<ProgramUnit*, IntraPCodeDomain> _body;
00052 protected:
00053 void _add_whole_pgms_interproc(Program& prog, ProgramUnit& pgm);
00054 public:
00055 InterPCodeDomain();
00056 InterPCodeDomain(Program& prog, ProgramUnit& pgm,
00057 Statement& begin, Statement& end);
00058 ~InterPCodeDomain();
00059 bool contains(ProgramUnit& pgm, Statement& stmt);
00060 void expand_context_after(ProgramUnit& pgm,
00061 Statement& begin, Statement& end);
00062 void expand_context_before(ProgramUnit& pgm,
00063 Statement& begin, Statement& end);
00064 void expand_context_after(const InterPCodeDomain& another);
00065 void expand_context_add_pgm(Program& prog, ProgramUnit& pgm);
00066 void print(ostream& o) const;
00067 Listable* listable_clone() const;
00068 IntraPCodeDomain* local_domain(ProgramUnit& pgm);
00069 };
00070
00071 inline IntraPCodeDomain* InterPCodeDomain::local_domain(ProgramUnit& pgm){
00072 return _body.find_ref(&pgm);
00073 }
00074
00075 #endif
|