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

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

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