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

http://github.com/tybor/Liberty · Specman e · 96 lines · 42 code · 17 blank · 37 comment · 0 complexity · 791e27ad893fe74ff9a86dd008bf3c55 MD5 · raw file

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