PageRenderTime 18ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/llvm/library/iterators/iterator_over_instructions.e

http://github.com/tybor/Liberty
Specman e | 94 lines | 40 code | 17 blank | 37 comment | 0 complexity | 7429bd788fc5c9b1065837c6504b6249 MD5 | raw file
 1-- This file is part of a Liberty Eiffel library.
 2-- See the full copyright at the end.
 3--
 4class ITERATOR_OVER_INSTRUCTIONS
 5
 6inherit
 7   BIDIRECTIONAL_ITERATOR[LLVM_INSTRUCTION]
 8   LLVM_INSTRUCTION_FACTORY
 9
10insert CORE_EXTERNALS
11
12create {ANY} from_block
13
14feature {LLVM_BASIC_BLOCK}
15   from_block (a_block: LLVM_BASIC_BLOCK)
16      require
17         a_block/=Void
18         not a_block.is_deleted
19      do
20         block:=a_block
21      end
22
23feature {ANY}
24   block: LLVM_BASIC_BLOCK
25
26   start
27      do
28         item := wrapper_or_void(llvmget_first_instruction(block.handle))
29      end
30
31   finish
32      do
33         item := wrapper_or_void(llvmget_last_instruction(block.handle))
34      end
35
36   next
37      do
38         item := wrapper_or_void(llvmget_next_instruction(item.handle))
39      end
40
41   previous
42      do
43         item := wrapper_or_void(llvmget_previous_instruction(item.handle))
44      end
45
46   is_off: BOOLEAN
47      do
48         Result:=(item=Void)
49      end
50
51   item: LLVM_INSTRUCTION is attribute end
52
53   generation, iterable_generation: INTEGER is 0
54
55invariant block/=Void
56
57end -- class ITERATOR_OVER_INSTRUCTIONS
58
59--
60-- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
61--
62-- Permission is hereby granted, free of charge, to any person obtaining a copy
63-- of this software and associated documentation files (the "Software"), to deal
64-- in the Software without restriction, including without limitation the rights
65-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
66-- copies of the Software, and to permit persons to whom the Software is
67-- furnished to do so, subject to the following conditions:
68--
69-- The above copyright notice and this permission notice shall be included in
70-- all copies or substantial portions of the Software.
71--
72-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
73-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
74-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
75-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
76-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
77-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
78-- THE SOFTWARE.
79
80
81-- This file is part of LLVM wrappers for Liberty Eiffel.
82--
83-- This library is free software: you can redistribute it and/or modify
84-- it under the terms of the GNU Lesser General Public License as published by
85-- the Free Software Foundation, version 3 of the License.
86--
87-- Liberty Eiffel is distributed in the hope that it will be useful,
88-- but WITHOUT ANY WARRANTY; without even the implied warranty of
89-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
90-- GNU General Public License for more details.
91--
92-- You should have received a copy of the GNU General Public License
93-- along with Liberty Eiffel.  If not, see <http://www.gnu.org/licenses/>.
94--