/src/wrappers/llvm/library/llvm_module_provider.e

http://github.com/tybor/Liberty · Specman e · 64 lines · 37 code · 9 blank · 18 comment · 0 complexity · 9b2f2afd1a4134e60a97a093f3f1a57a MD5 · raw file

  1. class LLVM_MODULE_PROVIDER
  2. -- An helper class providing a module to JIT or interpreter.
  3. inherit
  4. C_STRUCT
  5. EIFFEL_OWNED
  6. redefine
  7. dispose
  8. end
  9. insert CORE_EXTERNALS
  10. create {ANY} from_module
  11. create {WRAPPER} from_external_pointer
  12. feature {ANY}
  13. module: LLVM_MODULE
  14. -- The module owned by Current provider
  15. feature {} -- Creation
  16. from_module (a_module: LLVM_MODULE)
  17. -- Encapsulates `a_module' in a new module provider, taking ownership of the module.
  18. require
  19. a_module/=Void
  20. not a_module.is_owned
  21. do
  22. module:=a_module
  23. module.set_owner(Current)
  24. from_external_pointer(llvmcreate_module_provider_for_existing_module(a_module.handle))
  25. ensure
  26. a_module.is_owned
  27. a_module.owner = Current
  28. module = a_module
  29. end
  30. feature {} -- Disposing
  31. dispose
  32. -- Destroys the module provider MP as well as the contained module. See the destructor llvm::ModuleProvider::~ModuleProvider.
  33. --
  34. do
  35. llvmdispose_module_provider(handle)
  36. end
  37. feature {ANY}
  38. struct_size: like size_t
  39. do
  40. not_yet_implemented
  41. end
  42. end -- class LLVM_MODULE_PROVIDER
  43. -- Copyright (C) 2010-2017: Paolo Redaelli
  44. -- This library is free software; you can redistribute it and/or
  45. -- modify it under the terms of the GNU Lesser General Public License
  46. -- as published by the Free Software Foundation; either version 2.1 of
  47. -- the License, or (at your option) any later version.
  48. -- This library is distributed in the hope that it will be useful, but
  49. -- WITHOUT ANY WARRANTY; without even the implied warranty of
  50. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  51. -- Lesser General Public License for more details.
  52. -- You should have received a copy of the GNU Lesser General Public
  53. -- License along with this library; if not, write to the Free Software
  54. -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  55. -- 02110-1301 USA