/src/wrappers/llvm/library/values/llvm_global_variable.e

http://github.com/tybor/Liberty · Specman e · 61 lines · 35 code · 10 blank · 16 comment · 0 complexity · 6739317a8e1ac6ba0c61caed24ab926b MD5 · raw file

  1. class LLVM_GLOBAL_VARIABLE
  2. inherit LLVM_GLOBAL_VALUE
  3. create {WRAPPER, WRAPPER_HANDLER} from_external_pointer
  4. feature {ANY} -- Queries
  5. initializer: LLVM_VALUE
  6. do
  7. create Result.from_external_pointer(llvmget_initializer(handle))
  8. ensure non_void: Result/=Void
  9. end
  10. is_thread_local: BOOLEAN
  11. do
  12. Result:=llvmis_thread_local(handle).to_boolean
  13. end
  14. is_global_constant: BOOLEAN
  15. do
  16. Result:=llvmis_global_constant(handle).to_boolean
  17. end
  18. feature {ANY} -- Commands
  19. set_initializer (a_constant_value: LLVM_VALUE)
  20. require a_constant_value/=Void
  21. do
  22. llvmset_initializer(handle,a_constant_value.handle)
  23. ensure set: initializer.is_equal(a_constant_value)
  24. end
  25. set_thread_local (a_setting: BOOLEAN)
  26. do
  27. llvmset_thread_local(handle,a_setting.to_integer)
  28. ensure set: is_thread_local=a_setting
  29. end
  30. set_global_constant (a_setting: BOOLEAN)
  31. do
  32. llvmset_global_constant(handle,a_setting.to_integer)
  33. ensure set: is_global_constant=a_setting
  34. end
  35. -- TODO: provide deletiong feature delete do Precursor llvmdelete_global(handle) end
  36. end -- class LLVM_GLOBAL_VARIABLE
  37. -- Copyright (C) 2010-2017: Paolo Redaelli
  38. -- This file is part of LLVM wrappers for Liberty Eiffel.
  39. --
  40. -- This library is free software: you can redistribute it and/or modify
  41. -- it under the terms of the GNU Lesser General Public License as published by
  42. -- the Free Software Foundation, version 3 of the License.
  43. --
  44. -- Liberty Eiffel is distributed in the hope that it will be useful,
  45. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  46. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  47. -- GNU General Public License for more details.
  48. --
  49. -- You should have received a copy of the GNU General Public License
  50. -- along with Liberty Eiffel. If not, see <http://www.gnu.org/licenses/>.
  51. --