CACAO
BasicBlockSchedule.hpp
Go to the documentation of this file.
1 /* src/vm/jit/compiler2/BasicBlockSchedule.hpp - BasicBlockSchedule
2 
3  Copyright (C) 2013
4  CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5 
6  This file is part of CACAO.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2, or (at
11  your option) any later version.
12 
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  02110-1301, USA.
22 
23 */
24 
25 #ifndef _JIT_COMPILER2_BASICBLOCKSCHEDULE
26 #define _JIT_COMPILER2_BASICBLOCKSCHEDULE
27 
29 
30 namespace cacao {
31 namespace jit {
32 namespace compiler2 {
33 
34 class BeginInst;
35 
36 /**
37  * BasicBlockSchedule
38  * TODO: more info
39  */
41 public:
43  typedef BasicBlockListTy::iterator bb_iterator;
44  typedef BasicBlockListTy::const_iterator const_bb_iterator;
45  typedef BasicBlockListTy::const_reverse_iterator const_reverse_bb_iterator;
46 private:
48 protected:
49  void clear() {
50  bb_list.clear();
51  }
52  template<class InputIterator>
53  void insert(bb_iterator pos, InputIterator first, InputIterator last) {
54  bb_list.insert(pos,first,last);
55  }
57  return bb_list.begin();
58  }
60  return bb_list.end();
61  }
62 public:
64 #if 0
65  BeginInst* operator[](const unsigned i) const {
66  return bb_list[i];
67  }
68  BeginInst* get(const unsigned i) const {
69  return bb_list[i];
70  }
71 #endif
73  return bb_list.begin();
74  }
76  return bb_list.end();
77  }
79  return bb_list.rbegin();
80  }
82  return bb_list.rend();
83  }
84  std::size_t size() const {
85  return bb_list.size();
86  }
87 };
88 
89 } // end namespace compiler2
90 } // end namespace jit
91 } // end namespace cacao
92 
93 #endif /* _JIT_COMPILER2_BASICBLOCKSCHEDULE */
94 
95 
96 /*
97  * These are local overrides for various environment variables in Emacs.
98  * Please do not remove this and leave it at the end of the file, where
99  * Emacs will automagically detect them.
100  * ---------------------------------------------------------------------
101  * Local variables:
102  * mode: c++
103  * indent-tabs-mode: t
104  * c-basic-offset: 4
105  * tab-width: 4
106  * End:
107  * vim:noexpandtab:sw=4:ts=4:
108  */
alloc::vector< BeginInst * >::type BasicBlockListTy
This Instruction mark the start of a basic block.
const_reverse_bb_iterator bb_rbegin() const
std::vector< T, Allocator< T > > type
Definition: vector.hpp:38
void insert(bb_iterator pos, InputIterator first, InputIterator last)
MIIterator i
MIIterator pos
const_reverse_bb_iterator bb_rend() const
BasicBlockListTy::const_iterator const_bb_iterator
BasicBlockListTy::const_reverse_iterator const_reverse_bb_iterator
BasicBlockSchedule TODO: more info.