PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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

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